[70434] trunk/dports/aqua/qt4-mac-devel/Portfile

michaelld at macports.org michaelld at macports.org
Mon Aug 9 10:30:03 PDT 2010


Revision: 70434
          http://trac.macports.org/changeset/70434
Author:   michaelld at macports.org
Date:     2010-08-09 10:30:02 -0700 (Mon, 09 Aug 2010)
Log Message:
-----------
Revision bump for changes to take effect.
Implemented better ways to find files for reinplace.
Fix issue where .../share/qt4-mac-devel was removed in destroot.

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

Modified: trunk/dports/aqua/qt4-mac-devel/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac-devel/Portfile	2010-08-09 17:29:03 UTC (rev 70433)
+++ trunk/dports/aqua/qt4-mac-devel/Portfile	2010-08-09 17:30:02 UTC (rev 70434)
@@ -11,6 +11,7 @@
 
 name                ${select_name}
 version             4.7.0-beta2
+revision            1
 categories          aqua
 platforms           macosx
 maintainers         michaelld
@@ -110,6 +111,7 @@
     -nomake demos                                         \
     -nomake examples                                      \
     -optimized-qmake                                      \
+    -framework                                            \
     -arch            \"${build_arch}\"
 
 # Stop configure script from searching for SQL Drivers
@@ -193,11 +195,18 @@
    configure.args-delete -nomake examples
 }
 
-variant debug description {Build debugging libraries and pkgconfig files as well as release versions} {
+variant debug description \
+{Build both release and debug library} {
     configure.args-delete -release
     configure.args-append -debug-and-release
 }
 
+variant no_framework description \
+{Build as libraries, not as framework} {
+    configure.args-delete -framework
+    configure.args-append -no-framework
+}
+
 variant universal {
     configure.universal_args-delete --disable-dependency-tracking
     configure.args-delete -arch \"${build_arch}\"
@@ -270,7 +279,8 @@
     set destroot_qt ${destroot}${qt_dir}
 
     # Fix .pc and .prl files by changing ${worksrcpath}/lib to ${qt_dir}/lib
-    foreach fixfile [glob -nocomplain -directory ${destroot} ${qt_dir}/lib/pkgconfig/* ${qt_dir}/lib/*.prl ${qt_dir}/lib/*/*.prl ${qt_dir}/share/${dirname}/demos/shared/*.prl] {
+    foreach fixfile [exec find -E ${destroot_qt} \
+                         -regex "\[^ \]*\\.\(pc|prl\)"] {
         reinplace "s|${worksrcpath}/lib|${qt_dir}/lib|g" ${fixfile}
     }
 
@@ -287,22 +297,22 @@
         delete ${destroot_qt}/include/Qt
     }
 
-    # (2) remove from ${qt_dir}/include/FOO, for each FOO in the
-    # frameworks, and link into the headers provided by the FOO framework
-    foreach fms [glob -nocomplain -directory ${destroot} \
-                     ${qt_dir}/lib/*.framework] {
-        # 0: split the framework abs path using '/'
-        set tmp [split ${fms} /]
-        # 1: retrieve the framework name
-        set tfm [lindex [split [lindex ${tmp} [expr [llength ${tmp}] - 1]] .] 0]
-        # 2: remove the include directory, if it exists
-        if {[file exists ${destroot_qt}/include/${tfm}] } {
-            # if it exists
-            delete ${destroot_qt}/include/${tfm}
+    # (2) If using the framework install: remove from
+    # ${qt_dir}/include/FOO, for each FOO in the frameworks, and link
+    # into the headers provided by the FOO framework
+    if {![variant_isset no_framework]} {
+        foreach tfm [exec find ${destroot}${qt_dir}/lib -name "*.framework" \
+                         -type d -depth 1 | sed -e "s@\.framework@@g" \
+                         -e "s@${destroot}${qt_dir}/lib/@@g"] {
+            # remove the include directory, if it exists
+            if {[file exists ${destroot_qt}/include/${tfm}] } {
+                # if it exists
+                delete ${destroot_qt}/include/${tfm}
+            }
+            # link into the framework's Headers
+            ln -s ${qt_dir}/lib/${tfm}.framework/Headers \
+                ${destroot_qt}/include/${tfm}
         }
-        # 3: link into the framework's Headers
-        ln -s ${qt_dir}/lib/${tfm}.framework/Headers \
-            ${destroot_qt}/include/${tfm}
     }
 
     # install the select file
@@ -326,9 +336,9 @@
 
         # special case: if no examples and no demos,
         if {![variant_isset examples]} {
-            # remove select entry for share/qt4-mac
-            reinplace "/share\\/qt4-mac/ c\\\n-\n" \
-                ${destroot}${prefix}/etc/select/${select_group}/${select_name}
+            # the directory "share/${name}" will be empty.  keep it
+            # around since other ports might install into it.
+            destroot.keepdirs ${destroot}${destroot_qt}/share/${name}
         }
     }
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100809/d69479de/attachment.html>


More information about the macports-changes mailing list