source: trunk/dports/devel/tbb/Portfile

Last change on this file was 140550, checked in by ryandesign@…, 22 months ago

tbb: update to 4.4-20150728 (#48928; maintainer approved)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.0 KB
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 140550 2015-09-22 13:35:47Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           muniversal 1.0
6
7name                tbb
8version             4.4-20150728
9categories          devel
10platforms           darwin
11maintainers         mehta.io:sean
12license             GPL-2
13
14description         Intel Threading Building Blocks offers a rich and complete approach to parallelism in C++
15
16long_description    ${description} \
17                    It represents a higher-level, task-based parallelism that abstracts \
18                    platform details and threading mechanisms for scalability and performance
19
20homepage            http://threadingbuildingblocks.org/
21master_sites        ${homepage}sites/default/files/software_releases/source/
22
23livecheck.version   [strsed [strsed ${version} {g/-/_/}] {g/\.//}]
24
25worksrcdir          ${name}${livecheck.version}oss
26distname            ${worksrcdir}_src
27extract.suffix      .tgz
28
29checksums           rmd160  7a3bd111c3155d23141ca24ff0e07ef438fae6a5 \
30                    sha256  e9534f3238e6f7b34f9d0a78cb8604da1c5a611c5a2569fdd9cc90e06339538a
31
32use_configure       no
33
34set tbb_arch(i386)      ia32
35set tbb_arch(ppc)       ppc32
36set tbb_arch(x86_64)    intel64
37if {![info exists tbb_arch(${configure.build_arch})]} {
38    set tbb_arch(${configure.build_arch}) ${configure.build_arch}
39}
40
41if {[string match *clang* ${configure.compiler}]} {
42    set tbb_compiler clang
43} else {
44    set tbb_compiler gcc
45}
46
47set tbb_build_prefix macports
48
49patchfiles          patch-build-macos.inc.diff
50
51post-patch {
52    reinplace "s|@CC@|${configure.cc}|g" ${worksrcpath}/build/macos.inc
53    reinplace "/^CONLY *=/s|=.*$|= ${configure.cc}|g" ${worksrcpath}/build/macos.${tbb_compiler}.inc
54    reinplace "/^CPLUS *=/s|=.*$|= ${configure.cxx}|g" ${worksrcpath}/build/macos.${tbb_compiler}.inc
55
56    # http://software.intel.com/en-us/forums/topic/505370
57    reinplace "/ -dynamiclib/s|$| -install_name ${prefix}/lib/\$@|g" ${worksrcpath}/build/macos.${tbb_compiler}.inc
58}
59
60build.target        tbb tbbmalloc tbbproxy
61build.args-append   compiler=${tbb_compiler} \
62                    tbb_build_prefix=${tbb_build_prefix} \
63                    use_proxy=1
64
65test.run            yes
66test.target         test
67test.args-append    ${build.args}
68
69# The Makefile does not have an install target.
70# http://software.intel.com/en-us/forums/topic/347428
71# but the muniversal portgroup requires a destroot.cmd
72destroot.cmd        true
73
74if {[variant_isset universal]} {
75    foreach arch ${configure.universal_archs} {
76        set merger_build_args(${arch}) arch=$tbb_arch(${arch})
77        set merger_test_args(${arch}) arch=$tbb_arch(${arch})
78    }
79    merger-post-destroot {
80        foreach arch ${universal_archs_to_use} {
81            tbb_destroot ${worksrcpath}-${arch} ${destroot}-${arch}
82        }
83    }
84} else {
85    build.args-append arch=$tbb_arch(${configure.build_arch})
86    test.args-append arch=$tbb_arch(${configure.build_arch})
87    post-destroot {
88        tbb_destroot ${worksrcpath} ${destroot}
89    }
90}
91
92proc tbb_destroot {worksrcpath destroot} {
93    global          destroot.dir prefix tbb_build_prefix
94    destroot.dir    ${worksrcpath}/build/${tbb_build_prefix}_release
95
96    # fix paths
97    reinplace -W ${destroot.dir} "s|\\(TBBROOT.\\)\".*\"|\\1\"${prefix}\"|g" tbbvars.sh tbbvars.csh
98    reinplace -W ${destroot.dir} "s|\\(tbb_bin.\\)\".*\"|\\1\"${prefix}/lib\"|g" tbbvars.sh tbbvars.csh
99
100    # copy lib, include & bin
101    copy {*}[glob ${destroot.dir}/lib*.dylib] ${destroot}${prefix}/lib
102    copy {*}[glob ${destroot.dir}/tbbvars.*sh] ${destroot}${prefix}/bin
103    copy ${worksrcpath}/include/tbb ${destroot}${prefix}/include/tbb
104}
105
106post-destroot {
107    # copy examples & docs
108    xinstall -d ${destroot}${prefix}/share/${name}
109    copy ${worksrcpath}/doc ${destroot}${prefix}/share/${name}/doc
110    copy ${worksrcpath}/examples ${destroot}${prefix}/share/${name}/examples
111}
112
113livecheck.type      regex
114livecheck.url       ${homepage}download
115livecheck.regex     ${name}(\[\\d_\]+)oss_src${extract.suffix}
Note: See TracBrowser for help on using the repository browser.