[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52285] trunk/blender/build_files/ build_environment/install_deps.sh: More fixes and cleanup...

Bastien Montagne montagne29 at wanadoo.fr
Fri Nov 16 18:14:03 CET 2012


Revision: 52285
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52285
Author:   mont29
Date:     2012-11-16 17:14:01 +0000 (Fri, 16 Nov 2012)
Log Message:
-----------
More fixes and cleanup...

Now OSL should work for DEB-like systems with CMake (not yet tested with scones, nor fedora).
Fedora version-checking bug should be fixed.
Also simplified a bit compile_FOO funcs code.

Modified Paths:
--------------
    trunk/blender/build_files/build_environment/install_deps.sh

Modified: trunk/blender/build_files/build_environment/install_deps.sh
===================================================================
--- trunk/blender/build_files/build_environment/install_deps.sh	2012-11-16 15:18:14 UTC (rev 52284)
+++ trunk/blender/build_files/build_environment/install_deps.sh	2012-11-16 17:14:01 UTC (rev 52285)
@@ -29,7 +29,7 @@
 
 # OSL needs to be compiled for now!
 OSL_VERSION="1.2.0"
-OSL_SOURCE="https://github.com/DingTo/OpenShadingLanguage/archive/blender-fixes.tar.gz"
+OSL_SOURCE="https://github.com/mont29/OpenShadingLanguage/archive/blender-fixes.tar.gz"
 
 FFMPEG_VERSION="1.0"
 FFMPEG_SOURCE="http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2"
@@ -143,28 +143,31 @@
   # To be changed each time we make edits that would modify the compiled result!
   py_magic=0
 
+  _src=$SRC/Python-$PYTHON_VERSION
+  _inst=$INST/python-$PYTHON_VERSION
+
   # Clean install if needed!
   magic_compile_check python-$PYTHON_VERSION $py_magic
   if [ $? -eq 1 ]; then
-    rm -rf $INST/python-$PYTHON_VERSION
+    rm -rf $_inst
   fi
 
-  if [ ! -d $INST/python-$PYTHON_VERSION ]; then
+  if [ ! -d $_inst ]; then
     INFO "Building Python-$PYTHON_VERSION"
 
     prepare_opt
 
-    if [ ! -d $SRC/Python-$PYTHON_VERSION ]; then
+    if [ ! -d $_src ]; then
       mkdir -p $SRC
-      wget -c $PYTHON_SOURCE -P $SRC
+      wget -c $PYTHON_SOURCE -O $_src.tar.bz2
 
       INFO "Unpacking Python-$PYTHON_VERSION"
-      tar -C $SRC -xf $SRC/Python-$PYTHON_VERSION.tar.bz2
+      tar -C $SRC -xf $_src.tar.bz2
     fi
 
-    cd $SRC/Python-$PYTHON_VERSION
+    cd $_src
 
-    ./configure --prefix=$INST/python-$PYTHON_VERSION --enable-ipv6 \
+    ./configure --prefix=$_inst --enable-ipv6 \
         --enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
         --with-computed-gotos --with-pymalloc
 
@@ -180,6 +183,7 @@
     cd $CWD
   else
     INFO "Own Python-$PYTHON_VERSION is up to date, nothing to do!"
+    INFO "If you want to force rebuild of this lib, delete the '$_src' directory."
   fi
 }
 
@@ -187,30 +191,33 @@
   # To be changed each time we make edits that would modify the compiled result!
   boost_magic=7
 
+  _src=$SRC/boost-$BOOST_VERSION
+  _inst=$INST/boost-$BOOST_VERSION
+
   # Clean install if needed!
   magic_compile_check boost-$BOOST_VERSION $boost_magic
   if [ $? -eq 1 ]; then
-    rm -rf $INST/boost-$BOOST_VERSION
+    rm -rf $_inst
   fi
 
-  if [ ! -d $INST/boost-$BOOST_VERSION ]; then
+  if [ ! -d $_inst ]; then
     INFO "Building Boost-$BOOST_VERSION"
 
     prepare_opt
 
-    if [ ! -d $SRC/boost-$BOOST_VERSION ]; then
+    if [ ! -d $_src ]; then
       INFO "Downloading Boost-$BOOST_VERSION"
       mkdir -p $SRC
-      wget -c $BOOST_SOURCE -O $SRC/boost-$BOOST_VERSION.tar.bz2
-      tar -C $SRC --transform "s,(.*/?)boost_1_[^/]+(.*),\1boost-$BOOST_VERSION\2,x" -xf $SRC/boost-$BOOST_VERSION.tar.bz2
+      wget -c $BOOST_SOURCE -O $_src.tar.bz2
+      tar -C $SRC --transform "s,(.*/?)boost_1_[^/]+(.*),\1boost-$BOOST_VERSION\2,x" -xf $_src.tar.bz2
     fi
 
