~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to build_files/build_environment/install_deps.sh

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
ARGS=$( \
26
26
getopt \
27
27
-o s:i:t:h \
28
 
--long source:,install:,tmp:,threads:,help,with-all,with-osl,with-opencollada,all-static,force-all,\
 
28
--long source:,install:,tmp:,threads:,help,with-all,with-opencollada,all-static,force-all,\
29
29
force-python,force-numpy,force-boost,force-ocio,force-oiio,force-llvm,force-osl,force-opencollada,\
30
30
force-ffmpeg,skip-python,skip-numpy,skip-boost,skip-ocio,skip-oiio,skip-llvm,skip-osl,skip-ffmpeg,\
31
 
skip-opencollada \
 
31
skip-opencollada,required-numpy \
32
32
-- "$@" \
33
33
)
34
34
 
42
42
# Do not install some optional, potentially conflicting libs by default...
43
43
WITH_ALL=false
44
44
 
45
 
# Do not yet enable osl, use --with-osl (or --with-all) option to try it.
46
 
WITH_OSL=false
47
 
 
48
45
# Do not yet enable opencollada, use --with-opencollada (or --with-all) option to try it.
49
46
WITH_OPENCOLLADA=false
50
47
 
51
48
# Try to link everything statically. Use this to produce portable versions of blender.
52
49
ALL_STATIC=false
53
50
 
54
 
THREADS=`cat /proc/cpuinfo | grep cores | uniq | sed -e "s/.*: *\(.*\)/\\1/"`
 
51
THREADS=`cat /proc/cpuinfo | grep processor | wc -l`
55
52
if [ -z "$THREADS" ]; then
56
53
  THREADS=1
57
54
fi
63
60
 
64
61
Number of threads for building: \$THREADS (automatically detected, use --threads=<nbr> to override it).
65
62
Full install: \$WITH_ALL (use --with-all option to enable it).
66
 
Building OSL: \$WITH_OSL (use --with-osl option to enable it).
67
63
Building OpenCOLLADA: \$WITH_OPENCOLLADA (use --with-opencollada option to enable it).
68
64
All static linking: \$ALL_STATIC (use --all-static option to enable it).
69
65
 
96
92
        how your package system is set…).
97
93
        Note this option also implies all other (more specific) --with-foo options below.
98
94
 
99
 
    --with-osl
100
 
        Try to install or build the OpenShadingLanguage libraries (and their dependencies).
101
 
        Still experimental!
102
 
 
103
95
    --with-opencollada
104
96
        Build and install the OpenCOLLADA libraries.
105
97
 
174
166
        Unconditionally skip OpenCOLLADA installation/building.
175
167
 
176
168
    --skip-ffmpeg
177
 
        Unconditionally skip FFMpeg installation/building.\""
 
169
        Unconditionally skip FFMpeg installation/building.
 
170
 
 
171
    --required-numpy
 
172
        Use this in case your distro features a valid python package, but no matching Numpy one.
 
173
        It will force compilation of both python 3.3 and numpy 1.7.\""
178
174
 
179
175
##### Main Vars #####
180
176
 
181
 
PYTHON_VERSION="3.3.0"
 
177
PYTHON_VERSION="3.3.2"
182
178
PYTHON_VERSION_MIN="3.3"
183
179
PYTHON_SOURCE="http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.bz2"
184
180
PYTHON_FORCE_REBUILD=false
189
185
NUMPY_SOURCE="http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz"
190
186
NUMPY_FORCE_REBUILD=false
191
187
NUMPY_SKIP=false
 
188
NUMPY_REQUIRED=false
192
189
 
193
190
BOOST_VERSION="1.51.0"
194
191
_boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
196
193
BOOST_VERSION_MIN="1.49"
197
194
BOOST_FORCE_REBUILD=false
198
195
BOOST_SKIP=false
199
 
_need_boost_ldconfig=false
200
196
 
201
197
OCIO_VERSION="1.0.7"
202
198
OCIO_SOURCE="https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION"
218
214
OIIO_VERSION_MIN="1.1"
219
215
OIIO_FORCE_REBUILD=false
220
216
OIIO_SKIP=false
221
 
_need_oiio_ldconfig=false
222
217
 
223
218
LLVM_VERSION="3.1"
224
219
LLVM_VERSION_MIN="3.0"
230
225
 
231
226
# OSL needs to be compiled for now!
232
227
OSL_VERSION="1.3.2"
 
