Install_deps: add clang-format packages.
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 21 Mar 2019 13:10:47 +0000 (14:10 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 21 Mar 2019 13:12:30 +0000 (14:12 +0100)
Even though that one is not really useful just to build Blender, we can
as well explicitely include it here, since all 'default' Blender builds
will include full clang/llvm stack anyway (for Cycles and deps)...

build_files/build_environment/install_deps.sh

index b480f4a..7203719 100755 (executable)
@@ -301,6 +301,8 @@ NO_BUILD=false
 NO_CONFIRM=false
 USE_CXX11=true
 
+CLANG_FORMAT_VERSION_MIN="6.0"
+
 PYTHON_VERSION="3.7.0"
 PYTHON_VERSION_MIN="3.7"
 PYTHON_FORCE_BUILD=false
@@ -383,7 +385,6 @@ OPENCOLLADA_FORCE_BUILD=false
 OPENCOLLADA_FORCE_REBUILD=false
 OPENCOLLADA_SKIP=false
 
-
 EMBREE_VERSION="3.2.4"
 EMBREE_FORCE_BUILD=false
 EMBREE_FORCE_REBUILD=false
@@ -2788,6 +2789,17 @@ install_DEB() {
     PRINT ""
   fi
 
+  PRINT ""
+  CLANG_FORMAT="clang-format"
+  check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
+  if [ $? -eq 0 ]; then
+    _packages="$_packages $CLANG_FORMAT"
+  else
+    PRINT ""
+    WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
+    PRINT ""
+  fi
+
   if [ "$WITH_JACK" = true ]; then
     _packages="$_packages libspnav-dev"
     # Only install jack if jack2 is not already installed!
@@ -3439,6 +3451,16 @@ install_RPM() {
     install_packages_RPM libspnav-devel
   fi
 
+  PRINT ""
+  CLANG_FORMAT="clang"  # Yeah, on fedora/suse clang-format is part of main clang package...
+  check_package_version_ge_RPM $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
+  if [ $? -eq 0 ]; then
+    install_packages_RPM $CLANG_FORMAT
+  else
+    PRINT ""
+    WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
+    PRINT ""
+  fi
 
   PRINT ""
   _do_compile_python=false
@@ -3886,6 +3908,18 @@ install_ARCH() {
   fi
 
 
+  PRINT ""
+  CLANG_FORMAT="clang"  # Yeah, on arch clang-format is part of main clang package...
+  check_package_version_ge_ARCH $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
+  if [ $? -eq 0 ]; then
+    install_packages_ARCH $CLANG_FORMAT
+  else
+    PRINT ""
+    WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
+    PRINT ""
+  fi
+
+
   PRINT ""
   _do_compile_python=false
   if [ "$PYTHON_SKIP" = true ]; then