Ticket #25469: Portfile.tbb-3.0

File Portfile.tbb-3.0, 3.1 KB (added by josephsacco, 14 years ago)

Portfile for building tbb-3.0

Line 
1# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 57727 2009-09-15 18:40:12Z mnick@macports.org $
3
4PortSystem          1.0
5
6name                tbb
7set rel_date        20100406
8set vers            3.0
9version             ${vers}-${rel_date}
10revision            1
11maintainers         mnick openmaintainer
12
13categories          devel
14description         Intel Threading Building Blocks offers a rich and complete approach to parallelism in C++
15long_description    ${description} \
16                    It represents a higher-level, task-based parallelism that abstracts \
17                    platform details and threading mechanisms for scalability and performance
18license             GPL
19platforms           darwin
20
21homepage            http://www.threadingbuildingblocks.org
22master_sites        ${homepage}/uploads/77/151/${vers}/
23worksrcdir          ${name}30_${rel_date}oss
24distname            ${worksrcdir}_src
25extract.suffix      .tgz
26
27checksums           md5     645aeaa5473e7a8986cd629c5f7262bb \
28                    sha1    0c10aaa7f60762a4a2c2c907a2fee552eba4132c \
29                    rmd160  52882e20b0753b669bda60bce7f61f20f3245a86
30
31universal_variant   no
32build.target        tbb tbbmalloc
33
34configure {
35    if {${build_arch} eq "i386"} {
36        set arch_flag intel32
37    } elseif {${build_arch} eq "x86_64"} {
38        set arch_flag intel64
39    } elseif {${build_arch} eq "ppc"} {
40        set arch_flag ppc
41    } elseif {${build_arch} eq "ppc64"} {
42        set arch_flag ppc64
43    }
44    build.env-append    arch=${arch_flag}
45    test.env-append     arch=${arch_flag}
46}
47
48destroot {
49    set build_dir [exec sh -c "cd ${worksrcpath} && ${build.env} make info | grep build_prefix | cut -f2 -d'='"]
50    set build_dir "${worksrcpath}/build/${build_dir}_release"
51   
52    # fix paths
53    reinplace "s|\\(TBB30_INSTALL_DIR.\\)\".*\"|\\1\"${prefix}\"|g" \
54        ${build_dir}/tbbvars.sh ${build_dir}/tbbvars.csh
55    reinplace "s|\\(tbb_bin.\\)\".*\"|\\1\"${prefix}/lib\"|g" \
56        ${build_dir}/tbbvars.sh ${build_dir}/tbbvars.csh
57
58    # copy lib, include & bin
59    eval file copy [glob ${build_dir}/lib*.dylib] ${destroot}${prefix}/lib
60    eval file copy [glob ${build_dir}/tbbvars.*sh] ${destroot}${prefix}/bin
61    file copy ${worksrcpath}/include/tbb ${destroot}${prefix}/include/tbb
62   
63    # fix install_name paths
64    system "install_name_tool -id ${prefix}/lib/libtbb.dylib ${destroot}${prefix}/lib/libtbb.dylib"
65    system "install_name_tool -id ${prefix}/lib/libtbbmalloc.dylib ${destroot}${prefix}/lib/libtbbmalloc.dylib"
66   
67    # copy examples & docs
68    file mkdir ${destroot}${prefix}/share/${name}
69    file copy ${worksrcpath}/doc ${destroot}${prefix}/share/${name}/doc
70    file copy ${worksrcpath}/examples ${destroot}${prefix}/share/${name}/examples
71}
72
73test.run            yes
74test.cmd            make
75test.target         test
76
77livecheck.type      regex
78livecheck.url       ${homepage}/file.php?fid=77
79livecheck.version   [join [split [lrange [split ${version} -] 0 0] .] ""]_${rel_date}
80livecheck.regex     <a href='ver.php\\?fid=\\d+'>${name}(\[\\d_\]+)oss</a>