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.
This commit is contained in:
@@ -29,7 +29,7 @@ LLVM_VERSION_MIN="3.0"
|
||||
|
||||
# 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 @@ compile_Python() {
|
||||
# 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 @@ compile_Python() {
|
||||
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 @@ compile_Boost() {
|
||||
# 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 @@ compile_Boost() {
|
||||
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 @@ compile_OCIO() {
|
||||
# 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 @@ compile_OCIO() {
|
||||
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 @@ compile_OCIO() {
|
||||
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 @@ compile_OCIO() {
|
||||
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 @@ compile_OIIO() {
|
||||
# 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 @@ compile_OIIO() {
|
||||
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 @@ compile_OIIO() {
|
||||
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 @@ compile_OSL() {
|
||||
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 @@ compile_OSL() {
|
||||
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 @@ compile_FFmpeg() {
|
||||
# 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
|
||||
|
||||
if [ ! -d $SRC/ffmpeg-$FFMPEG_VERSION ]; then
|
||||
if [ ! -d $_src ]; then
|
||||
INFO "Downloading ffmpeg-$FFMPEG_VERSION"
|
||||
wget -c $FFMPEG_SOURCE -P $SRC
|
||||
wget -c $FFMPEG_SOURCE -O "$_src.tar.bz2"
|
||||
|
||||
INFO "Unpacking ffmpeg-$FFMPEG_VERSION"
|
||||
tar -C $SRC -xf $SRC/ffmpeg-$FFMPEG_VERSION.tar.bz2
|
||||
tar -C $SRC -xf $_src.tar.bz2
|
||||
fi
|
||||
|
||||
cd $SRC/ffmpeg-$FFMPEG_VERSION
|
||||
cd $_src
|
||||
|
||||
extra=""
|
||||
|
||||
@@ -482,7 +513,7 @@ compile_FFmpeg() {
|
||||
fi
|
||||
|
||||
./configure --cc="gcc -Wl,--as-needed" --extra-ldflags="-pthread -static-libgcc" \
|
||||
--prefix=$INST/ffmpeg-$FFMPEG_VERSION --enable-static --enable-avfilter --disable-vdpau \
|
||||
--prefix=$_inst --enable-static --enable-avfilter --disable-vdpau \
|
||||
--disable-bzlib --disable-libgsm --disable-libspeex \
|
||||
--enable-pthreads --enable-zlib --enable-stripping --enable-runtime-cpudetect \
|
||||
--disable-vaapi --disable-libfaac --disable-nonfree --enable-gpl \
|
||||
@@ -503,6 +534,7 @@ compile_FFmpeg() {
|
||||
cd $CWD
|
||||
else
|
||||
INFO "Own ffmpeg-$FFMPEG_VERSION is up to date, nothing to do!"
|
||||
INFO "If you want to force rebuild of this lib, delete the '$_src' directory."
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -562,7 +594,7 @@ install_DEB() {
|
||||
libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev libncurses5-dev \
|
||||
libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV libopenexr-dev libopenal-dev \
|
||||
libglew-dev yasm $SCHRO_DEV $THEORA_DEV $VORBIS_DEV libsdl1.2-dev \
|
||||
libfftw3-dev libjack-dev python-dev patch flex bison llvm-dev clang libtbb-dev
|
||||
libfftw3-dev libjack-dev python-dev patch flex bison llvm-dev clang libtbb-dev git
|
||||
|
||||
OPENJPEG_USE=true
|
||||
SCHRO_USE=true
|
||||
@@ -683,23 +715,23 @@ check_package_RPM() {
|
||||
check_package_version_match_RPM() {
|
||||
v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
|
||||
|
||||
if [ $v -ge 1 ]; then
|
||||
version_match $v $2
|
||||
return $?
|
||||
else
|
||||
if [ -z "$v" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
version_match $v $2
|
||||
return $?
|
||||
}
|
||||
|
||||
check_package_version_ge_RPM() {
|
||||
v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'`
|
||||
|
||||
if [ $v -ge 1 ]; then
|
||||
version_ge $v $2
|
||||
return $?
|
||||
else
|
||||
if [ -z "$v" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
version_ge $v $2
|
||||
return $?
|
||||
}
|
||||
|
||||
install_RPM() {
|
||||
@@ -914,6 +946,11 @@ print_info() {
|
||||
INFO " -D Boost_NO_SYSTEM_PATHS=ON"
|
||||
fi
|
||||
|
||||
if [ -d $INST/osl ]; then
|
||||
INFO " -D CYCLES_OSL=$INST/osl"
|
||||
INFO " -D WITH_CYCLES_OSL=ON"
|
||||
fi
|
||||
|
||||
if [ -d $INST/ffmpeg ]; then
|
||||
INFO " -D WITH_CODEC_FFMPEG=ON"
|
||||
INFO " -D FFMPEG=$INST/ffmpeg"
|
||||
|
||||
Reference in New Issue
Block a user