Update install_deps.sh for ArchLinux.

The script is updated for ArchLinux, since all dependencies are included in Arch's official repositories.

I've made a few changes, such as enabling OCIO and OSD without requiring locally installed lib-path, and a fix to ''get_package_version_ARCH()' so it ignores package epoch (as in the case of ffmpeg).

I intend to look at OpenVDB next.

Reviewers: mont29

Differential Revision: https://developer.blender.org/D1901
This commit is contained in:
Ejner Fergo
2016-04-21 10:44:46 +02:00
committed by Bastien Montagne
parent c0943babdf
commit 7205bac989
2 changed files with 61 additions and 70 deletions

View File

@@ -341,7 +341,7 @@ OPENVDB_SKIP=false
# Version?? # Version??
OPENCOLLADA_VERSION="1.3" OPENCOLLADA_VERSION="1.3"
OPENCOLLADA_FORCE_BUILD=true # no package! OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false OPENCOLLADA_SKIP=false
@@ -3288,7 +3288,7 @@ install_RPM() {
#### Install on ARCH-like #### #### Install on ARCH-like ####
get_package_version_ARCH() { get_package_version_ARCH() {
pacman -Si $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/' pacman -Si $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+?(([0-9]+\.?)+).*/\1/'
} }
check_package_ARCH() { check_package_ARCH() {
@@ -3385,8 +3385,8 @@ install_ARCH() {
_packages="base-devel git cmake \ _packages="base-devel git cmake \
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \ libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw \ $OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw intel-tbb \
libxml2 yaml-cpp tinyxml" libxml2 yaml-cpp tinyxml python-requests jemalloc"
OPENJPEG_USE=true OPENJPEG_USE=true
VORBIS_USE=true VORBIS_USE=true
@@ -3394,8 +3394,7 @@ install_ARCH() {
THEORA_USE=true THEORA_USE=true
if [ "$WITH_ALL" = true ]; then if [ "$WITH_ALL" = true ]; then
# No libspacenav in official arch repos... _packages="$_packages jack libspnav"
_packages="$_packages jack"
fi fi
PRINT "" PRINT ""
@@ -3456,7 +3455,6 @@ install_ARCH() {
install_packages_ARCH python install_packages_ARCH python
clean_Python clean_Python
PRINT "" PRINT ""
if [ "$WITH_NUMPY" = true ]; then
if [ "$NUMPY_SKIP" = true ]; then if [ "$NUMPY_SKIP" = true ]; then
WARNING "Skipping NumPy installation, as requested..." WARNING "Skipping NumPy installation, as requested..."
else else
@@ -3465,8 +3463,7 @@ install_ARCH() {
install_packages_ARCH python-numpy install_packages_ARCH python-numpy
else else
WARNING "Sorry, using python package but no valid numpy package available!" \ WARNING "Sorry, using python package but no valid numpy package available!" \
" Use --build-numpy to force building of both Python and NumPy." "Use --build-numpy to force building of both Python and NumPy."
fi
fi fi
fi fi
else else
@@ -3501,27 +3498,21 @@ install_ARCH() {
fi fi
fi fi
PRINT "" PRINT ""
_do_compile_ocio=false
if [ "$OCIO_SKIP" = true ]; then if [ "$OCIO_SKIP" = true ]; then
WARNING "Skipping OpenColorIO installation, as requested..." WARNING "Skipping OpenColorIO installation, as requested..."
elif [ "$OCIO_FORCE_BUILD" = true ]; then elif [ "$OCIO_FORCE_BUILD" = true ]; then
INFO "Forced OpenColorIO building, as requested..." INFO "Forced OpenColorIO building, as requested..."
_do_compile_ocio=true
else
# XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)!
#check_package_version_ge_ARCH opencolorio $OCIO_VERSION_MIN
#if [ $? -eq 0 ]; then
#install_packages_ARCH opencolorio yaml-cpp tinyxml
#clean_OCIO
#else
_do_compile_ocio=true
#fi
fi
if [ "$_do_compile_ocio" = true ]; then
install_packages_ARCH yaml-cpp tinyxml
compile_OCIO compile_OCIO
else
check_package_version_ge_ARCH opencolorio $OCIO_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_ARCH opencolorio
clean_OCIO
else
compile_OCIO
fi
fi fi
@@ -3570,11 +3561,11 @@ install_ARCH() {
INFO "Forced LLVM building, as requested..." INFO "Forced LLVM building, as requested..."
_do_compile_llvm=true _do_compile_llvm=true
else else
check_package_version_match_ARCH clang $LLVM_VERSION check_package_version_match_ARCH llvm35 $LLVM_VERSION_MIN
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
install_packages_ARCH llvm clang install_packages_ARCH llvm35 clang35
have_llvm=true have_llvm=true
LLVM_VERSION=`check_package_version_ge_ARCH clang $LLVM_VERSION_MIN` LLVM_VERSION=`get_package_version_ARCH llvm`
LLVM_VERSION_FOUND=$LLVM_VERSION LLVM_VERSION_FOUND=$LLVM_VERSION
clean_LLVM clean_LLVM
else else
@@ -3586,8 +3577,6 @@ install_ARCH() {
install_packages_ARCH libffi install_packages_ARCH libffi
# LLVM can't find the arch ffi header dir... # LLVM can't find the arch ffi header dir...
_FFI_INCLUDE_DIR=`pacman -Ql libffi | grep -e ".*/ffi.h" | awk '{print $2}' | sed -r 's/(.*)\/ffi.h/\1/'` _FFI_INCLUDE_DIR=`pacman -Ql libffi | grep -e ".*/ffi.h" | awk '{print $2}' | sed -r 's/(.*)\/ffi.h/\1/'`
# LLVM 3.1 needs python2 to build and arch defaults to python3
_PYTHON2_BIN="/usr/bin/python2"
PRINT "" PRINT ""
compile_LLVM compile_LLVM
have_llvm=true have_llvm=true
@@ -3603,19 +3592,18 @@ install_ARCH() {
INFO "Forced OpenShadingLanguage building, as requested..." INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true _do_compile_osl=true
else else
check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN # XXX Compile for now due to requirement of LLVM 3.4 ...
if [ $? -eq 0 ]; then #check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
install_packages_ARCH openshadinglanguage #if [ $? -eq 0 ]; then
clean_OSL # install_packages_ARCH openshadinglanguage
else # clean_OSL
#else
_do_compile_osl=true _do_compile_osl=true
fi #fi
fi fi
if [ "$_do_compile_osl" = true ]; then if [ "$_do_compile_osl" = true ]; then
if [ "$have_llvm" = true ]; then if [ "$have_llvm" = true ]; then
#XXX Note: will fail to build with LLVM 3.2!
install_packages_ARCH intel-tbb
PRINT "" PRINT ""
compile_OSL compile_OSL
else else
@@ -3625,21 +3613,19 @@ install_ARCH() {
PRINT "" PRINT ""
_do_compile_osd=false
if [ "$OSD_SKIP" = true ]; then if [ "$OSD_SKIP" = true ]; then
WARNING "Skipping OpenSubdiv installation, as requested..." WARNING "Skipping OpenSubdiv installation, as requested..."
elif [ "$OSD_FORCE_BUILD" = true ]; then elif [ "$OSD_FORCE_BUILD" = true ]; then
INFO "Forced OpenSubdiv building, as requested..." INFO "Forced OpenSubdiv building, as requested..."
_do_compile_osd=true
else
# No package currently? Just build for now!
_do_compile_osd=true
fi
if [ "$_do_compile_osd" = true ]; then
install_packages_ARCH intel-tbb
PRINT ""
compile_OSD compile_OSD
else
check_package_version_ge_ARCH opensubdiv $OSD_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_ARCH opensubdiv
clean_OSD
else
compile_OSD
fi
fi fi
@@ -3871,7 +3857,7 @@ print_info_ffmpeglink_RPM() {
} }
print_info_ffmpeglink_ARCH() { print_info_ffmpeglink_ARCH() {
pacman -Ql $_packages | grep -e ".*\/lib[^\/]\+\.so$" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", $0)); nlines++ }' pacman -Ql $_packages | grep -e ".*\/lib[^\/]\+\.so$" | gawk '{ printf(nlines ? "'"$_ffmpeg_list_sep"'%s" : "%s", gensub(/.*lib([^\/]+)\.so/, "\\1", "g", $0)); nlines++ }'
} }
print_info_ffmpeglink() { print_info_ffmpeglink() {
@@ -3972,12 +3958,15 @@ print_info() {
_buildargs="$_buildargs $_1 $_2" _buildargs="$_buildargs $_1 $_2"
fi fi
if [ -d $INST/ocio ]; then if [ "$OCIO_SKIP" = false ]; then
_1="-D WITH_OPENCOLORIO=ON" _1="-D WITH_OPENCOLORIO=ON"
_2="-D OPENCOLORIO_ROOT_DIR=$INST/ocio"
PRINT " $_1" PRINT " $_1"
PRINT " $_2" _buildargs="$_buildargs $_1"
_buildargs="$_buildargs $_1 $_2" if [ -d $INST/ocio ]; then
_1="-D OPENCOLORIO_ROOT_DIR=$INST/ocio"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi fi
if [ -d $INST/openexr ]; then if [ -d $INST/openexr ]; then
@@ -4022,12 +4011,15 @@ print_info() {
_buildargs="$_buildargs $_1 $_2" _buildargs="$_buildargs $_1 $_2"
fi fi
if [ -d $INST/osd ]; then if [ "$OSD_SKIP" = false ]; then
_1="-D WITH_OPENSUBDIV=ON" _1="-D WITH_OPENSUBDIV=ON"
_2="-D OPENSUBDIV_ROOT_DIR=$INST/osd"
PRINT " $_1" PRINT " $_1"
PRINT " $_2" _buildargs="$_buildargs $_1"
_buildargs="$_buildargs $_1 $_2" if [ -d $INST/osd ]; then
_1="-D OPENSUBDIV_ROOT_DIR=$INST/osd"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi fi
if [ "$WITH_OPENCOLLADA" = true ]; then if [ "$WITH_OPENCOLLADA" = true ]; then

View File

@@ -1,12 +1,11 @@
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@
set(LLVM_VERSION_MAJOR 3) set(LLVM_VERSION_MINOR 4)
set(LLVM_VERSION_MINOR 1)
-set(PACKAGE_VERSION "\${LLVM_VERSION_MAJOR}.\${LLVM_VERSION_MINOR}svn")
+set(PACKAGE_VERSION "\${LLVM_VERSION_MAJOR}.\${LLVM_VERSION_MINOR}")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (NOT PACKAGE_VERSION)
- set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}svn")
+ set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}")
endif()
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)