[69658] trunk/dports/science/root

michaelld at macports.org michaelld at macports.org
Mon Jul 12 10:57:31 PDT 2010


Revision: 69658
          http://trac.macports.org/changeset/69658
Author:   michaelld at macports.org
Date:     2010-07-12 10:57:28 -0700 (Mon, 12 Jul 2010)
Log Message:
-----------
Better solution for patching 'configure' and 'config/Makefile.config'
to find Qt includes and libraries, and to properly include them when
compiling and linking.  Addresses ticket #25612.

Modified Paths:
--------------
    trunk/dports/science/root/Portfile

Removed Paths:
-------------
    trunk/dports/science/root/files/

Modified: trunk/dports/science/root/Portfile
===================================================================
--- trunk/dports/science/root/Portfile	2010-07-12 17:38:17 UTC (rev 69657)
+++ trunk/dports/science/root/Portfile	2010-07-12 17:57:28 UTC (rev 69658)
@@ -5,7 +5,7 @@
 
 name                root
 version             5.26.00b
-revision            4
+revision            5
 categories          science
 maintainers         gmail.com:mattiafrancescomoro
 license             LGPLv2.1
@@ -29,9 +29,6 @@
                     port:xpm \
                     port:zlib
 
-# patches to allow 'configure' to find Qt framework libraries and 'moc'
-patchfiles          patch-configure.diff
-
 pre-configure {
     build.args      CC=${configure.cc} \
                     CXX=${configure.cxx} \
@@ -52,13 +49,12 @@
 }
 
 configure.args      --with-cc=${configure.cc} \
-                    --with-f77="${configure.f77}" \
-                    --with-cxx="${configure.cxx}" \
-                    --etcdir="${prefix}/etc/root" \
-                    --docdir="${prefix}/share/doc/${name}-${version}"\
-                    --libdir="${prefix}/lib/root" \
-                    --testdir="${prefix}/share/root/test" \
-                    --tutdir="${prefix}/share/root/tutorials" \
+                    --with-f77=${configure.f77} \
+                    --with-cxx=${configure.cxx} \
+                    --docdir=${prefix}/share/doc/${name}-${version} \
+                    --libdir=${prefix}/lib/root \
+                    --testdir=${prefix}/share/root/test \
+                    --tutdir=${prefix}/share/root/tutorials \
                     --etcdir=${prefix}/etc/root \
                     --disable-builtin-afterimage \
                     --disable-builtin-freetype \
@@ -74,11 +70,12 @@
                     --disable-opengl \
                     --disable-pythia8 \
                     --disable-qt \
+                    --disable-qtgsi \
                     --disable-roofit \
                     --disable-ssl \
                     --disable-xml \
-                    --with-x11-libdir="${prefix}/lib" \
-                    --with-xpm-libdir="${prefix}/lib"
+                    --with-x11-libdir=${prefix}/lib \
+                    --with-xpm-libdir=${prefix}/lib
 
 universal_variant   no
 
@@ -165,28 +162,47 @@
 }
 
 variant qt_x11 conflicts qt_mac description {Builds port with Qt support via X11 UI} {
+    # fix where "qglobal.h" is found in all files that use or reference it
+    post-patch {
+        foreach tpf { configure graf2d/qt/src/TGQt.cxx } {
+            reinplace "s at Qt/qglobal\\.h at QtCore/qglobal\\.h at g" \
+                ${worksrcpath}/${tpf}
+        }
+        reinplace "/qttestdir/s at Qt@QtCore at g" ${worksrcpath}/configure
+    }
+
+    configure.env-append    QTDIR=${prefix}/libexec/qt4-x11
     configure.args-delete   --disable-qt
-    configure.args-append   --enable-qt \
-                            --with-qt-incdir="${prefix}/libexec/qt4-x11/include/" \
-                            --with-qt-libdir="${prefix}/libexec/qt4-x11/lib" \
-			    --with-mocdir="${prefix}/bin"
+    configure.args-append   --enable-qt
     depends_lib-append      port:qt4-x11
 }
 
 variant qt_mac conflicts qt_x11 description {Builds port with Qt support via Mac UI} {
+    post-patch {
+        # fix where "qglobal.h" is found in all files that use or reference it
+        foreach tpf { configure graf2d/qt/src/TGQt.cxx } {
+            reinplace "s at Qt/qglobal\\.h at QtCore/qglobal\\.h at g" \
+                ${worksrcpath}/${tpf}
+        }
+        reinplace "/qttestdir/s at Qt@QtCore at g" ${worksrcpath}/configure
+
+        # fix library search extensions to include ".la"
+        # for Qt framework libraries (only)
+        reinplace "s@\\(\\.so \\.sl \\.dylib \\.dll\\.a\\)@\\1 \\.la at g" \
+            ${worksrcpath}/configure
+    }
+
+    configure.env-append    QTDIR=${prefix}/libexec/qt4-mac
     configure.args-delete   --disable-qt
-    configure.args-append   --enable-qt \
-                            --with-qt-incdir="${prefix}/libexec/qt4-mac/include/" \
-                            --with-qt-libdir="${prefix}/libexec/qt4-mac/lib" \
-			    --with-mocdir="${prefix}/bin"
+    configure.args-append   --enable-qt
     depends_lib-append      port:qt4-mac
 
     post-configure {
         # patch up the Makefile.config to handle the QTLIB frameworks correctly
-        # first, patch using @PREFIX@
-        system "cd ${worksrcpath} && patch -p0 < ${filespath}/patch-config-Makefile.config.diff"
-        # then replace @PREFIX@ with ${prefix}
-        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/config/Makefile.config
+        reinplace "/QTLIB\[ \]/s@:= @:= -F${prefix}/libexec/qt4-mac/lib @" \
+            ${worksrcpath}/config/Makefile.config
+        reinplace "/QTLIB\[ \]/s@\\(Qt\[^ \]*\\).la at -framework \\1 at g" \
+            ${worksrcpath}/config/Makefile.config
     }
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100712/24156a70/attachment-0001.html>


More information about the macports-changes mailing list