-    cd $SRC/boost-$BOOST_VERSION
-    if [ ! -f $SRC/boost-$BOOST_VERSION/b2 ]; then
+    cd $_src
+    if [ ! -f $_src/b2 ]; then
       ./bootstrap.sh
     fi
     ./b2 -j$THREADS -a --with-system --with_filesystem --with-thread --with-regex --with-locale --with-date_time \
-         --prefix=$INST/boost-$BOOST_VERSION --disable-icu boost.locale.icu=off install
+         --prefix=$_inst --disable-icu boost.locale.icu=off install
     ./b2 --clean
 
     rm -f $INST/boost
@@ -221,6 +228,7 @@
     cd $CWD
   else
     INFO "Own Boost-$BOOST_VERSION is up to date, nothing to do!"
+    INFO "If you want to force rebuild of this lib, delete the '$_src' directory."
   fi
 }
 
@@ -228,28 +236,31 @@
   # To be changed each time we make edits that would modify the compiled result!
   ocio_magic=1
 
+  _src=$SRC/OpenColorIO-$OCIO_VERSION
+  _inst=$INST/ocio-$OCIO_VERSION
+
   # Clean install if needed!
   magic_compile_check ocio-$OCIO_VERSION $ocio_magic
   if [ $? -eq 1 ]; then
-    rm -rf $INST/ocio-$OCIO_VERSION
+    rm -rf $_inst
   fi
 
-  if [ ! -d $INST/ocio-$OCIO_VERSION ]; then
+  if [ ! -d $_inst ]; then
     INFO "Building OpenColorIO-$OCIO_VERSION"
 
     prepare_opt
 
-    if [ ! -d $SRC/OpenColorIO-$OCIO_VERSION ]; then
+    if [ ! -d $_src ]; then
       INFO "Downloading OpenColorIO-$OCIO_VERSION"
       mkdir -p $SRC
-      wget -c $OCIO_SOURCE -O $SRC/OpenColorIO-$OCIO_VERSION.tar.gz
+      wget -c $OCIO_SOURCE -O $_src.tar.gz
 
       INFO "Unpacking OpenColorIO-$OCIO_VERSION"
       tar -C $SRC --transform "s,(.*/?)imageworks-OpenColorIO[^/]*(.*),\1OpenColorIO-$OCIO_VERSION\2,x" \
-          -xf $SRC/OpenColorIO-$OCIO_VERSION.tar.gz
+          -xf $_src.tar.gz
     fi
 
-    cd $SRC/OpenColorIO-$OCIO_VERSION
+    cd $_src
     # Always refresh the whole build!
     if [ -d build ]; then
       rm -rf build
@@ -264,8 +275,8 @@
     fi
 
     cmake -D CMAKE_BUILD_TYPE=Release \
-          -D CMAKE_PREFIX_PATH=$INST/ocio-$OCIO_VERSION \
-          -D CMAKE_INSTALL_PREFIX=$INST/ocio-$OCIO_VERSION \
+          -D CMAKE_PREFIX_PATH=$_inst \
+          -D CMAKE_INSTALL_PREFIX=$_inst \
           -D CMAKE_CXX_FLAGS="$cflags" \
           -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" \
           ..
@@ -274,11 +285,11 @@
     make install
 
     # Force linking against static libs
