Example #1
0
def build_dependencies(backends, force=False):
    source_path = os.path.join(util.get_base_path(), "thirdparty")
    build_path = os.path.join(source_path, "build")

    print('Building dependencies.')

    if 'all' in backends:
        backends = ['gles2', 'vulkan', 'software']

    if force:
        needs_build = backends
    else:
        needs_build = []
        for backend in backends:
            stamp_path = os.path.join(build_path, "stamps", "%s.stamp" % backend)
            if not check_stamp(stamp_path):
                needs_build.append(backend)

    if not needs_build:
        print('Nothing to do.')
        return

    build.configure(source_path, build_path)
    build.build_targets(build_path, needs_build)
    print('Done.')
Example #2
0
def run_unittest(throw=True):
    """ Runs unit-tests. """
    args = lambda: None
    args.build_dir = "build/unittest"
    args.build_type = "debug"
    args.backend = "software"
    args.targets = ["unittest"]
    build_path = util.get_build_path(args)

    print('')
    print("Building unit-tests...")
    build.configure(args)
    build.build_targets(args)

    print('')
    print("Running unit-tests...")
    return util.call([path.join(build_path, 'bin', 'unittest')], throw)
Example #3
0
def run_unittest(throw=True):
    """ Runs unit-tests. """
    args = lambda: None
    args.build_type = "debug"
    args.backend = "software"
    build_path = util.get_build_path(args)

    print('')
    print("Building unit-tests...")
    if not build.check_configured(args, throw=False):
        build.configure(args)

    build.build_unit(args)

    print('')
    print("Running unit-tests...")
    return util.call([path.join(build_path, 'bin', 'unit')], throw)
Example #4
0
def run_unittest(args):
    build_path = build.get_build_path(args)

    print("Building unit-tests...")
    # We use the argument parser from the main build script here to initialize all required members of the argument structure.
    ret = build.configure(build.get_args())

    if not ret:
      ret = build.build_unit(args)

    if not ret:
      ret = subprocess.call([path.join(build_path, 'bin', 'unit')])

    return ret
