diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-13 13:29:22 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-13 13:29:22 +0400 |
commit | 0b1411046b5c63b92c54feb1391ad1863b9b798e (patch) | |
tree | 5f8ec1395878f8bd5ca51d1895389dc257722fad /build_files/build_environment/install_deps.sh | |
parent | 140d382cee1bc70b08a207677237c268113f55ee (diff) |
Install dependencies script: added support of OpenSUSE
Currently it'll install basic packages only and will compile all
python, boost, oiio, ocio and ffmpeg.
Diffstat (limited to 'build_files/build_environment/install_deps.sh')
-rwxr-xr-x | build_files/build_environment/install_deps.sh | 101 |
1 files changed, 81 insertions, 20 deletions
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh index 8ca4ca4c7c4..9811e836acc 100755 --- a/build_files/build_environment/install_deps.sh +++ b/build_files/build_environment/install_deps.sh @@ -16,8 +16,8 @@ HASXVID=false HASVPX=false HASMP3LAME=false HASX264=false - -YUM="yum" +HASOPENJPEG=false +HASSCHRO=false ERROR() { echo "${@}" @@ -31,13 +31,9 @@ detect_distro() { if [ -f /etc/debian_version ]; then DISTRO="DEB" elif [ -f /etc/redhat-release ]; then - if which yum > /dev/null 2>&1; then - DISTRO="RPM" - YUM="yum" - elif which zypper > /dev/null 2>&1; then - DISTRO="RPM" - YUM="zypper" - fi + DISTRO="RPM" + elif [ -f /etc/SuSE-release ]; then + DISTRO="SUSE" fi } @@ -247,11 +243,19 @@ compile_FFmpeg() { extra="$extra --enable-libx264" fi + if $HASOPENJPEG; then + extra="$extra --enable-libopenjpeg" + fi + + if $HASSCHRO; then + extra="$extra --enable-libschroedinger" + fi + ./configure --cc="gcc -Wl,--as-needed" --extra-ldflags="-pthread -static-libgcc" \ --prefix=/opt/lib/ffmpeg-$FFMPEG_VERSION --enable-static --enable-avfilter --disable-vdpau \ - --disable-bzlib --disable-libgsm --enable-libschroedinger --disable-libspeex --enable-libtheora \ + --disable-bzlib --disable-libgsm --disable-libspeex --enable-libtheora \ --enable-libvorbis --enable-pthreads --enable-zlib --enable-stripping --enable-runtime-cpudetect \ - --disable-vaapi --enable-libopenjpeg --disable-libfaac --disable-nonfree --enable-gpl \ + --disable-vaapi --disable-libfaac --disable-nonfree --enable-gpl \ --disable-postproc --disable-x11grab --disable-librtmp --disable-libopencore-amrnb \ --disable-libopencore-amrwb --disable-libdc1394 --disable-version3 --disable-outdev=sdl \ --disable-outdev=alsa --disable-indev=sdl --disable-indev=alsa --disable-indev=jack \ @@ -294,6 +298,9 @@ install_DEB() { libglew-dev yasm libschroedinger-dev libtheora-dev libvorbis-dev libsdl1.2-dev \ libfftw3-dev libjack-dev python-dev patch + HASOPENJPEG=true + HASSCHRO=true + check_package_DEB libxvidcore4-dev if [ $? -eq 0 ]; then sudo apt-get install -y libxvidcore4-dev @@ -381,7 +388,7 @@ install_DEB() { } check_package_RPM() { - r=`$YUM info $1 | grep -c 'Summary'` + r=`yum info $1 | grep -c 'Summary'` if [ $r -ge 1 ]; then return 0 @@ -391,7 +398,7 @@ check_package_RPM() { } check_package_version_RPM() { - v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+)/\1/'` + v=`yum info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'` # for now major and minor versions only (as if x.y, not x.y.z) r=`echo $v | grep -c $2` @@ -406,39 +413,42 @@ check_package_version_RPM() { install_RPM() { INFO "Installing dependencies for RPM-based distributive" - sudo $YUM -y update + sudo yum -y update - sudo $YUM -y install gcc gcc-c++ cmake scons libpng-devel libtiff-devel \ + sudo yum -y install gcc gcc-c++ cmake scons libpng-devel libtiff-devel \ freetype-devel libX11-devel libXi-devel wget libsqlite3x-devel ncurses-devel \ readline-devel openjpeg-devel openexr-devel openal-soft-devel \ glew-devel yasm schroedinger-devel libtheora-devel libvorbis-devel SDL-devel \ fftw-devel lame-libs jack-audio-connection-kit-devel x264-devel libspnav-devel \ libjpeg-devel patch python-devel - check_package_version_RPM python-devel 3.3 + HASOPENJPEG=true + HASSCHRO=true + + check_package_version_RPM python-devel 3.3. if [ $? -eq 0 ]; then - sudo $YUM install -y python-devel + sudo yum install -y python-devel else compile_Python fi check_package_RPM boost-devel if [ $? -eq 0 ]; then - sudo $YUM install -y boost-devel + sudo yum install -y boost-devel else compile_Boost fi check_package_RPM OpenColorIO-devel if [ $? -eq 0 ]; then - sudo $YUM install -y OpenColorIO-devel + sudo yum install -y OpenColorIO-devel else compile_OCIO fi check_package_RPM OpenImageIO-devel if [ $? -eq 0 ]; then - sudo $YUM install -y OpenImageIO-devel + sudo yum install -y OpenImageIO-devel else compile_OIIO fi @@ -447,6 +457,55 @@ install_RPM() { compile_FFmpeg } +check_package_SUSE() { + r=`zypper info $1 | grep -c 'Summary'` + + if [ $r -ge 1 ]; then + return 0 + else + return 1 + fi +} + +check_package_version_SUSE() { + v=`zypper info $1 | grep Version | tail -n 1 | sed -r 's/.*:\s+(([0-9]+\.?)+).*/\1/'` + + # for now major and minor versions only (as if x.y, not x.y.z) + r=`echo $v | grep -c $2` + + if [ $r -ge 1 ]; then + return 0 + else + return 1 + fi +} + +install_SUSE() { + INFO "Installing dependencies for SuSE-based distributive" + + sudo zypper --non-interactive update --auto-agree-with-licenses + + sudo zypper --non-interactive install --auto-agree-with-licenses \ + gcc gcc-c++ libSDL-devel openal-soft-devel libpng12-devel libjpeg62-devel \ + libtiff-devel OpenEXR-devel yasm libtheora-devel libvorbis-devel cmake \ + scons + + check_package_version_SUSE python3-devel 3.3. + if [ $? -eq 0 ]; then + sudo zypper --non-interactive install --auto-agree-with-licenses python3-devel + else + compile_Python + fi + + # can not see boost_locale in repo, so let's build own boost + compile_Boost + + # this libraries are also missing in the repo + compile_OCIO + compile_OIIO + compile_FFmpeg +} + print_info() { INFO "" INFO "If you're using CMake add this to your configuration flags:" @@ -495,6 +554,8 @@ elif [ "$DISTRO" = "DEB" ]; then install_DEB elif [ "$DISTRO" = "RPM" ]; then install_RPM +elif [ "$DISTRO" = "SUSE" ]; then + install_SUSE fi print_info |