[44203] trunk/dports/aqua/qt4-mac/Portfile

mcalhoun at macports.org mcalhoun at macports.org
Tue Dec 23 12:38:38 PST 2008


Revision: 44203
          http://trac.macports.org/changeset/44203
Author:   mcalhoun at macports.org
Date:     2008-12-23 12:38:38 -0800 (Tue, 23 Dec 2008)
Log Message:
-----------
qt4-mac: Keep all of qt4-mac in one directory and create links when needed.
Some packages expect Qt to be completely located in QTDIR (see #17645).
This also allows qt4-mac and qt4-x11 to coexist (see #15585).
Append -mac to binaries to avoid conflict with qt4-x11.
Fixes #15585 and #16526.
Partial fix of #17645.

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

Modified: trunk/dports/aqua/qt4-mac/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac/Portfile	2008-12-23 20:23:41 UTC (rev 44202)
+++ trunk/dports/aqua/qt4-mac/Portfile	2008-12-23 20:38:38 UTC (rev 44203)
@@ -51,11 +51,7 @@
 configure.cmd \
     /usr/bin/sed -ibak -e \"s| gcc\\\$| \${CC}|g\" -e \"s| g++\\\$| \${CXX}|g\" ${worksrcpath}/mkspecs/common/mac-g++.conf && ${configure.cmd}
 
-# directory for .app and executable files
-# Once installed, they should not be moved so they can find each other
-# (e.g. assistant.app) and the examples directory
-set bindir ${prefix}/libexec/${name}/bin
-set frameworkdir ${prefix}/Library/Frameworks
+set qt_dir ${prefix}/libexec/${name}
 
 # Can be removed once MacPorts 1.7.0 is released
 if {![info exists applications_dir]} {
@@ -77,18 +73,12 @@
 configure.args \
     -v         \
     -confirm-license \
-    -prefix         '${prefix}'                            \
-    -bindir         '${bindir}'                            \
-    -docdir         '${prefix}/share/doc/${portname}'      \
-    -datadir        '${prefix}/share/${portname}'          \
-    -headerdir      '${prefix}/include/${portname}'        \
-    -plugindir      '${prefix}/lib/${portname}-plugins'    \
-    -translationdir '${prefix}/share/${portname}/translations' \
+    -framework                                                 \
+    -prefix          ${qt_dir}                                 \
     -optimized-qmake    -debug-and-release        -shared         -stl      \
     -largefile                                          \
     -system-libpng      -system-libjpeg -system-libmng  -system-libtiff     \
     -system-zlib        -qt-gif                                             \
-    -framework          -libdir '${frameworkdir}'                           \
     -make libs          -make tools                                         \
     -docdir          ${prefix}/share/doc/${name}               \
     -examplesdir     ${prefix}/share/${name}/examples          \
@@ -122,36 +112,49 @@
 }
 
 post-destroot {
-    xinstall -d -m 0755 ${destroot}${bindir}
-    xinstall -d -m 0755 ${destroot}${applications_dir}/Qt
-    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${portname}
+    # install documentation
+    foreach doc {INSTALL LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT README \
+                 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT} {
+        xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${portname}
+    }
 
-    # create link in ${prefix}/bin to executable files in ${bindir}
-    foreach bin [glob -type f -directory ${destroot}${bindir} *] {
-        system "ln -s ${bindir}/[file tail ${bin}] ${destroot}${prefix}/bin"
+    # create link in ${prefix}/bin to executable files in ${qt_dir}/bin
+    foreach bin [glob -type f -directory ${destroot}${qt_dir}/bin *] {
+        ln -s ${qt_dir}/bin/[file tail ${bin}] ${destroot}${prefix}/bin
     }
 
-    # create link in ${applications_dir}/Qt to .app directories in ${bindir}
+    xinstall -d -m 0755 ${destroot}${applications_dir}/Qt
+    # create link in ${applications_dir}/Qt to .app directories in ${qt_dir}/bin/
     # create link in ${prefix}/bin to all *.app/Contents/MacOS/*
-    foreach app [glob -type d -directory ${destroot}${bindir} *.app] {
-        system "ln -s ${bindir}/[file tail ${app}] ${destroot}${applications_dir}/Qt"
-        foreach bin [glob -type f -directory ${app} Contents/MacOS/*] {
-            system "ln -s ${bindir}/[file tail ${app}]/Contents/MacOS/[file tail ${bin}] ${destroot}${prefix}/bin"
+    foreach app [glob -type d -directory ${destroot}${qt_dir}/bin *.app] {
+        ln -s ${qt_dir}/bin/[file tail ${app}] ${destroot}${applications_dir}/Qt
+        foreach bin [glob -tails -type f -directory ${app}/Contents/MacOS *] {
+            ln -s ${qt_dir}/bin/[file tail ${app}]/Contents/MacOS/${bin} ${destroot}${prefix}/bin
         }
     }
 
-    # Put pkgconfig directory in correct place (Fix Ticket #15353)
-    system "mv ${destroot}${frameworkdir}/pkgconfig ${destroot}/${prefix}/lib/"
+    # avoid conflict with other qt packages
+    # ensure lower case names
+    foreach bin [glob ${destroot}${prefix}/bin/*] {
+        file rename ${bin} [string tolower ${bin}]-mac
+    }
 
-    # install documentation
-    foreach doc {INSTALL LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT README \
-                 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT} {
-        xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${portname}
+    # Create link to Frameworks in Frameworks directory
+    xinstall -d -m 0755 ${destroot}${frameworks_dir}
+    foreach fdir [glob -tails -directory ${destroot}${qt_dir}/lib -nocomplain *.framework] {
+        ln -s ${qt_dir}/lib/${fdir} ${destroot}${frameworks_dir}
     }
+
+    # The debug .pc files have no counterpart in qt4-x11, so set a link to them in the pkgconfig directory
+    xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
+    foreach fl [glob -tails -directory ${destroot}${qt_dir}/lib/pkgconfig *_debug.pc] {
+        ln -s ${qt_dir}/lib/pkgconfig/${fl} ${destroot}${prefix}/lib/pkgconfig/
+    }
+
 }
 
 variant noframework description "Do not build frameworks" {
-    configure.args-delete   -framework -libdir '${frameworkdir}'
+    configure.args-delete   -framework
     configure.args-append   -no-framework
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081223/9351553f/attachment.html>


More information about the macports-changes mailing list