diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-17 22:38:01 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-17 22:38:01 +0300 |
commit | f08ab30d142e4428bd71191be3ab162258346b70 (patch) | |
tree | 7c22aecd8ce60102f1f111f7574a5bc0a64bf6de /build_files/build_environment/install_deps.sh | |
parent | 41d7e294ab2d9473cda0812887f171022c291711 (diff) |
Install_deps.sh: More attempt to fix building OSL on newer distro.
Now it looks like our version of OSL is not compatible with OIIO 1.5... sigh...
Diffstat (limited to 'build_files/build_environment/install_deps.sh')
-rwxr-xr-x | build_files/build_environment/install_deps.sh | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 30360a63c06..a7ebe5d0443 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -228,6 +228,7 @@ _with_built_openexr=false OIIO_VERSION="1.4.16" OIIO_VERSION_MIN="1.4.0" +OIIO_VERSION_MAX="1.5.0" # Not supported by current OSL... OIIO_FORCE_REBUILD=false OIIO_SKIP=false @@ -627,6 +628,18 @@ version_ge() { fi } +# Return 0 if $3 > $1 >= $2, else 1. +# $1 and $2 should be version numbers made of numbers only. +version_ge_lt() { + version_ge $1 $3 + if [ $? -eq 1 ]; then + return 1 + else + version_ge $1 $2 + return $? + fi +} + # Return 0 if $1 is into $2 (e.g. 3.3.2 is into 3.3, but not 3.3.0 or 3.3.5), else 1. # $1 and $2 should be version numbers made of numbers only. # $1 should be at least as long as $2! @@ -1877,6 +1890,17 @@ check_package_version_ge_DEB() { return $? } +check_package_version_ge_lt_DEB() { + v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)?(([0-9]+\.?)+).*/\2/'` + + if [ -z "$v" ]; then + return 1 + fi + + version_ge_lt $v $2 $3 + return $? +} + install_packages_DEB() { if [ ! $SUDO ]; then WARNING "--no-sudo enabled, impossible to run apt-get install for $@, you'll have to do it yourself..." @@ -2159,7 +2183,7 @@ install_DEB() { if $OIIO_SKIP; then WARNING "Skipping OpenImageIO installation, as requested..." else - check_package_version_ge_DEB libopenimageio-dev $OIIO_VERSION_MIN + check_package_version_ge_lt_DEB libopenimageio-dev $OIIO_VERSION_MIN $OIIO_VERSION_MAX if [ $? -eq 0 -a $_with_built_openexr == false ]; then install_packages_DEB libopenimageio-dev clean_OIIO @@ -2325,6 +2349,17 @@ check_package_version_ge_RPM() { return $? } +check_package_version_ge_lt_RPM() { + v=`get_package_version_RPM $1` + + if [ -z "$v" ]; then + return 1 + fi + + version_ge_lt $v $2 $3 + return $? +} + install_packages_RPM() { rpm_flavour if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then @@ -2608,7 +2643,7 @@ install_RPM() { if $OIIO_SKIP; then WARNING "Skipping OpenImageIO installation, as requested..." else - check_package_version_ge_RPM OpenImageIO-devel $OIIO_VERSION_MIN + check_package_version_ge_lt_RPM OpenImageIO-devel $OIIO_VERSION_MIN $OIIO_VERSION_MAX if [ $? -eq 0 -a $_with_built_openexr == false ]; then install_packages_RPM OpenImageIO-devel clean_OIIO @@ -2748,6 +2783,17 @@ check_package_version_ge_ARCH() { return $? } +check_package_version_ge_lt_ARCH() { + v=`get_package_version_ARCH $1` + + if [ -z "$v" ]; then + return 1 + fi + + version_ge_lt $v $2 $3 + return $? +} + install_packages_ARCH() { if [ ! $SUDO ]; then WARNING "--no-sudo enabled, impossible to run pacman for $@, you'll have to do it yourself..." @@ -2937,7 +2983,7 @@ install_ARCH() { if $OIIO_SKIP; then WARNING "Skipping OpenImageIO installation, as requested..." else - check_package_version_ge_ARCH openimageio $OIIO_VERSION_MIN + check_package_version_ge_lt_ARCH openimageio $OIIO_VERSION_MIN $OIIO_VERSION_MAX if [ $? -eq 0 ]; then install_packages_ARCH openimageio clean_OIIO |