-    rm -f $INST/ocio-$OCIO_VERSION/lib/*.so*
+    rm -f $_inst/lib/*.so*
 
     # Additional depencencies
-    cp ext/dist/lib/libtinyxml.a $INST/ocio-$OCIO_VERSION/lib
-    cp ext/dist/lib/libyaml-cpp.a $INST/ocio-$OCIO_VERSION/lib
+    cp ext/dist/lib/libtinyxml.a $_inst/lib
+    cp ext/dist/lib/libyaml-cpp.a $_inst/lib
 
     make clean
 
@@ -290,6 +301,7 @@
     cd $CWD
   else
     INFO "Own OpenColorIO-$OCIO_VERSION is up to date, nothing to do!"
+    INFO "If you want to force rebuild of this lib, delete the '$_src' directory."
   fi
 }
 
@@ -297,26 +309,29 @@
   # To be changed each time we make edits that would modify the compiled result!
   oiio_magic=5
 
+  _src=$SRC/OpenImageIO-$OIIO_VERSION
+  _inst=$INST/oiio-$OIIO_VERSION
+
   # Clean install if needed!
   magic_compile_check oiio-$OIIO_VERSION $oiio_magic
   if [ $? -eq 1 ]; then
-    rm -rf $INST/oiio-$OIIO_VERSION
+    rm -rf $_inst
   fi
 
-  if [ ! -d $INST/oiio-$OIIO_VERSION ]; then
+  if [ ! -d $_inst ]; then
     INFO "Building OpenImageIO-$OIIO_VERSION"
 
     prepare_opt
 
-    if [ ! -d $SRC/OpenImageIO-$OIIO_VERSION ]; then
-      wget -c $OIIO_SOURCE -O "$SRC/OpenImageIO-$OIIO_VERSION.tar.gz"
+    if [ ! -d $_src ]; then
+      wget -c $OIIO_SOURCE -O "$_src.tar.gz"
 
       INFO "Unpacking OpenImageIO-$OIIO_VERSION"
       tar -C $SRC --transform "s,(.*/?)OpenImageIO-oiio[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" \
-          -xf $SRC/OpenImageIO-$OIIO_VERSION.tar.gz
+          -xf $_src.tar.gz
     fi
 
-    cd $SRC/OpenImageIO-$OIIO_VERSION
+    cd $_src
     # Always refresh the whole build!
     if [ -d build ]; then
       rm -rf build
@@ -325,8 +340,8 @@
     cd build
 
     cmake_d="-D CMAKE_BUILD_TYPE=Release \
-             -D CMAKE_PREFIX_PATH=$INST/oiio-$OIIO_VERSION \
-             -D CMAKE_INSTALL_PREFIX=$INST/oiio-$OIIO_VERSION \
+             -D CMAKE_PREFIX_PATH=$_inst \
+             -D CMAKE_INSTALL_PREFIX=$_inst \
              -D BUILDSTATIC=ON"
 
     if [ -d $INST/boost ]; then
@@ -358,42 +373,54 @@
     cd $CWD
   else
     INFO "Own OpenImageIO-$OIIO_VERSION is up to date, nothing to do!"
+    INFO "If you want to force rebuild of this lib, delete the '$_src' directory."
   fi
 }
 
 compile_OSL() {
   # To be changed each time we make edits that would modify the compiled result!
-  osl_magic=0
+  osl_magic=4
 
+  _src=$SRC/OpenShadingLanguage-$OSL_VERSION
+  _inst=$INST/osl-$OSL_VERSION
+
   # Clean install if needed!
   magic_compile_check osl-$OSL_VERSION $osl_magic
   if [ $? -eq 1 ]; then
-    rm -rf $INST/osl-$OSL_VERSION
+    rm -rf $_inst
   fi
 
-  if [ ! -d $INST/osl-$OSL_VERSION ]; then
+  if [ ! -d $_inst ]; then
     INFO "Building OpenShadingLanguage-$OSL_VERSION"
 
     prepare_opt
 
-    if [ ! -d $SRC/OpenShadingLanguage-$OSL_VERSION ]; then
-      wget -c $OSL_SOURCE -O "$SRC/OpenShadingLanguage-$OSL_VERSION.tar.gz"
+    if [ ! -d $_src ]; then
+      # XXX Using git on my own repo for now, looks like archives are not updated immediately... :/
+#      wget -c $OSL_SOURCE -O "$_src.tar.gz"
 
-      INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
-      tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
-          -xf $SRC/OpenShadingLanguage-$OSL_VERSION.tar.gz
+#      INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
+#      tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
+#          -xf $_src.tar.gz
+      git clone https://github.com/mont29/OpenShadingLanguage.git $_src
+      cd $_src
+      git checkout blender-fixes
+      cd $CWD
     fi
 
-    cd $SRC/OpenShadingLanguage-$OSL_VERSION
+    cd $_src
+    # XXX For now, always update from latest repo...
+    git checkout .
+
     # Always refresh the whole build!
-#    if [ -d build ]; then
-#      rm -rf build
-#    fi    
-#    mkdir build
+    if [ -d build ]; then
+      rm -rf build
+    fi    
+    mkdir build
     cd build
 
     cmake_d="-D CMAKE_BUILD_TYPE=Release \
-             -D CMAKE_INSTALL_PREFIX=$INST/osl-$OSL_VERSION
+             -D CMAKE_INSTALL_PREFIX=$_inst
              -D BUILDSTATIC=ON \
              -D BUILD_TESTING=OFF"
 
@@ -405,7 +432,7 @@
       cmake_d="$cmake_d -D OPENIMAGEIOHOME=$INST/oiio"
     fi
 
-    cmake $cmake_d -D CMAKE_CXX_FLAGS="-Wall" ../src
+    cmake $cmake_d ../src
 
     make -j$THREADS
     make install
@@ -419,6 +446,7 @@
     cd $CWD
   else
     INFO "Own OpenShadingLanguage-$OSL_VERSION is up to date, nothing to do!"
+    INFO "If you want to force rebuild of this lib, delete the '$_src' directory."
   fi
 }
 
@@ -426,26 +454,29 @@
   # To be changed each time we make edits that would modify the compiled result!
   ffmpeg_magic=0
 
+  _src=$SRC/ffmpeg-$FFMPEG_VERSION
+  _inst=$INST/ffmpeg-$FFMPEG_VERSION
+
   # Clean install if needed!
   magic_compile_check ffmpeg-$FFMPEG_VERSION $ffmpeg_magic
   if [ $? -eq 1 ]; then
-    rm -rf $INST/ffmpeg-$FFMPEG_VERSION
+    rm -rf $_inst
   fi
 
-  if [ ! -d $INST/ffmpeg-$FFMPEG_VERSION ]; then
+  if [ ! -d $_inst ]; then
     INFO "Building ffmpeg-$FFMPEG_VERSION"
 
     prepare_opt
 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list