228
OSL_VERSION_MIN=$OSL_VERSION
233
229
OSL_SOURCE="https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz"
234
230
OSL_FORCE_REBUILD=false
235
231
OSL_SKIP=false
237
233
# Version??
238
234
OPENCOLLADA_VERSION="1.3"
239
235
OPENCOLLADA_SOURCE="https://github.com/KhronosGroup/OpenCOLLADA.git"
 
236
OPENCOLLADA_REPO_UID="18da7f4109a8eafaa290a33f5550501cc4c8bae8"
240
237
OPENCOLLADA_FORCE_REBUILD=false
241
238
OPENCOLLADA_SKIP=false
242
239
 
250
247
# FFMPEG optional libs.
251
248
VORBIS_USE=false
252
249
VORBIS_DEV=""
 
250
OGG_USE=false
 
251
OGG_DEV=""
253
252
THEORA_USE=false
254
253
THEORA_DEV=""
255
254
XVID_USE=false
319
318
    --with-all)
320
319
      WITH_ALL=true; shift; continue
321
320
    ;;
322
 
    --with-osl)
323
 
      WITH_OSL=true; shift; continue
324
 
    ;;
325
321
    --with-opencollada)
326
322
      WITH_OPENCOLLADA=true; shift; continue
327
323
    ;;
405
401
    --skip-ffmpeg)
406
402
      FFMPEG_SKIP=true; shift; continue
407
403
    ;;
 
404
    --required-numpy)
 
405
      NUMPY_REQUIRED=true; shift; continue
 
406
    ;;
408
407
    --)
409
408
      # no more arguments to parse
410
409
      break
421
420
done
422
421
 
423
422
if $WITH_ALL; then
424
 
  WITH_OSL=true
425
423
  WITH_OPENCOLLADA=true
426
424
fi
427
425
 
551
549
  ln -s $_inst $_inst_shortcut
552
550
}
553
551
 
 
552
# ldconfig
 
553
run_ldconfig() {
 
554
  _lib_path="$INST/$1/lib"
 
555
  _ldconf_path="/etc/ld.so.conf.d/$1.conf"
 
556
  INFO ""
 
557
  INFO "Running ldconfig for $1..."
 
558
  sudo sh -c "echo \"$_lib_path\" > $_ldconf_path"
 
559
  sudo /sbin/ldconfig  # XXX OpenSuse does not include sbin in command path with sudo!!!
 
560
  INFO ""
 
561
}
 
562
 
554
563
#### Build Python ####
555
564
_init_python() {
556
565
  _src=$SRC/Python-$PYTHON_VERSION
566
575
 
567
576
compile_Python() {
568
577
  # To be changed each time we make edits that would modify the compiled result!
569
 
  py_magic=0
 
578
  py_magic=1
570
579
  _init_python
571
580
 
572
581
  # Clean install if needed!
590
599
 
591
600
    cd $_src
592
601
 
593
 
    ./configure --prefix=$_inst --enable-ipv6 \
 
602
    ./configure --prefix=$_inst --libdir=$_inst/lib --enable-ipv6 \
594
603
        --enable-loadable-sqlite-extensions --with-dbmliborder=bdb \
595
604
        --with-computed-gotos --with-pymalloc
596
605
 
630
639
 
631
640
compile_Numpy() {
632
641
  # To be changed each time we make edits that would modify the compiled result!
633
 
  py_magic=0
 
642
  numpy_magic=0
634
643
  _init_numpy
635
644
 
636
645
  # Clean install if needed!
637
 
  magic_compile_check numpy-$NUMPY_VERSION $py_magic
 
646
  magic_compile_check numpy-$NUMPY_VERSION $numpy_magic
638
647
  if [ $? -eq 1 -o $NUMPY_FORCE_REBUILD == true ]; then
639
648
    clean_Numpy
640
649
  fi
665
674
      exit 1
666
675
    fi
667
676
 
668
 
    magic_compile_set numpy-$NUMPY_VERSION $py_magic
 
677
    magic_compile_set numpy-$NUMPY_VERSION $numpy_magic
669
678
 
670
679
    cd $CWD
671
680
    INFO "Done compiling Numpy-$NUMPY_VERSION!"
740
749
  fi
741
750
 
742
751
  # Just always run it, much simpler this way!
743
 
  _need_boost_ldconfig=true
 
752
  run_ldconfig "boost"
744
753
}
745
754
 
746
755
#### Build OCIO ####
924
933
      ERROR "ILMBase-$ILMBASE_VERSION failed to compile, exiting"
925
934
      exit 1
926
935
    fi
 
936
    cd $CWD
 
937
    INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
927
938
  else
928
939
    INFO "Own ILMBase-$ILMBASE_VERSION is up to date, nothing to do!"
929
940
    INFO "If you want to force rebuild of this lib (and openexr), use the --force-openexr option."
930
941
  fi
931
942
 
932
943
  magic_compile_set ilmbase-$ILMBASE_VERSION $ilmbase_magic
933
 
 
934
 
  cd $CWD
935
 
  INFO "Done compiling ILMBase-$ILMBASE_VERSION!"
936
944
}
937
945
 
938
946
#### Build OpenEXR ####
1144
1152
  _with_built_openexr=true
1145
1153
 
1146
1154
  # Just always run it, much simpler this way!
1147
 
  _need_openexr_ldconfig=true
 
1155
  run_ldconfig "openexr"
1148
1156
}
1149
1157
 
