[69365] trunk/dports/aqua

michaelld at macports.org michaelld at macports.org
Fri Jul 2 08:28:55 PDT 2010


Revision: 69365
          http://trac.macports.org/changeset/69365
Author:   michaelld at macports.org
Date:     2010-07-02 08:28:55 -0700 (Fri, 02 Jul 2010)
Log Message:
-----------
Trial fixed for tickets #20199 and #25476 (among other duplicates).
Revert back to using CPATH and LIBRARY_PATH for MacPorts-provided
headers and libraries.  Add in: Manually remove the -I paths for
SQLITE and DBUS so that they do not appear in any Makefile's CXXFLAGS,
but rather are found via the CPATH.  No revision bump, since this fix
is meant to address those folks for whom the current Portfiles already
do not work.

Modified Paths:
--------------
    trunk/dports/aqua/qt4-mac/Portfile
    trunk/dports/aqua/qt4-mac-devel/Portfile

Modified: trunk/dports/aqua/qt4-mac/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac/Portfile	2010-07-02 15:26:51 UTC (rev 69364)
+++ trunk/dports/aqua/qt4-mac/Portfile	2010-07-02 15:28:55 UTC (rev 69365)
@@ -69,7 +69,6 @@
 set dirname ${name}
 set qt_dir ${prefix}/libexec/${dirname}
 
-#
 #  use compiler.cpath and compiler.library_path, as per
 #  http://trac.macports.org/ticket/25321 for all -I and -L entries,
 #  so-as to avoid conflicts with already-installed headers and
@@ -79,13 +78,20 @@
 #  See http://trac.macports.org/ticket/15219 and
 #  http://trac.macports.org/ticket/18723.
 #
+#  set the default paths to include those for SQLITE3 and DBUS-1
+
+set header_path [ list ${prefix}/include/dbus-1.0 \
+                       ${prefix}/lib/dbus-1.0/include \
+                       ${prefix}/include ]
+
+set library_path [ list ${prefix}/lib ]
+
 # -system-sqlite ensures the use SQLite provided by MacPorts instead of Qt.
 #
 # -dbus-linked prevends qt4 from trying to dynamically load libdbus-1,
 #     which it is not able to find in ${prefix}.
 #
 # -openssl-linked ensures that the MacPorts openssl is used.
-#
 
 configure.args                                            \
     -v                                                    \
@@ -116,11 +122,37 @@
     configure.args-append -no-sql-${driver}
 }
 
+# use the corrected CPATH and LIBRARY_PATH for configure
+pre-configure {
+    compiler.cpath [join ${header_path} :]
+    compiler.library_path [join ${library_path} :]
+}
+
+# Remove any '-I' string from the C*FLAGS for SQLITE and DBUS, so that
+# what remains are just non-I flags; these paths are in compiler.cpath .
+# The includes for all the other variants are not used by
+# 'configure', and are already included in the compiler.cpath .
+post-configure {
+    # SQLITE first
+    reinplace "/CFLAGS_SQLITE/s at -I${prefix}/\[^ \]*include\[^ \]*@@g" \
+        ${worksrcpath}/.qmake.cache
+    # DBUS last
+    reinplace "/CFLAGS_DBUS/s at -I${prefix}/\[^ \]*include\[^ \]*@@g" \
+        ${worksrcpath}/.qmake.cache
+    # during the 'build' stage, 'make' will rebuild the Makefiles that
+    # depend on any of these changed files.
+}
+
+# use the corrected CPATH and LIBRARY_PATH for build
+pre-build {
+    compiler.cpath [join ${header_path} :]
+    compiler.library_path [join ${library_path} :]
+}
+
 variant mysql description {Enable MySQL SQL Driver} {
     depends_lib-append path:lib/mysql5:mysql5
-    # reverse the search paths, such that the defaults are searched last
-    compiler.cpath ${prefix}/include/mysql5/mysql:${compiler.cpath}
-    compiler.library_path ${prefix}/lib/mysql5/mysql:${compiler.library_path}
+    lunshift header_path ${prefix}/include/mysql5/mysql
+    lunshift library_path ${prefix}/lib/mysql5/mysql
     configure.args-delete -no-sql-mysql
 }
 
@@ -131,9 +163,8 @@
 
 variant psql description {Enable PostgreSQL SQL Driver} {
     depends_lib-append port:postgresql83
-    # reverse the search paths, such that the defaults are searched last
-    compiler.cpath ${prefix}/include/postgresql83:${compiler.cpath}
-    compiler.library_path ${prefix}/lib/postgresql83:${compiler.library_path}
+    lunshift header_path ${prefix}/include/postgresql83
+    lunshift library_path ${prefix}/lib/postgresql83
     configure.args-delete -no-sql-psql
 }
 
@@ -181,17 +212,31 @@
     }
 }
 
-# use the 10.5 SDK for 10.5 or 10.6,
+# use the 10.5 SDK for 10.5,
 # but only if not (doing universal and the universal sysroot is set)
 platform darwin 9 {
     if {![variant_isset universal] || ![info exists universal_sysroot]} {
-        configure.args-append -sdk /Developer/SDKs/MacOSX10.5.sdk/
+        if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
+            configure.args-append -sdk /Developer/SDKs/MacOSX10.5.sdk/
+        } else {
+            ui_msg "No SDK found in Developer/SDKs ; \
+configure will probably fail. \n \
+Please install Apple's Developer Tools again."
+        }
     }
 }
 
