[140447] trunk/dports/devel/tbb/Portfile

ryandesign at macports.org ryandesign at macports.org
Sat Sep 19 11:35:08 PDT 2015


Revision: 140447
          https://trac.macports.org/changeset/140447
Author:   ryandesign at macports.org
Date:     2015-09-19 11:35:07 -0700 (Sat, 19 Sep 2015)
Log Message:
-----------
tbb: add universal variant (#37320)

Modified Paths:
--------------
    trunk/dports/devel/tbb/Portfile

Modified: trunk/dports/devel/tbb/Portfile
===================================================================
--- trunk/dports/devel/tbb/Portfile	2015-09-19 18:27:47 UTC (rev 140446)
+++ trunk/dports/devel/tbb/Portfile	2015-09-19 18:35:07 UTC (rev 140447)
@@ -2,6 +2,7 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           muniversal 1.0
 
 name                tbb
 version             4.3-20150424
@@ -30,19 +31,11 @@
 
 use_configure       no
 
-switch ${build_arch} {
-    i386 {
-        set tbb_arch ia32
-    }
-    x86_64 {
-        set tbb_arch intel64
-    }
-    ppc {
-        set tbb_arch ppc32
-    }
-    default {
-        set tbb_arch ${build_arch}
-    }
+set tbb_arch(i386)      ia32
+set tbb_arch(ppc)       ppc32
+set tbb_arch(x86_64)    intel64
+if {![info exists tbb_arch(${configure.build_arch})]} {
+    set tbb_arch(${configure.build_arch}) ${configure.build_arch}
 }
 
 if {[string match *clang* ${configure.compiler}]} {
@@ -65,8 +58,7 @@
 }
 
 build.target        tbb tbbmalloc tbbproxy
-build.args-append   arch=${tbb_arch} \
-                    compiler=${tbb_compiler} \
+build.args-append   compiler=${tbb_compiler} \
                     tbb_build_prefix=${tbb_build_prefix} \
                     use_proxy=1
 
@@ -76,19 +68,42 @@
 
 # The Makefile does not have an install target.
 # http://software.intel.com/en-us/forums/topic/347428
-destroot.dir        ${worksrcpath}/build/${tbb_build_prefix}_release
-destroot {
+# but the muniversal portgroup requires a destroot.cmd
+destroot.cmd        true
+
+if {[variant_isset universal]} {
+    foreach arch ${configure.universal_archs} {
+        set merger_build_args(${arch}) arch=$tbb_arch(${arch})
+        set merger_test_args(${arch}) arch=$tbb_arch(${arch})
+    }
+    merger-post-destroot {
+        foreach arch ${universal_archs_to_use} {
+            tbb_destroot ${worksrcpath}-${arch} ${destroot}-${arch}
+        }
+    }
+} else {
+    build.args-append arch=$tbb_arch(${configure.build_arch})
+    test.args-append arch=$tbb_arch(${configure.build_arch})
+    post-destroot {
+        tbb_destroot ${worksrcpath} ${destroot}
+    }
+}
+
+proc tbb_destroot {worksrcpath destroot} {
+    global          destroot.dir prefix tbb_build_prefix
+    destroot.dir    ${worksrcpath}/build/${tbb_build_prefix}_release
+
     # fix paths
-    reinplace "s|\\(TBBROOT.\\)\".*\"|\\1\"${prefix}\"|g" \
-        ${destroot.dir}/tbbvars.sh ${destroot.dir}/tbbvars.csh
-    reinplace "s|\\(tbb_bin.\\)\".*\"|\\1\"${prefix}/lib\"|g" \
-        ${destroot.dir}/tbbvars.sh ${destroot.dir}/tbbvars.csh
+    reinplace -W ${destroot.dir} "s|\\(TBBROOT.\\)\".*\"|\\1\"${prefix}\"|g" tbbvars.sh tbbvars.csh
+    reinplace -W ${destroot.dir} "s|\\(tbb_bin.\\)\".*\"|\\1\"${prefix}/lib\"|g" tbbvars.sh tbbvars.csh
 
     # copy lib, include & bin
     copy {*}[glob ${destroot.dir}/lib*.dylib] ${destroot}${prefix}/lib
     copy {*}[glob ${destroot.dir}/tbbvars.*sh] ${destroot}${prefix}/bin
     copy ${worksrcpath}/include/tbb ${destroot}${prefix}/include/tbb
+}
 
+post-destroot {
     # copy examples & docs
     xinstall -d ${destroot}${prefix}/share/${name}
     copy ${worksrcpath}/doc ${destroot}${prefix}/share/${name}/doc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150919/a541a3fa/attachment.html>


More information about the macports-changes mailing list