[48160] trunk/dports/aqua/qt4-mac-devel

mcalhoun at macports.org mcalhoun at macports.org
Sun Mar 15 11:37:20 PDT 2009


Revision: 48160
          http://trac.macports.org/changeset/48160
Author:   mcalhoun at macports.org
Date:     2009-03-15 11:37:18 -0700 (Sun, 15 Mar 2009)
Log Message:
-----------
qt4-mac-devel:
  * By default, have only one SQL driver.
  * Ensure SQL drivers which are not requested are not used.
  * Remove webkit variant as it is no longer a configure option.
  * Allow 64-bit universal builds.
  * Remove unnecessary code to fix .pc and .prl files.
  * Ensure that MacPorts compilers are used.

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

Added Paths:
-----------
    trunk/dports/aqua/qt4-mac-devel/files/patch-isystem.diff
    trunk/dports/aqua/qt4-mac-devel/files/patch-network.pro.diff
    trunk/dports/aqua/qt4-mac-devel/files/patch-odbc.diff
    trunk/dports/aqua/qt4-mac-devel/files/patch-precomp.test.diff

Removed Paths:
-------------
    trunk/dports/aqua/qt4-mac-devel/files/patch-compile.test.diff
    trunk/dports/aqua/qt4-mac-devel/files/patch-configure.diff

Modified: trunk/dports/aqua/qt4-mac-devel/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/Portfile	2009-03-15 16:55:49 UTC (rev 48159)
+++ trunk/dports/aqua/qt4-mac-devel/Portfile	2009-03-15 18:37:18 UTC (rev 48160)
@@ -5,7 +5,7 @@
 
 name                qt4-mac-devel
 version             4.5.0
-revision            0
+revision            1
 categories          aqua
 platforms           macosx
 maintainers         illogic-al openmaintainer
@@ -32,11 +32,20 @@
     port:libmng                            \
     port:jpeg                              \
     port:dbus                              \
-    port:unixODBC                          \
     port:openssl                           \
     port:sqlite3
 
-patchfiles          patch-compile.test.diff patch-mac.conf.diff patch-configure.diff
+# Build plugins as bundle files instead of dylib files.
+# Allow the use of -isystem instead of -I to include files.
+# Test for Precompiled-headers support requires a C++ compiler, but configure calls it, by default, with a C compiler.
+# Use unixODBC provided by MacPorts instead of iODBC provided my Mac OS.
+# Ensure that securesocketclient demo is built even with configure option -openssl-linked.
+patchfiles                   \
+    patch-mac.conf.diff      \
+    patch-isystem.diff       \
+    patch-precomp.test.diff  \
+    patch-odbc.diff          \
+    patch-network.pro.diff
 
 # have to build with Apple gcc because of -fconstant-cfstrings
 # configure.compiler should therefore not be one of the MacPorts compilers
@@ -51,20 +60,18 @@
 set dirname qt4-mac
 set qt_dir ${prefix}/libexec/${dirname}
 
-# See
-#   http://doc.trolltech.com/qtopia4.3/buildsystem/over-configure-options-qt-1.html
-# for options
-#
 # -isystem is used instead of -I to avoid conflicts with other ports (e.g. pcre).
 #  See http://trac.macports.org/ticket/15219 and http://trac.macports.org/ticket/18723.
 #
+# -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                                                         \
     -debug-and-release                                         \
-    -framework                                                 \
     -confirm-license                                           \
     -prefix          ${qt_dir}                                 \
     -docdir          ${prefix}/share/doc/${dirname}            \
@@ -76,29 +83,86 @@
     -isystem${prefix}/include                                  \
     -L${prefix}/lib
 