+# use the 10.6 SDK for 10.6
+# but only if not (doing universal and the universal sysroot is set)
 platform darwin 10 {
     if {![variant_isset universal] || ![info exists universal_sysroot]} {
-        configure.args-append -sdk /Developer/SDKs/MacOSX10.5.sdk/
+        if {[file exists /Developer/SDKs/MacOSX10.6.sdk]} {
+            configure.args-append -sdk /Developer/SDKs/MacOSX10.6.sdk/
+        } else {
+            ui_msg "No SDK found in /Developer/SDKs ; \
+configure will probably fail. \n \
+Please install Apple's Developer Tools again."
+        }
     }
 }
 

Modified: trunk/dports/aqua/qt4-mac-devel/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/Portfile	2010-07-02 15:26:51 UTC (rev 69364)
+++ trunk/dports/aqua/qt4-mac-devel/Portfile	2010-07-02 15:28:55 UTC (rev 69365)
@@ -68,7 +68,6 @@
 set dirname ${name}
 set qt_dir ${prefix}/libexec/${dirname}
 
-#
 #  use compiler.cpath and compiler.library_path, as per
 #  http://trac.macports.org/ticket/25321 for all -I and -L entries,
 #  so-as to avoid conflicts with already-installed headers and
@@ -78,13 +77,20 @@
 #  See http://trac.macports.org/ticket/15219 and
 #  http://trac.macports.org/ticket/18723.
 #
+#  set the default paths to include those for SQLITE3 and DBUS-1
+
+set header_path [ list ${prefix}/include/dbus-1.0 \
+                       ${prefix}/lib/dbus-1.0/include \
+                       ${prefix}/include ]
+
+set library_path [ list ${prefix}/lib ]
+
 # -system-sqlite ensures the use SQLite provided by MacPorts instead of Qt.
 #
 # -dbus-linked prevends qt4 from trying to dynamically load libdbus-1,
 #     which it is not able to find in ${prefix}.
 #
 # -openssl-linked ensures that the MacPorts openssl is used.
-#
 
 configure.args                                            \
     -v                                                    \
@@ -115,11 +121,37 @@
     configure.args-append -no-sql-${driver}
 }
 
+# use the corrected CPATH and LIBRARY_PATH for configure
+pre-configure {
+    compiler.cpath [join ${header_path} :]
+    compiler.library_path [join ${library_path} :]
+}
+
+# Remove any '-I' string from the C*FLAGS for SQLITE and DBUS, so that
+# what remains are just non-I flags; these paths are in compiler.cpath .
+# The includes for all the other variants are not used by
+# 'configure', and are already included in the compiler.cpath .
+post-configure {
+    # SQLITE first
+    reinplace "/CFLAGS_SQLITE/s at -I${prefix}/\[^ \]*include\[^ \]*@@g" \
+        ${worksrcpath}/.qmake.cache
+    # DBUS last
+    reinplace "/CFLAGS_DBUS/s at -I${prefix}/\[^ \]*include\[^ \]*@@g" \
+        ${worksrcpath}/.qmake.cache
+    # during the 'build' stage, 'make' will rebuild the Makefiles that
+    # depend on any of these changed files.
+}
+
+# use the corrected CPATH and LIBRARY_PATH for build
+pre-build {
+    compiler.cpath [join ${header_path} :]
+    compiler.library_path [join ${library_path} :]
+}
+
 variant mysql description {Enable MySQL SQL Driver} {
     depends_lib-append path:lib/mysql5:mysql5
-    # reverse the search paths, such that the defaults are searched last
-    compiler.cpath ${prefix}/include/mysql5/mysql:${compiler.cpath}
-    compiler.library_path ${prefix}/lib/mysql5/mysql:${compiler.library_path}
+    lunshift header_path ${prefix}/include/mysql5/mysql
+    lunshift library_path ${prefix}/lib/mysql5/mysql
     configure.args-delete -no-sql-mysql
 }
 
@@ -130,9 +162,8 @@
 
 variant psql description {Enable PostgreSQL SQL Driver} {
     depends_lib-append port:postgresql83
-    # reverse the search paths, such that the defaults are searched last
-    compiler.cpath ${prefix}/include/postgresql83:${compiler.cpath}
-    compiler.library_path ${prefix}/lib/postgresql83:${compiler.library_path}
+    lunshift header_path ${prefix}/include/postgresql83
+    lunshift library_path ${prefix}/lib/postgresql83
     configure.args-delete -no-sql-psql
 }
 
@@ -180,17 +211,31 @@
     }
 }
 
-# use the 10.5 SDK for 10.5 or 10.6,
+# use the 10.5 SDK for 10.5,
 # but only if not (doing universal and the universal sysroot is set)
 platform darwin 9 {
     if {![variant_isset universal] || ![info exists universal_sysroot]} {
-        configure.args-append -sdk /Developer/SDKs/MacOSX10.5.sdk/
+        if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
+            configure.args-append -sdk /Developer/SDKs/MacOSX10.5.sdk/
+        } else {
+            ui_msg "No SDK found in Developer/SDKs ; \
+configure will probably fail. \n \
+Please install Apple's Developer Tools again."
+        }
     }
 }
 
+# use the 10.6 SDK for 10.6
+# but only if not (doing universal and the universal sysroot is set)
 platform darwin 10 {
     if {![variant_isset universal] || ![info exists universal_sysroot]} {
-        configure.args-append -sdk /Developer/SDKs/MacOSX10.5.sdk/
+        if {[file exists /Developer/SDKs/MacOSX10.6.sdk]} {
+            configure.args-append -sdk /Developer/SDKs/MacOSX10.6.sdk/
+        } else {
+            ui_msg "No SDK found in /Developer/SDKs ; \
+configure will probably fail. \n \
+Please install Apple's Developer Tools again."
+        }
     }
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100702/5a2e06d6/attachment.html>


More information about the macports-changes mailing list