Example #5
0
    def __init__(self,ARGUMENTS):
        ''' Build all basic packages needed by pipeVFX, with multiple versions for each.

        Packages can receive dependency to other packages by specifying then in the depend parameter or
        by adding a 4th dict element in the download tupple, where keys are pkg and value is its version.

        Using the 4th element has the advantage to add a specific package version dependency to a specific
        version of the package.

        You can also use it to specify a dependency for only one version and not for another (see python)
        One can also specify a pkg to be a dependency of ALL subsequent packages, by adding it to the
        build.allDepend list. ex: build.allDepend.append(python)

        To build a package with a specific version of GCC, just add gcc as a dependency to the package. (see python again!)
        '''

        zlib = build.configure(
               ARGUMENTS,
               'zlib',
               download=[
                 (
                   'http://zlib.net/fossils/zlib-1.2.8.tar.gz',
                   'zlib-1.2.8.tar.gz',
                   '1.2.8',
                   '44d667c142d7cda120332623eab69f40'
                 ),
               ],
        )
        build.allDepend.append(zlib)
        curl = build.configure(
               ARGUMENTS,
               'curl',
               download=[
                 (
                   'http://curl.haxx.se/download/curl-7.42.1.tar.gz',
                   'curl-7.42.1.tar.gz',
                   '7.42.1',
                   '8df5874c4a67ad55496bf3af548d99a2'
                 ),
               ],
        )
        build.allDepend.append(curl)

        gmp = build.configure(
               ARGUMENTS,
               'gmp',
               download=[
                 (
                   'https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2',
                   'gmp-6.0.0.tar.gz',
                   '6.0.0',
                   'b7ff2d88cae7f8085bd5006096eed470'
                 ),
               ],
        )
        mpfr = build.configure(
               ARGUMENTS,
               'mpfr',
               download=[
                 (
                   'https://gforge.inria.fr/frs/download.php/file/35627/mpfr-3.1.4.tar.gz',
                   'mpfr-3.1.4.tar.gz',
                   '3.1.4',
                   '482ab3c120ffc959f631b4ba9ec59a46'
                 ),
               ],
               depend = [ gmp ],
        )
        mpc = build.configure(
               ARGUMENTS,
               'mpc',
               download=[
                 (
                   'ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz',
                   'mpc-1.0.3.tar.gz',
                   '1.0.3',
                   'd6a1d5f8ddea3abd2cc3e98f58352d26'
                 ),
               ],
               depend = [ mpfr, gmp ],
        )
        gcc = build.gccBuild(
                ARGUMENTS,
                'gcc',
                download=[
                (
                #    'http://gcc.parentingamerica.com/releases/gcc-5.4.0/gcc-5.4.0.tar.gz',
                #    'gcc-5.4.0.tar.gz',
                #    '5.4.0',
                #    'f2b4d5a580061711e68f0f506e402e1c'
                # ),(
                #    'http://gcc.parentingamerica.com/releases/gcc-4.8.5/gcc-4.8.5.tar.gz',
                #    'gcc-4.8.5.tar.gz',
                #    '4.8.5',
                #    'bfe56e74d31d25009c8fb55fd3ca7e01'
                # ),(
                   'http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.8.3/gcc-4.8.3.tar.gz',
                   'gcc-4.8.3.tar.gz',
                   '4.8.3',
                   'e2c60f5ef918be2db08df96c7d97d0c4'
                ),(
                   'http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.1.2/gcc-4.1.2.tar.gz',
                   'gcc-4.1.2.tar.gz',
                   '4.1.2',
                   'dd2a7f4dcd33808d344949fcec87aa86'
                )],
                depend = [ mpfr, mpc, gmp ],
        )
        self.gcc = gcc
        # lets use our own latest GCC to build everything!!!
        build.allDepend.append(gcc)


        icu = build.configure(
            ARGUMENTS,
            'icu',
            download=[(
                'http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz',
                'icu.tar.gz',
                '57.1',
                '976734806026a4ef8bdd17937c8898b9',
                { gcc : '4.1.2' }
            )],
            src = 'icu4c.css',
            cmd = ['cd ./source/'] + build.configure.cmd,
        )
        self.icu = icu


        bzip2 = build.make(
            ARGUMENTS,
            'bzip2',
            download=[(
                'http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz',
                'bzip2-1.0.6.tar.gz',
                '1.0.6',
                '527819af097ee3014e4d442315b6f283'
            )],
            cmd = [
                'make -j $DCORES CFLAGS="$CFLAGS -O2 -fPIC" PREFIX=$TARGET_FOLDER',
                'make -j $DCORES PREFIX=$TARGET_FOLDER install',
            ],
        )
        self.bzip2 = bzip2

        # ncurses = build.configure(
        #         ARGUMENTS,
        #         'ncurses',
        #         download=[(
        #             'http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz',
        #             'ncurses-5.9.tar.gz',
        #             '5.9.0',
        #             '8cb9c412e5f2d96bc6f459aa8c6282a1'
        #         )],
        #         environ = {"CPPFLAGS" : "-P $CPPFLAGS",},
        #         #        cmd=[
        #         #            './configure --with-shared',
        #         #            'make -j $DCORES && make -j $DCORES install',
        #         #        ]
        # )
        # all['ncurses'] = ncurses

        readline = build.configure(
            ARGUMENTS,
            'readline',
            download=[(
                'http://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz',
                'readline-5.2.tar.gz',
                '5.2.0',
                'e39331f32ad14009b9ff49cc10c5e751'
            ),(
                'https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz',
                'readline-7.0.tar.gz',
                '7.0.0',
                '205b03a87fc83dab653b628c59b9fc91'
            )],
            cmd = [
                './configure',
                'make -j $DCORES CFLAGS="$CFLAGS -fPIC" PREFIX=$TARGET_FOLDER',
                'make -j $DCORES PREFIX=$TARGET_FOLDER install',
            ],
        )
        self.readline = readline

        openssl = build.openssl(
            ARGUMENTS,
            'openssl',
            download=[(
                'https://github.com/openssl/openssl/archive/OpenSSL_1_0_2h.tar.gz',
                'openssl-OpenSSL_1_0_2h.tar.gz',
                '1.0.2h',
                'bd70ca76ef00c9b65a927883f62998d9'
            )],
        )
        self.openssl = openssl

        python = build.python(
            ARGUMENTS,
            'python',
            download=[(
                'https://www.python.org/ftp/python/2.6.9/Python-2.6.9.tgz',
                'Python-2.6.9.tar.gz',
                '2.6.9',
                'bddbd64bf6f5344fc55bbe49a72fe4f3',
                { readline : '5.2.0', openssl : '1.0.2h' },
            ),(
                'https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz',
                'Python-2.7.12.tar.gz',
                '2.7.12',
                '88d61f82e3616a4be952828b3694109d',
                { readline : '5.2.0', openssl : None },
                # ),(
                #     'https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz',
                #     'Python-3.5.2.tar.gz',
                #     '3.5.2',
                #     '3fe8434643a78630c61c6464fe2e7e72',
                #     { readline : '5.2.0', openssl : None },
            )],
            depend = [readline,bzip2],
            pip = [
                'epydoc',
                'PyOpenGL',
                'PyOpenGL-accelerate',
                'cython',
                'subprocess32',
                'psutil',
            ]
        )
        self.python = python
        #build.allDepend.append(python)

        tbb = build.tbb(
            ARGUMENTS,
            'tbb',
            download=[(
                'https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160526oss_src_0.tgz',
                'tbb44_20160526oss.tar.gz',
                '4.4.r20160526oss',
                '6309541504a819dabe352130f27e57d5',
                # { gcc : '4.1.2' }
            ),(
                'https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20150611oss_src.tgz',
                'tbb43_20150611oss.tar.gz',
                '4.3.6',
                'bb144ec868c53244ea6be11921d86f03',
            )],
        )
        self.tbb = tbb

        cmake = build.configure(
            ARGUMENTS,
            'cmake',
            download=[(
                'http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz',
                'cmake-3.2.2.tar.gz',
                '3.2.2',
                '2da57308071ea98b10253a87d2419281'
            )],
            cmd = [
                "./configure --system-curl",
                "./Bootstrap.cmk/cmake",
                "make -j $DCORES VERBOSE=1",
                "make -j $DCORES install",
            ],
            sed = {
                '0.0.0' : {
                    'Source/kwsys/Terminal.c' : [
                        ('/* If running inside emacs the terminal is not VT100.  Some emacs','return 1;'),
                    ],
                },
            },
            # depend = [gcc],
        )
        # build.allDepend.append(cmake)
        self.cmake = cmake

        glew = build.glew(
            ARGUMENTS,
            'glew',
            download=[(
                'http://downloads.sourceforge.net/glew/glew-1.13.0.tgz',
                'glew-1.13.0.tar.gz',
                '1.13.0',
                '7cbada3166d2aadfc4169c4283701066'
            )],
        )
        build.allDepend.append(glew)
        self.glew = glew

        freeglut = build.configure(
            ARGUMENTS,
            'freeglut',
            download=[(
            #     'http://downloads.sourceforge.net/project/freeglut/freeglut/2.6.0/freeglut-2.6.0.tar.gz?r=http%3A%2F%2Ffreeglut.sourceforge.net%2Findex.php&ts=1432619050&use_mirror=iweb',
            #     'freeglut-2.6.0.tar.gz',
            #     '2.6.0',
            #     '39f0f2de89f399529d2b981188082218'
            # ),(
                'http://downloads.sourceforge.net/project/freeglut/freeglut/2.8.1/freeglut-2.8.1.tar.gz?r=http%3A%2F%2Ffreeglut.sourceforge.net%2Findex.php&ts=1432619092&use_mirror=hivelocity',
                'freeglut-2.8.1.tar.gz',
                '2.8.1',
                '918ffbddcffbac83c218bc52355b6d5a',
                # ),(
                # 'http://downloads.sourceforge.net/project/freeglut/freeglut/3.0.0/freeglut-3.0.0.tar.gz?r=http%3A%2F%2Ffreeglut.sourceforge.net%2Findex.php&ts=1432619114&use_mirror=hivelocity',
                # 'freeglut-3.0.0.tar.gz',
                # '3.0.0',
                # '90c3ca4dd9d51cf32276bc5344ec9754',
            )],
            environ = {'LDFLAGS' : '$LDFLAGS -lm -lGL'}
        )
        build.allDepend.append(freeglut)
        self.freeglut = freeglut

        jpeg = build.configure(
            ARGUMENTS,
            'jpeg',
            download=[(
                'http://www.ijg.org/files/jpegsrc.v6b.tar.gz',
                'jpeg-6b.tar.gz',
                '6b',
                'dbd5f3b47ed13132f04c685d608a7547'
            ),(
                'http://www.ijg.org/files/jpegsrc.v9a.tar.gz',
                'jpeg-9a.tar.gz',
                '9a',
                '3353992aecaee1805ef4109aadd433e7',
            )],
            cmd = [
                './configure --enable-shared --prefix=$TARGET_FOLDER',
                'make install INSTALL="/usr/bin/install -D"',
            ]
        )
        build.allDepend.append(jpeg)
        self.jpeg = jpeg



        jasper = build.configure(
            ARGUMENTS,
            'jasper',
            download=[(
                'http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip', # http://www.ece.uvic.ca/~frodo/jasper/
                'jasper-1.900.1.zip',
                '1.900.1',
                'a342b2b4495b3e1394e161eb5d85d754'
            )],
        )
        build.allDepend.append(jasper)
        self.jasper = jasper


        libraw = build.configure(
            ARGUMENTS,
            'libraw',
            src='mkdist.sh',
            download=[(
                'https://github.com/LibRaw/LibRaw/archive/0.17.2.tar.gz',
                'LibRaw-0.17.2.tar.gz',
                '0.17.2',
                '7de042bcffb58864fd93d5209620e08d'
            )],
            depend=[gcc],
            cmd = [
                './mkdist.sh',
                './configure --enable-shared --prefix=$TARGET_FOLDER',
                # it seems there's UTF-8 characters in the source code, so we need to clena it up!
                'cp src/../internal/libraw_x3f.cpp ./xx',
                'iconv -f UTF-8 -t ASCII -c ./xx -o src/../internal/libraw_x3f.cpp',
                'make install INSTALL="/usr/bin/install -D"',
            ]
        )
        build.allDepend.append(libraw)
        self.libraw = libraw

        tiff = build.configure(
            ARGUMENTS,
            'tiff',
            download=[(
                'http://download.osgeo.org/libtiff/old/tiff-3.8.2.tar.gz',
                'tiff-3.8.2.tar.gz',
                '3.8.2',
                'fbb6f446ea4ed18955e2714934e5b698'
            ),(
                'http://download.osgeo.org/libtiff/old/tiff-4.0.3.tar.gz',
                'tiff-4.0.3.tar.gz',
                '4.0.3',
                '051c1068e6a0627f461948c365290410',
            ),(
                'http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz',
                'tiff-4.0.6.tar.gz',
                '4.0.6',
                'd1d2e940dea0b5ad435f21f03d96dd72',
            )],
            depend=[jpeg],
        )
        build.allDepend.append(tiff)
        self.tiff = tiff

        libpng = build.configure(
            ARGUMENTS,
            'libpng',
            download=[(
                'http://ftp.osuosl.org/pub/blfs/conglomeration/libpng/libpng-1.6.23.tar.xz',
                'libpng-1.6.23.tar.gz',
                '1.6.23',
                '9b320a05ed4db1f3f0865c8a951fd9aa'
            )],
        )
        build.allDepend.append(libpng)
        self.libpng = libpng

        freetype = build.freetype(
            ARGUMENTS,
            'freetype',
            download=[(
                'http://mirror.csclub.uwaterloo.ca/nongnu//freetype/freetype-2.5.5.tar.gz',
                'freetype-2.5.5.tar.gz',
                '2.5.5',
                '7448edfbd40c7aa5088684b0a3edb2b8',
            ),(
                'http://mirror.csclub.uwaterloo.ca/nongnu//freetype/freetype-2.4.0.tar.gz',
                'freetype-2.4.0.tar.gz',
                '2.4.0',
                'f900148ae8e258803eb1ab9f564f2151'
            )],
        )
        build.allDepend.append(freetype)
        self.freetype = freetype

        # python modules
        # ============================================================================================================================================
        dbus = build.configure(
            ARGUMENTS,
            'dbus',
            download=[(
                'https://pypi.python.org/packages/source/d/dbus-python/dbus-python-0.84.0.tar.gz#md5=fe69a2613e824463e74f10913708c88a',
                'dbus-python-0.84.0.tar.gz',
                '0.84.0',
                'fe69a2613e824463e74f10913708c88a'
            )],
            baseLibs=[python],
        )
        self.dbus = dbus

