[71547] trunk/dports/graphics/qwtplot3d/Portfile

michaelld at macports.org michaelld at macports.org
Thu Sep 16 07:08:56 PDT 2010


Revision: 71547
          http://trac.macports.org/changeset/71547
Author:   michaelld at macports.org
Date:     2010-09-16 07:08:54 -0700 (Thu, 16 Sep 2010)
Log Message:
-----------
Better way to handle debug and universal variants.

Modified Paths:
--------------
    trunk/dports/graphics/qwtplot3d/Portfile

Modified: trunk/dports/graphics/qwtplot3d/Portfile
===================================================================
--- trunk/dports/graphics/qwtplot3d/Portfile	2010-09-16 13:03:04 UTC (rev 71546)
+++ trunk/dports/graphics/qwtplot3d/Portfile	2010-09-16 14:08:54 UTC (rev 71547)
@@ -61,29 +61,33 @@
 
 variant debug description "Build release and debug versions" {}
 
-if {![variant_isset debug]} {
-    post-patch {
+post-patch {
+    # tweak the qwtplot3d.pro file.  add key for later reinplace for
+    # archs, no matter the status of the debug or universal variants.
+    reinplace "/CONFIG/s/debug/debug @UNIVERSAL_TYPES@/g" \
+        ${worksrcpath}/qwtplot3d.pro
+    if {![variant_isset debug]} {
         # remove 'debug' from the qwtplot3d.pro file
         reinplace "s at debug@@g" ${worksrcpath}/qwtplot3d.pro
     }
-}
-
-platform darwin 9 {
-    post-patch {
-        if {[variant_isset universal]} {
-            # add both architectures to CONFIG
-            reinplace "s@\\(CONFIG.*qt\\)@\\1 x86 ppc@" ${worksrcpath}/qwtplot3d.pro
+    set qca_arch_types_str ""
+    if {[variant_exists universal] && [variant_isset universal]} {
+        # set universal arch types, depending on what the
+        # user has specified
+        array set macports_to_qt_build_arch {
+            ppc     ppc
+            i386    x86
+            ppc64   ppc64
+            x86_64  x86_64
         }
-    }
-}
-
-platform darwin 10 {
-    post-patch {
-        if {[variant_isset universal]} {
-            # add both architectures to CONFIG
-            reinplace "s@\\(CONFIG.*qt\\)@\\1 x86 x86_64@" ${worksrcpath}/qwtplot3d.pro
+        set qca_arch_types ""
+        foreach arch ${universal_archs} {
+            lappend qca_arch_types $macports_to_qt_build_arch($arch)
         }
+        set qca_arch_types_str [join ${qca_arch_types} " "]
     }
+    reinplace "s/@UNIVERSAL_TYPES@/${qca_arch_types_str}/g" \
+        ${worksrcpath}/qwtplot3d.pro
 }
 
 variant universal {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100916/54bf5e36/attachment.html>


More information about the macports-changes mailing list