[71538] trunk/dports/devel/qca

michaelld at macports.org michaelld at macports.org
Wed Sep 15 13:46:54 PDT 2010


Revision: 71538
          http://trac.macports.org/changeset/71538
Author:   michaelld at macports.org
Date:     2010-09-15 13:46:53 -0700 (Wed, 15 Sep 2010)
Log Message:
-----------
Better way to handle +universal variant.
Added in configure feature for specifying 10.4 SDK.

Modified Paths:
--------------
    trunk/dports/devel/qca/Portfile
    trunk/dports/devel/qca/files/patch-configure.diff

Modified: trunk/dports/devel/qca/Portfile
===================================================================
--- trunk/dports/devel/qca/Portfile	2010-09-15 20:37:00 UTC (rev 71537)
+++ trunk/dports/devel/qca/Portfile	2010-09-15 20:46:53 UTC (rev 71538)
@@ -28,10 +28,12 @@
 depends_build        port:pkgconfig
 depends_lib          port:qt4-mac
 
-# patch to correct pkgconfig file for framework install, if selected.
-# and allow for 'debug' and 'framework' options at the same time.
-# This change is needed to allow for +debug [+framework] -- disallow
-# just debug framework via no variants for it.
+# (1) correct pkgconfig file for framework install, if selected.
+# (2) allow for 'debug' and 'framework' options at the same time.
+#     This change is needed to allow for +debug [+framework] --
+#     disallow just debug framework via no variants for it.
+# (3) allow simple replacement for universal arch arguments, if that
+#     variant is requested.
 patchfiles           patch-configure.diff
 
 set qt_dir           ${prefix}/libexec/qt4-mac
@@ -97,18 +99,45 @@
     }
 }
 
-platform darwin 10 {
-    post-patch {
-        # have configure use X86_64, not PPC,
-        # as the other half of "universal"
-        reinplace "s at ppc@x86_64 at g" ${worksrcpath}/configure
+post-patch {
+    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
+        }
+        set qca_arch_types ""
+        set qca_qt_config_str ""
+        foreach arch ${universal_archs} {
+            set this_arch_in_qt $macports_to_qt_build_arch($arch)
+            lappend qca_arch_types ${this_arch_in_qt}
+            lappend qca_qt_config_strs "contains(QT_CONFIG,${this_arch_in_qt})"
+        }
+        set qca_arch_types_str [join ${qca_arch_types} " "]
+        set qca_qt_config_str [join ${qca_qt_config_strs} ":"]
+        reinplace "s/@UNIVERSAL_CONTAINS@/${qca_qt_config_str}/g" \
+            ${worksrcpath}/configure
+        reinplace "s/@UNIVERSAL_TYPES@/${qca_arch_types_str}/g" \
+            ${worksrcpath}/configure
     }
 }
 
+platform darwin 8 {
+    # might not be necessary
+    if {[variant_exists universal] && [variant_isset universal]} {
+        configure.args-append --mac-sdk=${developer_dir}/SDKs/MacOSX10.4u.sdk
+    }
+}
+
+# QCA's configure does not handle this flag,
+# but does not generate an error either.
+configure.universal_args-delete --disable-dependency-tracking
+configure.args-delete  --disable-dependency-tracking
+
 variant universal {
-    # remove from universal configure flags
-    configure.universal_args-delete --disable-dependency-tracking
-    # and add in the one used by qmake
+    # Add the universal flag understood by qmake
     configure.universal_args-append --universal
 }
 

Modified: trunk/dports/devel/qca/files/patch-configure.diff
===================================================================
--- trunk/dports/devel/qca/files/patch-configure.diff	2010-09-15 20:37:00 UTC (rev 71537)
+++ trunk/dports/devel/qca/files/patch-configure.diff	2010-09-15 20:46:53 UTC (rev 71538)
@@ -1,5 +1,5 @@
---- configure.orig	2010-07-14 11:50:27.000000000 -0600
-+++ configure	2010-07-14 11:51:53.000000000 -0600
+--- configure_orig	2010-09-10 09:26:14.000000000 -0400
++++ configure	2010-09-10 09:28:20.000000000 -0400
 @@ -618,12 +618,6 @@
  		}
  #endif
@@ -13,7 +13,29 @@
  		// sanity check exclusive options
  		int x;
  
-@@ -884,10 +884,19 @@
+@@ -700,8 +694,8 @@
+ 			qc_universal_enabled = true;
+ 
+ 			QString str =
+-			"contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n"
+-			"	CONFIG += x86 ppc\n"
++                        "@UNIVERSAL_CONTAINS@ {\n"
++                        "       CONFIG += @UNIVERSAL_TYPES@\n"
+ 			"}\n";
+ 
+ 			QString sdk = qc_getenv("QC_MAC_SDK");
+@@ -817,8 +811,8 @@
+ 		if(universal)
+ 		{
+ 			str +=
+-			"contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n"
+-			"	CONFIG += x86 ppc\n"
++                        "@UNIVERSAL_CONTAINS@ {\n"
++                        "       CONFIG += @UNIVERSAL_TYPES@\n"
+ 			"}\n";
+ 
+ 			if(!sdk.isEmpty())
+@@ -884,10 +878,19 @@
  		QString pkg_template3 = QString(
  		"Requires: %1\n");
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100915/4a36fec3/attachment-0001.html>


More information about the macports-changes mailing list