1150
1158
#### Build OIIO ####
1407
1415
  fi
1408
1416
 
1409
1417
  # Just always run it, much simpler this way!
1410
 
  _need_oiio_ldconfig=true
 
1418
  run_ldconfig "oiio"
1411
1419
}
1412
1420
 
1413
1421
#### Build LLVM ####
1425
1433
 
1426
1434
compile_LLVM() {
1427
1435
  # To be changed each time we make edits that would modify the compiled result!
1428
 
  llvm_magic=1
 
1436
  llvm_magic=2
1429
1437
  _init_llvm
1430
1438
 
1431
1439
  # Clean install if needed!
1530
1538
 
1531
1539
compile_OSL() {
1532
1540
  # To be changed each time we make edits that would modify the compiled result!
1533
 
  osl_magic=10
 
1541
  osl_magic=11
1534
1542
  _init_osl
1535
1543
 
1536
1544
  # Clean install if needed!
1588
1596
      cmake_d="$cmake_d -D OPENIMAGEIOHOME=$INST/oiio"
1589
1597
    fi
1590
1598
 
 
1599
    INFO "$LLVM_VERSION_FOUND"
1591
1600
    if [ ! -z $LLVM_VERSION_FOUND ]; then
1592
1601
      cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
1593
1602
      if [ -d $INST/llvm ]; then
1632
1641
 
1633
1642
compile_OpenCOLLADA() {
1634
1643
  # To be changed each time we make edits that would modify the compiled results!
1635
 
  opencollada_magic=6
 
1644
  opencollada_magic=8
1636
1645
  _init_opencollada
1637
1646
 
1638
1647
  # Clean install if needed!
1657
1666
    git pull origin master
1658
1667
 
1659
1668
    # Stick to same rev as windows' libs...
1660
 
    git checkout e886e196673222f2f4bc32b936dc96419fff815f
 
1669
    git checkout $OPENCOLLADA_REPO_UID
1661
1670
    git reset --hard
1662
1671
 
1663
1672
    # Always refresh the whole build!
1883
1892
  # These libs should always be available in debian/ubuntu official repository...
1884
1893
  OPENJPEG_DEV="libopenjpeg-dev"
1885
1894
  VORBIS_DEV="libvorbis-dev"
 
1895
  OGG_DEV="libogg-dev"
1886
1896
  THEORA_DEV="libtheora-dev"
1887
1897
 
1888
1898
  _packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \
1889
1899
             libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \
1890
1900
             libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
1891
 
             libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV \
 
1901
             libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
1892
1902
             libsdl1.2-dev libfftw3-dev patch bzip2"
1893
1903
 
1894
1904
  OPENJPEG_USE=true
1895
1905
  VORBIS_USE=true
 
1906
  OGG_USE=true
1896
1907
  THEORA_USE=true
1897
1908
 
1898
1909
  # Install newest libtiff-dev in debian/ubuntu.
1982
1993
  if $PYTHON_SKIP; then
1983
1994
    INFO "WARNING! Skipping Python installation, as requested..."
1984
1995
  else
 
1996
    _do_compile=false
1985
1997
    check_package_DEB python$PYTHON_VERSION_MIN-dev
1986
1998
    if [ $? -eq 0 ]; then
1987
1999
      install_packages_DEB python$PYTHON_VERSION_MIN-dev
1992
2004
        check_package_DEB python$PYTHON_VERSION_MIN-numpy
1993
2005
        if [ $? -eq 0 ]; then
1994
2006
          install_packages_DEB python$PYTHON_VERSION_MIN-numpy
 
2007
        elif $NUMPY_REQUIRED; then
 
2008
          INFO "WARNING! Valid python package but no valid numpy package!"
 
2009
          INFO "         Building both Python and Numpy from sources!"
 
2010
          _do_compile=true
1995
2011
        else
1996
 
          INFO "WARNING! Sorry, using python package but no numpy package available!"
 
2012
          INFO "WARNING! Sorry, using python package but no valid numpy package available!"
 
2013
          INFO "         Use --required-numpy to force building of both Python and numpy."
1997
2014
        fi
1998
2015
      fi
1999
 
      clean_Python
2000
2016
    else
 
2017
      _do_compile=true
 
2018
    fi
 
2019
 
 
2020
    if $_do_compile; then
2001
2021
      compile_Python
2002
2022
      INFO ""
2003
2023
      if $NUMPY_SKIP; then
2005
2025
      else
2006
2026
        compile_Numpy
2007
2027
      fi
 
2028
    else
 
2029
      clean_Python
2008
2030
    fi
2009
2031
  fi
2010
2032
 
2071
2093
    fi
2072
2094
  fi
2073
2095
 
2074
 
  if $WITH_OSL; then
2075
 
    have_llvm=false
 
2096
  have_llvm=false
2076
2097
 
2077
 
    if $LLVM_SKIP; then
2078
 
      INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
 
2098
  if $LLVM_SKIP; then
 
2099
    INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
 
2100
  else
 
2101
    INFO ""
 
2102
    check_package_version_ge_DEB llvm-dev $LLVM_VERSION_MIN
 
2103
    if [ $? -eq 0 ]; then
 
2104
      install_packages_DEB llvm-dev clang
 
2105
      have_llvm=true
 
2106
      LLVM_VERSION_FOUND=""  # Using default one, no need to specify it!
 
2107
      clean_LLVM
2079
2108
    else
 
2109
      install_packages_DEB libffi-dev
 
2110
      # LLVM can't find the debian ffi header dir
 
2111
      _FFI_INCLUDE_DIR=`dpkg -L libffi-dev | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2080
2112
      INFO ""
2081
 
      check_package_DEB llvm-$LLVM_VERSION-dev
2082
 
      if [ $? -eq 0 ]; then
2083
 
        install_packages_DEB llvm-$LLVM_VERSION-dev clang
2084
 
        have_llvm=true
2085
 
        LLVM_VERSION_FOUND=$LLVM_VERSION
2086
 
        clean_LLVM
2087
 
      else
2088
 
        check_package_DEB llvm-$LLVM_VERSION_MIN-dev
2089
 
        if [ $? -eq 0 ]; then
2090
 
          install_packages_DEB llvm-$LLVM_VERSION_MIN-dev clang
2091
 
          have_llvm=true
2092
 
          LLVM_VERSION_FOUND=$LLVM_VERSION_MIN
2093
 
          clean_LLVM
2094
 
        else
2095
 
          install_packages_DEB libffi-dev
2096
 
          # LLVM can't find the debian ffi header dir
2097
 
          _FFI_INCLUDE_DIR=`dpkg -L libffi-dev | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2098
 
          INFO ""
2099
 
          compile_LLVM
2100
 
          have_llvm=true
2101
 
          LLVM_VERSION_FOUND=$LLVM_VERSION
2102
 
        fi
2103
 
      fi
 
2113
      compile_LLVM
 
2114
      have_llvm=true
 
2115
      LLVM_VERSION_FOUND=$LLVM_VERSION
2104
2116
    fi
 
2117
  fi
2105
2118
 
2106
 
    if $OSL_SKIP; then
2107
 
      INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2108
 
    else
2109
 
      if $have_llvm; then
2110
 
        INFO ""
2111
 
        install_packages_DEB flex bison libtbb-dev
2112
 
        # No package currently!
2113
 
        INFO ""
2114
 
        compile_OSL
2115
 
      fi
 
2119
  if $OSL_SKIP; then
 
2120
    INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
 
2121
  else
 
2122
    if $have_llvm; then
 
2123
      INFO ""
 
2124
      install_packages_DEB flex bison libtbb-dev
 
2125
      # No package currently!
 
2126
      INFO ""
 
2127
      compile_OSL
2116
2128
    fi
2117
2129
  fi
2118
2130
 
2299
2311
  # These libs should always be available in fedora/suse official repository...
2300
2312
  OPENJPEG_DEV="openjpeg-devel"
2301
2313
  VORBIS_DEV="libvorbis-devel"
 
2314
  OGG_DEV="libogg-devel"
2302
2315
  THEORA_DEV="libtheora-devel"
2303
2316
 
2304
2317
  _packages="gcc gcc-c++ make scons libtiff-devel freetype-devel libjpeg-devel\
2305
2318
             libpng-devel libX11-devel libXi-devel wget ncurses-devel \
2306
2319
             readline-devel $OPENJPEG_DEV openal-soft-devel \
2307
 
             glew-devel yasm $THEORA_DEV $VORBIS_DEV patch"
 
2320
             glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch"
2308
2321
 
2309
2322
  OPENJPEG_USE=true
2310
2323
  VORBIS_USE=true
 
2324
  OGG_USE=true
2311
2325
  THEORA_USE=true
2312
2326
 
2313
2327
  if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
2399
2413
  if $PYTHON_SKIP; then
2400
2414
    INFO "WARNING! Skipping Python installation, as requested..."
2401
2415
  else
 
2416
    _do_compile=false
2402
2417
    check_package_version_match_RPM python3-devel $PYTHON_VERSION_MIN
2403
2418
    if [ $? -eq 0 ]; then
2404
2419
      install_packages_RPM python3-devel
2409
2424
        check_package_version_match_RPM python3-numpy $NUMPY_VERSION_MIN
2410
2425
        if [ $? -eq 0 ]; then
2411
2426
          install_packages_RPM python3-numpy
 
2427
        elif $NUMPY_REQUIRED; then
 
2428
          INFO "WARNING! Valid python package but no valid numpy package!"
 
2429
          INFO "         Building both Python and Numpy from sources!"
 
2430
          _do_compile=true
2412
2431
        else
2413
 
          INFO "WARNING! Sorry, using python package but no numpy package available!"
 
2432
          INFO "WARNING! Sorry, using python package but no valid numpy package available!"
 
2433
          INFO "         Use --required-numpy to force building of both Python and numpy."
2414
2434
        fi
2415
2435
      fi
2416
 
      clean_Python
2417
2436
    else
 
2437
      _do_compile=true
 
2438
    fi
 
2439
 
 
2440
    if $_do_compile; then
2418
2441
      compile_Python
2419
2442
      INFO ""
2420
2443
      if $NUMPY_SKIP; then
2422
2445
      else
2423
2446
        compile_Numpy
2424
2447
      fi
 
2448
    else
 
2449
      clean_Python
2425
2450
    fi
2426
2451
  fi
2427
2452
 
2477
2502
    fi
2478
2503
  fi
2479
2504
 
2480
 
  if $WITH_OSL; then
2481
 
    have_llvm=false
2482
 
 
 
2505
  have_llvm=false
 
2506
 
 
2507
  INFO ""
 
2508
  if $LLVM_SKIP; then
 
2509
    INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
 
2510
  else
 
2511
    # Problem compiling with LLVM 3.2 so match version 3.1 ...
 
2512
    check_package_version_match_RPM llvm $LLVM_VERSION
 
2513
    if [ $? -eq 0 ]; then
 
2514
      if [ $RPM = "SUSE" ]; then
 
2515
        install_packages_RPM llvm-devel llvm-clang-devel
 
2516
      else
 
2517
        install_packages_RPM llvm-devel clang-devel
 
2518
      fi
 
2519
      have_llvm=true
 
2520
      LLVM_VERSION_FOUND=$LLVM_VERSION
 
2521
      clean_LLVM
 
2522
    else
 
2523
      #
 
2524
      # Better to compile it than use minimum version from repo...
 
2525
      #
 
2526
      install_packages_RPM libffi-devel
 
2527
      # LLVM can't find the fedora ffi header dir...
 
2528
      _FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
 
2529
      INFO ""
 
2530
      compile_LLVM
 
2531
      have_llvm=true
 
2532
      LLVM_VERSION_FOUND=$LLVM_VERSION
 
2533
    fi
 
2534
  fi
 
2535
 
 
2536
  if $OSL_SKIP; then
2483
2537
    INFO ""
2484
 
    if $LLVM_SKIP; then
2485
 
      INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2486
 
    else
2487
 
      # Problem compiling with LLVM 3.2 so match version 3.1 ...
2488
 
      check_package_version_match_RPM llvm $LLVM_VERSION
2489
 
      if [ $? -eq 0 ]; then
2490
 
        if [ $RPM = "SUSE" ]; then
2491
 
          install_packages_RPM llvm-devel llvm-clang-devel
2492
 
        else
2493
 
          install_packages_RPM llvm-devel clang-devel
2494
 
        fi
2495
 
        have_llvm=true
2496
 
        LLVM_VERSION_FOUND=$LLVM_VERSION
2497
 
        clean_LLVM
2498
 
      else
2499
 
        #
2500
 
        # Better to compile it than use minimum version from repo...
2501
 
        #
2502
 
        install_packages_RPM libffi-devel
2503
 
        # LLVM can't find the fedora ffi header dir...
2504
 
        _FFI_INCLUDE_DIR=`rpm -ql libffi-devel | grep -e ".*/ffi.h" | sed -r 's/(.*)\/ffi.h/\1/'`
2505
 
        INFO ""
2506
 
        compile_LLVM
2507
 
        have_llvm=true
2508
 
        LLVM_VERSION_FOUND=$LLVM_VERSION
2509
 
      fi
2510
 
    fi
2511
 
 
2512
 
    if $OSL_SKIP; then
2513
 
      INFO ""
2514
 
      INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2515
 
    else
2516
 
      if $have_llvm; then
2517
 
        # No package currently!
2518
 
        INFO ""
2519
 
        install_packages_RPM flex bison git
2520
 
        if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
2521
 
          install_packages_RPM tbb-devel
2522
 
        fi
2523
 
        INFO ""
2524
 
        compile_OSL
2525
 
      fi
 
2538
    INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
 
2539
  else
 
2540
    if $have_llvm; then
 
2541
      # No package currently!
 
2542
      INFO ""
 
2543
      install_packages_RPM flex bison git
 
2544
      if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
 
2545
        install_packages_RPM tbb-devel
 
2546
      fi
 
2547
      INFO ""
 
2548
      compile_OSL
2526
2549
    fi
2527
2550
  fi
2528
2551
 
2626
2649
  # These libs should always be available in arch official repository...
2627
2650
  OPENJPEG_DEV="openjpeg"
2628
2651
  VORBIS_DEV="libvorbis"
 
2652
  OGG_DEV="libogg"
2629
2653
  THEORA_DEV="libtheora"
2630
2654
 
2631
2655
  _packages="base-devel scons cmake libxi glew libpng libtiff wget openal \
2632
 
             $OPENJPEG_DEV $VORBIS_DEV $THEORA_DEV yasm sdl fftw"
 
2656
             $OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw"
2633
2657
 
2634
2658
  OPENJPEG_USE=true
2635
2659
  VORBIS_USE=true
 
2660
  OGG_USE=true
2636
2661
  THEORA_USE=true
2637
2662
 
2638
2663
  if $WITH_ALL; then
2681
2706
  if $PYTHON_SKIP; then
2682
2707
    INFO "WARNING! Skipping Python installation, as requested..."
2683
2708
  else
 
2709
    _do_compile=false
2684
2710
    check_package_version_ge_ARCH python $PYTHON_VERSION_MIN
2685
2711
    if [ $? -eq 0 ]; then
2686
2712
      install_packages_ARCH python
2692
2718
          check_package_version_ge_ARCH python-numpy $NUMPY_VERSION_MIN
2693
2719
          if [ $? -eq 0 ]; then
2694
2720
            install_packages_ARCH python-numpy
2695
 
          else
2696
 
            INFO "WARNING! Sorry, using python package but no numpy package available!"
 
2721
        elif $NUMPY_REQUIRED; then
 
2722
          INFO "WARNING! Valid python package but no valid numpy package!"
 
2723
          INFO "         Building both Python and Numpy from sources!"
 
2724
          _do_compile=true
 
2725
        else
 
2726
          INFO "WARNING! Sorry, using python package but no valid numpy package available!"
 
2727
          INFO "         Use --required-numpy to force building of both Python and numpy."
2697
2728
          fi
2698
2729
        fi
2699
2730
      fi
2700
 
      clean_Python
2701
2731
    else
 
2732
      _do_compile=true
 
2733
    fi
 
2734
 
 
2735
    if $_do_compile; then
2702
2736
      compile_Python
2703
2737
      INFO ""
2704
 
      if $WITH_NUMPY; then
2705
 
        if $NUMPY_SKIP; then
2706
 
          INFO "WARNING! Skipping NumPy installation, as requested..."
2707
 
        else
2708
 
          compile_Numpy
2709
 
        fi
 
2738
      if $NUMPY_SKIP; then
 
2739
        INFO "WARNING! Skipping NumPy installation, as requested..."
 
2740
      else
 
2741
        compile_Numpy
2710
2742
      fi
 
2743
    else
 
2744
      clean_Python
2711
2745
    fi
2712
2746
  fi
2713
2747
 
2764
2798
    fi
2765
2799
  fi
2766
2800
 
2767
 
  if $WITH_OSL; then
2768
 
    have_llvm=false
2769
 
 
 
2801
  have_llvm=false
 
2802
 
 
2803
  INFO ""
 
2804
  if $LLVM_SKIP; then
 
2805
    INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
 
2806
  else
 
2807
    check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN
 
2808
    if [ $? -eq 0 ]; then
 
2809
      install_packages_ARCH llvm clang
 
2810
      have_llvm=true
 
2811
      LLVM_VERSION=`check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN`
 
2812
      LLVM_VERSION_FOUND=$LLVM_VERSION
 
2813
      clean_LLVM
 
2814
    else
 
2815
      install_packages_ARCH libffi
 
2816
      # LLVM can't find the arch ffi header dir...
 
2817
      _FFI_INCLUDE_DIR=`pacman -Ql libffi | grep -e ".*/ffi.h" | awk '{print $2}' | sed -r 's/(.*)\/ffi.h/\1/'`
 
2818
      # LLVM 3.1 needs python2 to build and arch defaults to python3
 
2819
      _PYTHON2_BIN="/usr/bin/python2"
 
2820
      INFO ""
 
2821
      compile_LLVM
 
2822
      have_llvm=true
 
2823
      LLVM_VERSION_FOUND=$LLVM_VERSION
 
2824
    fi
 
2825
  fi
 
2826
 
 
2827
  if $OSL_SKIP; then
2770
2828
    INFO ""
2771
 
    if $LLVM_SKIP; then
2772
 
      INFO "WARNING! Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
2773
 
    else
2774
 
      check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN
 
2829
    INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
 
2830
  else
 
2831
    if $have_llvm; then
 
2832
      check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
2775
2833
      if [ $? -eq 0 ]; then
2776
 
        install_packages_ARCH llvm clang
2777
 
        have_llvm=true
2778
 
        LLVM_VERSION=`check_package_version_ge_ARCH llvm`
2779
 
        LLVM_VERSION_FOUND=$LLVM_VERSION
2780
 
        clean_LLVM
 
2834
        install_packages_ARCH openshadinglanguage
 
2835
        clean_OSL
2781
2836
      else
2782
 
        install_packages_ARCH libffi
2783
 
        # LLVM can't find the arch ffi header dir...
2784
 
        _FFI_INCLUDE_DIR=`pacman -Ql libffi | grep -e ".*/ffi.h" | awk '{print $2}' | sed -r 's/(.*)\/ffi.h/\1/'`
2785
 
        # LLVM 3.1 needs python2 to build and arch defaults to python3
2786
 
        _PYTHON2_BIN="/usr/bin/python2"
2787
 
        INFO ""
2788
 
        compile_LLVM
2789
 
        have_llvm=true
2790
 
        LLVM_VERSION_FOUND=$LLVM_VERSION
2791
 
      fi
2792
 
    fi
2793
 
 
2794
 
    if $OSL_SKIP; then
2795
 
      INFO ""
2796
 
      INFO "WARNING! Skipping OpenShadingLanguage installation, as requested..."
2797
 
    else
2798
 
      if $have_llvm; then
2799
 
        check_package_version_ge_ARCH openshadinglanguage $OSL_VERSION_MIN
2800
 
        if [ $? -eq 0 ]; then
2801
 
          install_packages_ARCH openshadinglanguage
2802
 
          clean_OSL
2803
 
        else
2804
 
          #XXX Note: will fail to build with LLVM 3.2! 
2805
 
          INFO ""
2806
 
          install_packages_ARCH git intel-tbb
2807
 
          INFO ""
2808
 
          compile_OSL
2809
 
        fi
 
2837
        #XXX Note: will fail to build with LLVM 3.2! 
 
2838
        INFO ""
 
2839
        install_packages_ARCH git intel-tbb
 
2840
        INFO ""
 
2841
        compile_OSL
2810
2842
      fi
2811
2843
    fi
2812
2844
  fi
2888
2920
    _packages="$_packages $VORBIS_DEV"
2889
2921
  fi
2890
2922
 
 
2923
  if $OGG_USE; then
 
2924
    _packages="$_packages $OGG_DEV"
 
2925
  fi
 
2926
 
2891
2927
  if $XVID_USE; then
2892
2928
    _packages="$_packages $XVID_DEV"
2893
2929
  fi
2948
2984
    fi
2949
2985
  fi
2950
2986
 
 
2987
  if [ -d $INST/python-$PYTHON_VERSION_MIN ]; then
 
2988
    _1="-D PYTHON_ROOT_DIR=$INST/python-$PYTHON_VERSION_MIN"
 
2989
    INFO "  $_1"
 
2990
    _buildargs="$_buildargs $_1"
 
2991
  fi
 
2992
 
2951
2993
  if [ -d $INST/boost ]; then
2952
2994
    _1="-D BOOST_ROOT=$INST/boost"
2953
2995
    _2="-D Boost_NO_SYSTEM_PATHS=ON"
2984
3026
    _buildargs="$_buildargs $_1"
2985
3027
  fi
2986
3028
 
2987
 
  if $WITH_OSL; then
2988
 
    _1="-D WITH_CYCLES_OSL=ON"
2989
 
    _2="-D WITH_LLVM=ON"
2990
 
    _3="-D LLVM_VERSION=$LLVM_VERSION_FOUND"
 
3029
  _1="-D WITH_CYCLES_OSL=ON"
 
3030
  _2="-D WITH_LLVM=ON"
 
3031
  _3="-D LLVM_VERSION=$LLVM_VERSION_FOUND"
 
3032
  INFO "  $_1"
 
3033
  INFO "  $_2"
 
3034
  INFO "  $_3"
 
3035
  _buildargs="$_buildargs $_1 $_2 $_3"
 
3036
  if [ -d $INST/osl ]; then
 
3037
    _1="-D CYCLES_OSL=$INST/osl"
 
3038
    INFO "  $_1"
 
3039
    _buildargs="$_buildargs $_1"
 
3040
  fi
 
3041
  if [ -d $INST/llvm ]; then
 
3042
    _1="-D LLVM_DIRECTORY=$INST/llvm"
 
3043
    _2="-D LLVM_STATIC=ON"
2991
3044
    INFO "  $_1"
2992
3045
    INFO "  $_2"
2993
 
    INFO "  $_3"
2994
 
    _buildargs="$_buildargs $_1 $_2 $_3"
2995
 
    if [ -d $INST/osl ]; then
2996
 
      _1="-D CYCLES_OSL=$INST/osl"
2997
 
      INFO "  $_1"
2998
 
      _buildargs="$_buildargs $_1"
2999
 
    fi
3000
 
    if [ -d $INST/llvm ]; then
3001
 
      _1="-D LLVM_DIRECTORY=$INST/llvm"
3002
 
      _2="-D LLVM_STATIC=ON"
3003
 
      INFO "  $_1"
3004
 
      INFO "  $_2"
3005
 
      _buildargs="$_buildargs $_1 $_2"
3006
 
    fi
 
3046
    _buildargs="$_buildargs $_1 $_2"
3007
3047
  fi
3008
3048
 
3009
3049
  if $WITH_OPENCOLLADA; then
3105
3145
  fi
3106
3146
 
3107
3147
  if $ALL_STATIC; then
3108
 
    INFO "LLIB = ["xml2", "expat"] + LLIB"
 
3148
    INFO "LLIBS = [\""xml2"\", \""expat"\"] + LLIBS"
3109
3149
  fi
3110
3150
 
3111
3151
  INFO ""
3130
3170
  exit 1
3131
3171
fi
3132
3172
 
3133
 
INFO ""
3134
 
INFO "Running ldconfig..."
3135
 
if [ $_need_boost_ldconfig == true ]; then
3136
 
  sudo sh -c "echo \"$INST/boost/lib\" > /etc/ld.so.conf.d/boost.conf"
3137
 
fi
3138
 
if [ $_need_oiio_ldconfig == true ]; then
3139
 
  sudo sh -c "echo \"$INST/oiio/lib\" > /etc/ld.so.conf.d/oiio.conf"
3140
 
fi
3141
 
if [ $_need_openexr_ldconfig == true ]; then
3142
 
  sudo sh -c "echo \"$INST/openexr/lib\" > /etc/ld.so.conf.d/openexr.conf"
3143
 
fi
3144
 
sudo /sbin/ldconfig  # XXX OpenSuse does not include sbin in command path with sudo!!!
3145
 
INFO ""
3146
 
 
3147
3173
print_info | tee BUILD_NOTES.txt
3148
3174
INFO ""
3149
3175
INFO "This information has been written to BUILD_NOTES.txt"