+# Stop configure script from searching for SQL Drivers
+#    not available from MacPorts.
+foreach driver {db2 ibase oci tds} {
+    configure.args-append -no-sql-${driver}
+}
+
+# By default, disable most SQL Drivers.
+# There must be at least one enabled (http://trac.macports.org/ticket/15627).
+# SQLite is chosen to be always enabled because a copy of it is distributed
+#    with Qt, so it is reasonable for the user to expect it.
+foreach driver {mysql odbc psql sqlite2} {
+    configure.args-append -no-sql-${driver}
+}
+
+variant mysql description {Enable MySQL SQL Driver} {
+    depends_lib-append path:lib/mysql5:mysql5
+
+    configure.args-append \
+        -isystem${prefix}/include/mysql5/mysql \
+        -L${prefix}/lib/mysql5/mysql
+
+    configure.args-delete -no-sql-mysql
+}
+
+variant odbc description {Enable unixODBC SQL Driver} {
+    depends_lib-append port:unixODBC
+    configure.args-delete -no-sql-odbc
+}
+
+variant psql description {Enable PostgreSQL SQL Driver} {
+    depends_lib-append port:postgresql83
+
+    configure.args-append \
+        -isystem${prefix}/include/postgresql83 \
+        -L${prefix}/lib/postgresql83
+
+    configure.args-delete -no-sql-psql
+}
+
+variant sqlite2 description {Enable MySQL version 2 SQL Driver} {
+    depends_lib-append port:sqlite2
+    configure.args-delete -no-sql-sqlite2
+}
+
+variant cocoa description {Build the Cocoa version of Qt in 32-bit mode} conflicts noframework {
+    configure.args-append  -cocoa
+
+    # Everything might build, but nothing will run.
+    pre-fetch {
+        if { ${os.major} < 9 } {
+            return -code error "Variant cocoa creates Qt binaries which require Mac OS X 10.5 or higher."
+        }
+    }
+}
+
+variant noframework description {Do not build frameworks} conflicts cocoa {
+    configure.args-append   -no-framework
+}
+
 build.target        first
 use_parallel_build  yes
 
 destroot.destdir    INSTALL_ROOT="${destroot}"
 
 post-patch {
-    # ensure that the MacPorts odbc is used
-    reinplace "s|-liodbc|-lodbc|" \
-        ${worksrcpath}/src/plugins/sqldrivers/odbc/odbc.pro
-
     # ensure that securesocketclient demo is built
     reinplace "s|contains(QT_CONFIG, openssl)|contains(QT_CONFIG, openssl) \\| contains(QT_CONFIG, openssl-linked)|" \
         ${worksrcpath}/examples/network/network.pro
 
     # ensure that MacPorts compilers are used
-    reinplace "s| gcc\$| ${configure.cc}|" ${worksrcpath}/mkspecs/common/mac-g++.conf
+    reinplace "s| g++\$| ${configure.cxx}|" ${worksrcpath}/mkspecs/common/g++.conf
+    reinplace "s| gcc\$| ${configure.cc}|"  ${worksrcpath}/mkspecs/common/g++.conf
     reinplace "s| g++\$| ${configure.cxx}|" ${worksrcpath}/mkspecs/common/mac-g++.conf
+    reinplace "s| gcc\$| ${configure.cc}|"  ${worksrcpath}/mkspecs/common/g++.conf
+    reinplace "s| g++\$| ${configure.cxx}|" ${worksrcpath}/mkspecs/macx-g++/qmake.conf
 }
 
 post-destroot {
     # install documentation
-    foreach doc {INSTALL LICENSE.LGPL LICENSE.GPL3 LGPL_EXCEPTION.txt \
-        KNOWN.ISSUES README} {
+    foreach doc { INSTALL LICENSE.LGPL LICENSE.GPL3 LGPL_EXCEPTION.txt README } {
         xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${portname}
     }
 
@@ -124,11 +188,6 @@
     }
 
     # Fix the .pc and .prl files by removing ${destroot}
-    foreach fixfile [glob -directory ${destroot}${qt_dir}/lib/pkgconfig *.pc] {
-        reinplace \
-            "s|[regsub ${prefix} ${worksrcpath} {}]/bin|[regsub ${prefix} ${qt_dir}/bin {}]|g" \
-            ${fixfile}
-    }
     foreach fixfile [glob -nocomplain -directory ${destroot} ${qt_dir}/lib/pkgconfig/*.pc ${qt_dir}/lib/*.prl ${qt_dir}/lib/*/*.prl ${prefix}/share/${dirname}/demos/shared/*.prl] {
         reinplace  \
             "s|-L${worksrcpath}/lib|-L${qt_dir}/lib|g" \
@@ -155,38 +214,13 @@
     xinstall -m 644 ${filespath}/${dirname} ${destroot}${prefix}/etc/select/qt4/
 }
 
-variant cocoa description {Build the Cocoa version of Qt} {
-    configure.args-append   -cocoa
-}
-
-variant nomysql description {Disable mysql} {
-    depends_lib-delete      path:lib/mysql5:mysql5
-    configure.args-delete   -isystem${prefix}/include/mysql5/mysql  \
-                            -L${prefix}/lib/mysql5/mysql
-}
-
-variant nopostgresql description {Disable postgresql support} {
-    depends_lib-delete      port:postgresql83
-    configure.args-delete   -isystem${prefix}/include/postgresql83  \
-                            -L${prefix}/lib/postgresql83
-}
-
-variant noframework conflicts cocoa description {Do not build frameworks} {
-    configure.args-delete   -framework
-    configure.args-append   -no-framework
-}
-
 variant raster description {Use raster graphics system by default} {
     configure.args-append   -graphicssystem  raster
 }
 
-variant webkit description {Use WebKit as html rendering engine in Assistant} {
-    configure.args-append   -assistant-webkit
-}
-
 variant universal {
     configure.universal_args-delete --disable-dependency-tracking
-    configure.args-append           -universal
+    configure.args-append -arch \"${universal_archs}\"
 }
 
 livecheck.check     regex

Deleted: trunk/dports/aqua/qt4-mac-devel/files/patch-compile.test.diff
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/files/patch-compile.test.diff	2009-03-15 16:55:49 UTC (rev 48159)
+++ trunk/dports/aqua/qt4-mac-devel/files/patch-compile.test.diff	2009-03-15 18:37:18 UTC (rev 48160)
@@ -1,13 +0,0 @@
---- config.tests/unix/compile.test.orig	2008-09-27 04:58:41.000000000 -0400
-+++ config.tests/unix/compile.test	2008-10-27 00:46:48.000000000 -0400
-@@ -32,6 +32,10 @@
-         INC=`echo $PARAM | sed -e 's/^-I//'`
-         INCLUDEPATH="$INCLUDEPATH $INC"
-         ;;
-+    -isystem*)
-+        INC=`echo $PARAM | sed -e 's/^-isystem//'`
-+        INCLUDEPATH="$INCLUDEPATH $INC"
-+        ;;
-     -f*|-D*)
-         CXXFLAGS="$CXXFLAGS $PARAM"
-         ;;

Deleted: trunk/dports/aqua/qt4-mac-devel/files/patch-configure.diff
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/files/patch-configure.diff	2009-03-15 16:55:49 UTC (rev 48159)
+++ trunk/dports/aqua/qt4-mac-devel/files/patch-configure.diff	2009-03-15 18:37:18 UTC (rev 48160)
@@ -1,28 +0,0 @@
---- configure.orig	2009-03-03 18:48:59.000000000 -0500
-+++ configure	2009-03-03 18:50:00.000000000 -0500
-@@ -802,6 +802,15 @@
-             VAL=`echo $1 | sed 's,-I,,'`
-         fi
-         ;;
-+    -isystem?*|-isystem)
-+        VAR="add_ipath_system"
-+        if [ "$1" = "-isystem" ]; then
-+            shift
-+            VAL="$1"
-+        else
-+            VAL=`echo $1 | sed 's,-isystem,,'`
-+        fi
-+        ;;
-     -L?*|-L)
-         VAR="add_lpath"
-         if [ "$1" = "-L" ]; then
-@@ -1700,6 +1709,9 @@
-     add_ipath)
-         I_FLAGS="$I_FLAGS -I\"${VAL}\""
-         ;;
-+    add_ipath_system)
-+        I_FLAGS="$I_FLAGS -isystem\"${VAL}\""
-+        ;;
-     add_lpath)
-         L_FLAGS="$L_FLAGS -L\"${VAL}\""
-         ;;

Added: trunk/dports/aqua/qt4-mac-devel/files/patch-isystem.diff
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/files/patch-isystem.diff	                        (rev 0)
+++ trunk/dports/aqua/qt4-mac-devel/files/patch-isystem.diff	2009-03-15 18:37:18 UTC (rev 48160)
@@ -0,0 +1,41 @@
+--- configure.orig	2009-02-25 16:09:14.000000000 -0500
++++ configure	2009-03-07 20:07:15.000000000 -0500
+@@ -854,6 +854,15 @@
+             VAL=`echo $1 | sed 's,-I,,'`
+         fi
+         ;;
++    -isystem?*|-isystem)
++        VAR="add_ipath_system"
++        if [ "$1" = "-isystem" ]; then
++            shift
++            VAL="$1"
++        else
++            VAL=`echo $1 | sed 's,-isystem,,'`
++        fi
++        ;;
+     -L?*|-L)
+         VAR="add_lpath"
+         if [ "$1" = "-L" ]; then
+@@ -1805,6 +1814,9 @@
+     add_ipath)
+         I_FLAGS="$I_FLAGS -I\"${VAL}\""
+         ;;
++    add_ipath_system)
++        I_FLAGS="$I_FLAGS -isystem\"${VAL}\""
++        ;;
+     add_lpath)
+         L_FLAGS="$L_FLAGS -L\"${VAL}\""
+         ;;
+--- config.tests/unix/compile.test.orig	2008-09-27 04:58:41.000000000 -0400
++++ config.tests/unix/compile.test	2008-10-27 00:46:48.000000000 -0400
+@@ -32,6 +32,10 @@
+         INC=`echo $PARAM | sed -e 's/^-I//'`
+         INCLUDEPATH="$INCLUDEPATH $INC"
+         ;;
++    -isystem*)
++        INC=`echo $PARAM | sed -e 's/^-isystem//'`
++        INCLUDEPATH="$INCLUDEPATH $INC"
++        ;;
+     -f*|-D*)
+         CXXFLAGS="$CXXFLAGS $PARAM"
+         ;;

Added: trunk/dports/aqua/qt4-mac-devel/files/patch-network.pro.diff
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/files/patch-network.pro.diff	                        (rev 0)
+++ trunk/dports/aqua/qt4-mac-devel/files/patch-network.pro.diff	2009-03-15 18:37:18 UTC (rev 48160)
@@ -0,0 +1,11 @@
+--- examples/network/network.pro.orig	2009-02-25 16:09:16.000000000 -0500
++++ examples/network/network.pro	2009-03-11 14:06:26.000000000 -0400
+@@ -13,7 +13,7 @@
+                 threadedfortuneserver \
+  		torrent
+ 
+-contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
++contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked):SUBDIRS += securesocketclient
+ 
+ # install
+ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS network.pro README

Added: trunk/dports/aqua/qt4-mac-devel/files/patch-odbc.diff
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/files/patch-odbc.diff	                        (rev 0)
+++ trunk/dports/aqua/qt4-mac-devel/files/patch-odbc.diff	2009-03-15 18:37:18 UTC (rev 48160)
@@ -0,0 +1,27 @@
+--- src/sql/drivers/odbc/qsql_odbc.h.orig	2009-02-25 16:09:26.000000000 -0500
++++ src/sql/drivers/odbc/qsql_odbc.h	2009-03-11 13:56:31.000000000 -0400
+@@ -49,13 +49,6 @@
+ #include <QtCore/qt_windows.h>
+ #endif
+ 
+-#if defined (Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3)
+-// assume we use iodbc on MACX
+-// comment next line out if you use a
+-// unicode compatible manager
+-# define Q_ODBC_VERSION_2
+-#endif
+-
+ #ifdef QT_PLUGIN
+ #define Q_EXPORT_SQLDRIVER_ODBC
+ #else
+--- src/plugins/sqldrivers/odbc/odbc.pro.orig	2009-02-25 16:09:25.000000000 -0500
++++ src/plugins/sqldrivers/odbc/odbc.pro	2009-03-11 13:58:02.000000000 -0400
+@@ -6,7 +6,7 @@
+ 
+ mac {
+         !contains( LIBS, .*odbc.* ) {
+-            LIBS        *= -liodbc
++            LIBS        *= -lodbc
+         }
+ }
+ 

Added: trunk/dports/aqua/qt4-mac-devel/files/patch-precomp.test.diff
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/files/patch-precomp.test.diff	                        (rev 0)
+++ trunk/dports/aqua/qt4-mac-devel/files/patch-precomp.test.diff	2009-03-15 18:37:18 UTC (rev 48160)
@@ -0,0 +1,11 @@
+--- config.tests/unix/precomp.test.orig	2009-02-25 16:09:14.000000000 -0500
++++ config.tests/unix/precomp.test	2009-03-10 16:49:45.000000000 -0400
+@@ -27,7 +27,7 @@
+     rm -f header.pchi header.o source.o
+     ;;
+ 
+-*g++*|c++)
++*g++*|c++|*gcc*|cc)
+     case `"$COMPILER" -dumpversion 2>/dev/null` in
+     3.*)
+         ;;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090315/7f9779ea/attachment.html>


More information about the macports-changes mailing list