[48505] trunk/dports/devel/unittest-cpp/Portfile

macsforever2000 at macports.org macsforever2000 at macports.org
Mon Mar 23 19:09:19 PDT 2009


Revision: 48505
          http://trac.macports.org/changeset/48505
Author:   macsforever2000 at macports.org
Date:     2009-03-23 19:09:19 -0700 (Mon, 23 Mar 2009)
Log Message:
-----------
Add Universal variant. (#18948)

Modified Paths:
--------------
    trunk/dports/devel/unittest-cpp/Portfile

Modified: trunk/dports/devel/unittest-cpp/Portfile
===================================================================
--- trunk/dports/devel/unittest-cpp/Portfile	2009-03-24 02:02:32 UTC (rev 48504)
+++ trunk/dports/devel/unittest-cpp/Portfile	2009-03-24 02:09:19 UTC (rev 48505)
@@ -26,10 +26,6 @@
 
 use_configure           no
 
-test.run                yes
-test.target             
-test.cmd                ./TestUnitTest++
-
 destroot {
     xinstall -m 755 -d ${destroot}${prefix}/include/unittest++/Posix
     eval xinstall -m 640 [glob ${worksrcpath}/src/*.h] \
@@ -40,4 +36,23 @@
         ${destroot}${prefix}/lib
 }
 
-universal_variant       no
+variant universal {
+    build {
+        # Build and test the library for the native architecture,
+        # just to check if everything is fine.
+        system "cd ${worksrcpath} && ${build.cmd} TestUnitTest++"
+        system "cd ${worksrcpath} && ${build.cmd} clean"
+        
+        # Now build the library for all universal architectures.
+        set lipo_args {}
+        foreach arch ${universal_archs} {
+            system "cd ${worksrcpath} && ${build.cmd} libUnitTest++.a CXXFLAGS='-arch ${arch}' LDFLAGS='-arch ${arch}'"
+            move ${worksrcpath}/libUnitTest++.a ${worksrcpath}/libUnitTest++.a.${arch}
+            system "cd ${worksrcpath} && ${build.cmd} clean"
+            lappend lipo_args -arch ${arch} ${worksrcpath}/libUnitTest++.a.${arch}
+        }
+        
+        # Roll a universal binary.
+        system "lipo ${lipo_args} -create -output ${worksrcpath}/libUnitTest++.a"
+    }
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090323/12df4c3e/attachment.html>


More information about the macports-changes mailing list