#        cython = build.pythonSetup(
#            ARGUMENTS,
#            'cython',
#            download=[(
#                'https://github.com/cython/cython/archive/0.24.1.tar.gz',
#                'cython-0.24.1.tar.gz',
#                '0.24.1',
#                'ba3474937557f210acb45852e9ebb0fc'
#            )],
#            baseLibs=[python],
#        )
#        self.cython = cython

        numpy = build.pythonSetup(
            ARGUMENTS,
            'numpy',
            download=[(
                'https://github.com/numpy/numpy/archive/v1.9.2.tar.gz',
                'numpy-1.9.2.tar.gz',
                '1.9.2',
                '90f7434759088acccfddf5ba61b1f908'
            )],
            baseLibs=[python],
            # depend=[cython],
        )
        self.numpy = numpy

        self.scons = build.pythonSetup(
            ARGUMENTS,
            'scons',
            download=[(
                'http://downloads.sourceforge.net/project/scons/scons/1.0.0/scons-1.0.0.tar.gz',
                'scons-1.0.0.tar.gz',
                '1.0.0',
                '9afdfe0cc6d957568cc4386567a7c19e'
            )],
            baseLibs=[python],
        )

        # build all simple python modules here.
        # since its just a matter of running setup.py (hence "simple"),
        # we put all name/version/download infor in a dict for easy maintainance,
        # and run each one through the same pythonSetup builder class,
        # without any special setup.
        simpleModules = {
            'pil' : [(
                'http://effbot.org/downloads/Imaging-1.1.7.tar.gz',
                'Imaging-1.1.7.tar.gz',
                '1.1.7',
                'fc14a54e1ce02a0225be8854bfba478e'
            )],
            # 'pythonldap' : [(
            #     'https://pypi.python.org/packages/source/p/python-ldap/python-ldap-2.4.19.tar.gz#md5=b941bf31d09739492aa19ef679e94ae3',
            #     'python-ldap-2.4.19.tar.gz',
            #     '2.4.19',
            #     'b941bf31d09739492aa19ef679e94ae3'
            # )],
            # 'pygobject' : [(
            #     'https://pypi.python.org/packages/source/P/PyGObject/pygobject-2.28.3.tar.bz2#md5=aa64900b274c4661a5c32e52922977f9',
            #     'pygobject-2.28.3.tar.gz',
            #     '2.28.3',
            #     'aa64900b274c4661a5c32e52922977f9'
            # )],
            # 'wxpython' : [(
            #     'https://pypi.python.org/packages/source/P/PyOpenGL/PyOpenGL-3.1.0.tar.gz#md5=0de021941018d46d91e5a8c11c071693',
            #     'PyOpenGL-3.1.0.tar.gz',
            #     '3.1.0',
            #     '0de021941018d46d91e5a8c11c071693'
            # )],
        }
        # run the builders for each module in the dict
        simpleModulesBuilders = []
        for module in simpleModules:
            # we store the builder in a local dict first
            simpleModulesBuilders.append(
                build.pythonSetup(
                    ARGUMENTS,
                    module,
                    download=simpleModules[module],
                    baseLibs=[python],
                    depend=[python,numpy],
                )
            )
        # add all builders to the global dependency at once here
        # so they can all be built in parallel by scons, since theres no
        # dependency between then.
        #build.allDepend.extend( simpleModulesBuilders )
        # ============================================================================================================================================


        boost = build.boost(
            ARGUMENTS,
            'boost',
            download=[(
                'http://downloads.sourceforge.net/project/boost/boost/1.51.0/boost_1_51_0.tar.gz',
                'boost_1_51_0.tar.gz',
                '1.51.0',
                '6a1f32d902203ac70fbec78af95b3cf8',
                { gcc : '4.1.2' }
            ),(
                'http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz',
                'boost_1_54_0.tar.gz',
                '1.54.0',
                'efbfbff5a85a9330951f243d0a46e4b9',
                { gcc : '4.1.2' }
            ),(
                'http://downloads.sourceforge.net/project/boost/boost/1.56.0/boost_1_56_0.tar.gz',
                'boost_1_56_0.tar.gz',
                '1.56.0',
                '8c54705c424513fa2be0042696a3a162',
                { gcc : '4.1.2' }
            ),(
                'http://downloads.sourceforge.net/project/boost/boost/1.61.0/boost_1_61_0.tar.gz',
                'boost_1_61_0.tar.gz',
                '1.61.0',
                '874805ba2e2ee415b1877ef3297bf8ad',
                { gcc : '4.1.2' }
            ),(
                'http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz', # houdini!!!
                'boost_1_55_0.tar.gz',
                '1.55.0',
                '93780777cfbf999a600f62883bd54b17',
                { gcc : '4.1.2' }
            )],
            baseLibs=[python],
            # depend=[gcc],
        )
        self.boost = boost

        ilmbase = build.configure(
            ARGUMENTS,
            'ilmbase',
            download=[(
                'http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.0.0.tar.gz',
                'ilmbase-2.0.0.tar.gz',
                '2.0.0',
                '70f1413840c2a228783d1332b8b168e6',
                { gcc : '4.1.2' }
            ),(
                'http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.1.0.tar.gz',
                'ilmbase-2.1.0.tar.gz',
                '2.1.0',
                '8ba2f608191ad020e50277d8a3ba0850',
                { gcc : '4.1.2' }
            ),(
                'http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.2.0.tar.gz',
                'ilmbase-2.2.0.tar.gz',
                '2.2.0',
                'b540db502c5fa42078249f43d18a4652',
                { gcc : '4.1.2' }
            )],
            depend=[gcc],
            environ={
                'LDFLAGS' : "-Wl,-rpath-link,$ILMBASE_TARGET_FOLDER/lib/:$OPENEXR_TARGET_FOLDER/lib/",
            },
            cmd = [
                './configure  --enable-shared ',
                'make -j $DCORES',
                'make -j $DCORES install',
            ],
        )
        self.ilmbase = ilmbase

        openexr = build.configure(
            ARGUMENTS,
            'openexr',
            download=[(
                'http://download.savannah.nongnu.org/releases/openexr/openexr-2.0.0.tar.gz',
                'openexr-2.0.0.tar.gz',
                '2.0.0',
                '0820e1a8665236cb9e728534ebf8df18',
                { gcc : '4.1.2' }
            ),(
                'http://download.savannah.nongnu.org/releases/openexr/openexr-2.1.0.tar.gz',
                'openexr-2.1.0.tar.gz',
                '2.1.0',
                '33735d37d2ee01c6d8fbd0df94fb8b43',
                { gcc : '4.1.2' }
            ),(
                'http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.0.tar.gz',
                'openexr-2.2.0.tar.gz',
                '2.2.0',
                'b64e931c82aa3790329c21418373db4e',
                { gcc : '4.1.2' }
            )],
            sed = { '0.0.0' : { './configure' : [('-L/usr/lib64','')]}}, # disable looking for system  ilmbase
            depend=[ilmbase,gcc],
            cmd = [
                './configure  --enable-shared --with-ilmbase-prefix=$ILMBASE_TARGET_FOLDER',
                'make -j $DCORES',
                'make -j $DCORES install',
            ],
        )
        self.openexr = openexr

        # pyilmbase = build.configure(
        #     ARGUMENTS,
        #     'pyilmbase',
        #     download=[(
        #         'http://download.savannah.gnu.org/releases/openexr/pyilmbase-2.0.0.tar.gz',
        #         'pyilmbase-2.0.0.tar.gz',
        #         '2.0.0',
        #         '4585eba94a82f0b0916445990a47d143'
        #     ),(
        #         'http://download.savannah.gnu.org/releases/openexr/pyilmbase-2.1.0.tar.gz',
        #         'pyilmbase-2.1.0.tar.gz',
        #         '2.1.0',
        #         'af1115f4d759c574ce84efcde9845d29'
        #     ),(
        #         'http://download.savannah.gnu.org/releases/openexr/pyilmbase-2.2.0.tar.gz',
        #         'pyilmbase-2.2.0.tar.gz',
        #         '2.2.0',
        #         'e84a6a4462f90b5e14d83d67253d8e5a'
        #     )],
        #     baseLibs=[python],
        #     depend=[ilmbase,openexr,boost,python,numpy,gcc],
        #     environ={'DCORES' : 1, 'CORES' : 1},
        #     cmd = [
        #         'LD_LIBRARY_PATH=$OPENSSL_TARGET_FOLDER/lib:$LD_LIBRARY_PATH  ./configure  --enable-shared --disable-boostpythontest ',
        #         'make -j $DCORES',
        #         'make -j $DCORES install',
        #     ],
        # )
        # self.pyilmbase = pyilmbase
        # build.allDepend.extend([
        #     ilmbase,
        #     openexr,
        # ])


        # Sony Imageworks packages
        # =============================================================================================================================================
        yasm= build.configure(
            ARGUMENTS,
            'yasm',
            download=[(
                'http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz',
                'yasm-1.3.0.tar.gz',
                '1.3.0',
                'fc9e586751ff789b34b1f21d572d96af'
            )],
        )
        self.yasm = yasm
        #build.allDepend.append(yasm)

        hdf5 = build.configure(
            ARGUMENTS,
            'hdf5',
            download=[(
                'https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.17/src/hdf5-1.8.17.tar.gz',
                'hdf5-1.8.17.tar.gz',
                '1.8.17',
                '7d572f8f3b798a628b8245af0391a0ca'
            )],
        )
        self.hdf5 = hdf5
        # build.allDepend.append(hdf5)

        ocio = build.cmake(
            ARGUMENTS,
            'ocio',
            # ocio for some reason doesn't add -fPIC when building the static external libraries,
            # so we have to patch it or build fail with gcc 4.1.2
            # also, we have to remove -fvisibility-inlines-hidden when building with gcc 4.1.2
            sed = {'0.0.0' : {
                'ext/tinyxml_2_6_1.patch' : [
                    ('-fPIC', '-fPIC -DPIC'),
                    (' -fvisibility-inlines-hidden -fvisibility=hidden', ''),
                ],
                'ext/yaml-cpp-0.3.0.patch' : [
                    ('-fPIC', '-fPIC -DPIC'),
                    (' -fvisibility-inlines-hidden -fvisibility=hidden', ''),
                ],
            }},
            download = [(
                'https://github.com/imageworks/OpenColorIO/archive/v1.0.9.tar.gz',
                'OpenColorIO-1.0.9.tar.gz',
                '1.0.9',
                '06d0efe9cc1b32d7b14134779c9d1251',
                { gcc : '4.1.2' }
            )],
            baseLibs = [python],
            depend   = [yasm,boost,gcc,cmake],
            flags    = build.cmake.flags+['-DOCIO_BUILD_APPS=0 ']
        )
        self.ocio = ocio

        oiio = build.cmake(
            ARGUMENTS,
            'oiio',
            # oiio has some hard-coded path to find python, and the only
            # way to make it respect the PYTHON related environment variables,
            # is to patch some files to force it!
            sed = {
                '0.0.0' : {
                    'src/python/CMakeLists.txt' : [
                        ('SET(.*PYTHON_INCLUDE_DIR','#SET( PYTHON_INCLUDE_DIR'),
                        ('unset.*PYTHON_INCLUDE','#unset( PYTHON_INCLUDE'),
                        ('unset.*PYTHON_LIBRARY','#unset( PYTHON_LIBRARY'),
                        ('/usr/include/python','${PYTHON_ROOT}/include/python'),
                    ],
                    'CMakeLists.txt' : [
                        ('lib/python/site-packages','lib/python${PYTHON_VERSION_MAJOR}/site-packages'),
                        ('-std=c++11',''), # we need this to build with gcc 4.1.2
                    ],
                },
            },
            download=[(
                'https://github.com/OpenImageIO/oiio/archive/Release-1.5.24.tar.gz',
                'oiio-Release-1.5.24.tar.gz',
                '1.5.24',
                '8c1f9a0ec5b55a18eeea76d33ca7a02c',
                { gcc : '4.1.2' }
            ),(
                'https://github.com/OpenImageIO/oiio/archive/Release-1.6.15.tar.gz',
                'oiio-Release-1.6.15.tar.gz',
                '1.6.15',
                '3fe2cef4fb5f7bc78b136d2837e1062f',
                { gcc : '4.1.2', boost : "1.51.0" }
            # ),(
            #     'https://github.com/OpenImageIO/oiio/archive/Release-1.7.3dev.tar.gz',
            #     'oiio-Release-1.7.3dev.tar.gz',
            #     '1.7.3dev',
            #     'bcef05f5ff7f15ac580d9b3b4b6f690b',
            #     { gcc : '4.1.2' }
            )],
            depend=[ocio, python, boost, freetype, openexr, ilmbase, gcc, icu, cmake],
            cmd = 'mkdir -p build && cd build && '+' && '.join(build.cmake.cmd),
            flags = ['-DUSE_PYTHON=0','-DUSE_PTEX=0','-DUSE_OCIO=0']+build.cmake.flags,
        )
        self.oiio = oiio


        # use the download action as we only need this package to build llvm!
        # download action will avoid installing this package!
        # clang = build.download(
        #     ARGUMENTS,
        #     'clang',
        #     download=[(
        #         'http://llvm.org/releases/3.5.2/cfe-3.5.2.src.tar.xz',
        #         'cfe-3.5.2.src.tar.gz',
        #         '3.5.2',
        #         'aba5d02251bf7845a2013d6bb0702ac7',
        #     ),(
        #         'http://llvm.org/releases/3.4.2/cfe-3.4.2.src.tar.gz',
        #         'cfe-3.4.2.src.tar.gz',
        #         '3.4.2',
        #         '87945973b7c73038871c5f849a818588',
        #     )],
        # )
        # self.clang = clang

        clang_url = 'http://releases.llvm.org/3.5.2/cfe-3.5.2.src.tar.xz'
        llvm = build.configure(
            ARGUMENTS,
            'llvm',
            download=[(
                'http://llvm.org/releases/3.5.2/llvm-3.5.2.src.tar.xz',
                'llvm-3.5.2.src.tar.gz',
                '3.5.2',
                'f5a4dc595f7e8bd23397684d0906d014',
                { gcc : '4.8.3' }
            )],
            sed = {'3.5.0' : {
                # fix 3.5.2 with gcc 5!!
                'include/llvm/ADT/IntrusiveRefCntPtr.h' : [
                    ('IntrusiveRefCntPtr.IntrusiveRefCntPtr.X.','friend class IntrusiveRefCntPtr;\ntemplate <class X> \nIntrusiveRefCntPtr(IntrusiveRefCntPtr<X>'),
                ],
            },},
            depend=[python, gcc],
            compiler = build.gcc.system,
            # now we use the $CLANG_SRC_FOLDER env var to create a symlink
            # of clang into tools/clang folder, so llvm will build clang as well for us!
            cmd = [
                # 'ln -s $CLANG_SRC_FOLDER ./tools/clang',
                'cd ./tools',
                "curl '%s' | tar xJf - " % clang_url,
                'ln -s cfe-3.5.2.src ./clang',
                'cd ..',
                'mkdir -p build && cd build',
                '../configure  --enable-shared --disable-docs --enable-optimized --enable-assertions=no',
                'env REQUIRES_RTTI=1 make -j $DCORES VERBOSE=1',
                'make -j $DCORES install',
            ]
        )
        self.llvm = llvm

        flex = build.configure(
            ARGUMENTS,
            'flex',
            download=[(
                'http://downloads.sourceforge.net/project/flex/flex-2.5.39.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fflex%2Ffiles%2F&ts=1433811270&use_mirror=iweb',
                'flex-2.5.39.tar.gz',
                '2.5.39',
                'e133e9ead8ec0a58d81166b461244fde'
            )],
        )
        self.flex = flex

        bison = build.configure(
            ARGUMENTS,
            'bison',
            download=[(
                'http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz',
                'bison-3.0.4.tar.gz',
                '3.0.4',
                'a586e11cd4aff49c3ff6d3b6a4c9ccf8'
            )],
        )
        self.bison = bison

        osl = build.cmake(
            ARGUMENTS,
            'osl',
            download=[(
                'https://github.com/imageworks/OpenShadingLanguage/archive/Release-1.7.3.tar.gz',
                'OpenShadingLanguage-Release-1.7.3.tar.gz',
                '1.7.3',
                '42215e190d565c862043c0b02eca089b',
                {oiio: "1.6.15", llvm : "3.5.2", gcc: "4.8.3", boost: "1.51.0"},
            ),(
                'https://github.com/imageworks/OpenShadingLanguage/archive/Release-1.7.5.tar.gz',
                'OpenShadingLanguage-Release-1.7.5.tar.gz',
                '1.7.5',
                '8b15d13c3fa510b421834d32338304c8',
                {oiio: "1.6.15", llvm : "3.5.2", gcc: "4.8.3", boost: "1.51.0"},
            #     'https://github.com/imageworks/OpenShadingLanguage/archive/Release-1.8.0dev.tar.gz',
            #     'OpenShadingLanguage-Release-1.8.0dev.tar.gz',
            #     '1.8.0dev',
            #     '167c049c96deae9edcb76a14651069fd',
            #     {oiio: "1.6.15", llvm : "3.5.2"},
            )],
            depend=[llvm, flex, bison, oiio, boost, ilmbase, openexr, icu],
            sed = {
                '0.0.0' : {
                    'CMakeLists.txt' : [
                        ('add_definitions.*Wno.error=strict.overflow','#add_definitions ("-Wno-error=strict-overflow")'),
                    ],
                    'src/cmake/externalpackages.cmake' : [
                        ('--libfiles', '--libfiles --system-libs'),
                        ('string (REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})', 'string (REPLACE "\\\\\\n" " " LLVM_LIBRARY ${LLVM_LIBRARY})\nstring (REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY})'),
                    ]
                },
            },
            cmd = [
                'make -j $DCORES '
                'USE_CPP11=1 '
                'INSTALLDIR=$TARGET_FOLDER '
                'MY_CMAKE_FLAGS="-DENABLERTTI=1  -DLLVM_STATIC=1  -DOSL_BUILD_CPP11=1 '+" ".join(build.cmake.flags)+'" '
                'MY_MAKE_FLAGS=" USE_CPP11=1 '+" ".join(map(lambda x: x.replace('-D',''),build.cmake.flags))+' ENABLERTTI=1" '
                'OPENIMAGEHOME=$OIIO_TARGET_FOLDER'
                'BOOST_ROOT=$BOOST_TARGET_FOLDER '
                'LLVM_DIRECTORY=$LLVM_TARGET_FOLDER '
                'LLVM_STATIC=1 '
                'PARTIO_HOME="" '
                'STOP_ON_WARNING=0 '
                'ILMBASE_HOME=$ILMBASE_TARGET_FOLDER '
                'OPENEXR_HOME=$OPENEXR_TARGET_FOLDER '
                'BOOST_HOME=$BOOST_TARGET_FOLDER '
                # 'VERBOS=1 '
                'USE_LIBCPLUSPLUS=0 '
                'HIDE_SYMBOLS=0 '
                # 'install '
            ],
        )
        self.osl = osl
        # =============================================================================================================================================



        # qt packages
        # =============================================================================================================================================
        qt = build.configure(
            ARGUMENTS,
            'qt',
            download=[(
            #     'https://download.qt.io/archive/qt/4.8/4.8.4/qt-everywhere-opensource-src-4.8.4.tar.gz',
            #     'qt-everywhere-opensource-src-4.8.4.tar.gz',
            #     '4.8.4',
            #     '89c5ecba180cae74c66260ac732dc5cb',
            # ),(
                'http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz',
                'qt-everywhere-opensource-src-4.8.6.tar.gz',
                '4.8.6',
                '2edbe4d6c2eff33ef91732602f3518eb',
                { gcc : '4.1.2' }
            # ),(
                # 'http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz',
                # 'qt-everywhere-opensource-src-4.8.7.tar.gz',
                # '4.8.7',
                # 'd990ee66bf7ab0c785589776f35ba6ad',
                # { gcc : '4.1.2' }
            ),(
                'http://download.qt.io/official_releases/qt/5.6/5.6.1/single/qt-everywhere-opensource-src-5.6.1.tar.gz',
                 'qt-everywhere-opensource-src-5.6.1.tar.gz',
                 '5.6.1',
                 'ed16ef2a30c674f91f8615678005d44c',
            )],
            environ = {'LD' : 'g++'},
            cmd = [
                # './configure  -opensource -shared --confirm-license  -no-webkit -silent',
                './configure  -opensource -shared --confirm-license -silent',
                'make -j $DCORES',
                'make -j $DCORES install',
            ],
            depend=[tiff,jpeg,libpng,freetype,freeglut,glew,gcc],
        )
        self.qt = qt

        sip = build.pythonSetup(
            ARGUMENTS,
            'sip',
            download=[(
                'https://sourceforge.net/projects/pyqt/files/sip/sip-4.15.5/sip-4.15.5.tar.gz',
                'sip-4.15.5.tar.gz',
                '4.15.5',
                '4c95447c7b0391b7f183cf9f92ae9bc6',
                { gcc : '4.1.2' }
            ),(
                'https://sourceforge.net/projects/pyqt/files/sip/sip-4.16.4/sip-4.16.4.tar.gz',
                'sip-4.16.4.tar.gz',
                '4.16.4',
                'a9840670a064dbf8f63a8f653776fec9',
                { gcc : '4.1.2' }
            ),(
                'https://sourceforge.net/projects/pyqt/files/sip/sip-4.18.1/sip-4.18.1.tar.gz',
                'sip-4.18.1.tar.gz',
                '4.18.1',
                '9d664c33e8d0eabf1238a7ff44a399e9',
                { gcc : '4.1.2' }
            )],
            baseLibs=[python],
            src = 'configure.py',
            cmd = [
                # 'python configure.py --sysroot=$TARGET_FOLDER CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" ',
                'python configure.py '
                '-b $TARGET_FOLDER/bin '
                '-d $TARGET_FOLDER/lib/python$PYTHON_VERSION_MAJOR/site-packages/ '
                '-e $TARGET_FOLDER/include/python$PYTHON_VERSION_MAJOR/ '
                '-v $TARGET_FOLDER/share/sip/ '
                'CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" ',
                'make -j $DCORES && make -j $DCORES install',
            ],
        )
        self.sip = sip

        pyqt = build.pythonSetup(
            ARGUMENTS,
            'pyqt',
            download=[(
                'http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.4/PyQt-x11-gpl-4.11.4.tar.gz',
                'PyQt-x11-gpl-4.11.4.tar.gz',
                '4.11.4',
                '2fe8265b2ae2fc593241c2c84d09d481',
                {qt:'4.8.6', sip: '4.16.4', gcc : '4.1.2'},
                # ),(
                #     'https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.7/PyQt5_gpl-5.7.tar.gz',
                #     'PyQt5_gpl-5.7.tar.gz',
                #     '5.7.0',
                #     '2fe8265b2ae2fc593241c2c84d09d481',
                #     {qt:'5.7.0', sip: '4.18.1'},
            )],
            baseLibs=[python],
            depend=[sip,qt, gcc],
            src = 'configure-ng.py',
            cmd = [
                # 'python configure-ng.py --confirm-license --assume-shared --protected-is-public --designer-plugindir=$QT_TARGET_FOLDER/plugins/designer/ --sysroot=$TARGET_FOLDER CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"',
                'python configure.py --confirm-license --assume-shared --verbose --no-designer-plugin '
                '-b $TARGET_FOLDER/bin '
                '-d $TARGET_FOLDER/lib/python$PYTHON_VERSION_MAJOR/site-packages/ '
                '-v $TARGET_FOLDER/share/sip/PyQt4 '
                'CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"',
                'make -j $DCORES CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" ',
                'make -j $DCORES CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" install',
            ],
        )
        self.pyqt = pyqt

        glfw = build.make(
            ARGUMENTS,
            'glfw',
            download=[(
                'https://github.com/glfw/glfw/archive/3.2.1.tar.gz',
                'glfw-3.2.1.tar.gz',
                '3.2.1',
                '91b8250b6edcc26c9f5205555070a504',
            )],
            depend=[gcc],
            src = 'README.md',
            cmd = [
                'mkdir build',
                'cd build',
                '$CMAKE_TARGET_FOLDER/bin/cmake -DCMAKE_INSTALL_PREFIX=$TARGET_FOLDER -DBUILD_SHARED_LIBS=ON $SOURCE_FOLDER ',
                'make -j $DCORES install'
            ],
        )
        self.glfw = glfw

        log4cplus = build.configure(
            ARGUMENTS,
            'log4cplus',
            download=[(
                'https://github.com/log4cplus/log4cplus/archive/REL_1_2_0.tar.gz',
                'log4cplus-REL_1_2_0.tar.gz',
                '1.2.0',
                'b39900d6b504726a20819f2ad73f5877',
            )],
            depend=[gcc],
        )
        self.log4cplus = log4cplus

        # blosc = build.cmake(
        #     ARGUMENTS,
        #     'blosc',
        #     download=[(
        #         'https://github.com/Blosc/c-blosc/archive/v1.11.1.tar.gz',
        #         'c-blosc-1.11.1.tar.gz',
        #         '1.11.1',
        #         'e236550640afa50155f3881f2d300206',
        #     )],
        #     depend=[gcc],
        #     flags=['-DCMAKE_INSTALL_PREFIX=$TARGET_FOLDER '],
        # )
        # self.blosc = blosc





        # if all build is done correctly, make install folder ready!
        SCons.Script.Alias( 'install',
            SCons.Script.Command(
                target = os.path.join( devRoot.installRoot(ARGUMENTS), '.done'),
                source = self.qt.installAll + self.osl.installAll + self.boost.installAll + self.ilmbase.installAll + self.openexr.installAll,
                action = "touch $TARGET"
            )
        )
Example #6
0
from build import configure
configure()