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

michaelld at macports.org michaelld at macports.org
Wed Jul 1 12:19:15 PDT 2015


Revision: 138189
          https://trac.macports.org/changeset/138189
Author:   michaelld at macports.org
Date:     2015-07-01 12:19:15 -0700 (Wed, 01 Jul 2015)
Log Message:
-----------
qt4-mac: fix post-destroot to use shortcuts and always create directories before they are used.

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

Modified: trunk/dports/aqua/qt4-mac/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac/Portfile	2015-07-01 18:55:40 UTC (rev 138188)
+++ trunk/dports/aqua/qt4-mac/Portfile	2015-07-01 19:19:15 UTC (rev 138189)
@@ -624,24 +624,41 @@
 
 post-destroot {
 
-    set destroot_qt ${destroot}${qt_dir}
+    # shortcuts to destroot directories
 
+    set dr_qt ${destroot}${qt_dir}
+    set dr_qt_libs_dir ${destroot}${qt_libs_dir}
+    set dr_qt_includes_dir ${destroot}${qt_includes_dir}
+    set dr_qt_data_dir ${destroot}${qt_data_dir}
+    set dr_qt_docs_dir ${destroot}${qt_docs_dir}
+    set dr_qt_apps_dir ${destroot}${qt_apps_dir}
+    set dr_qt_bins_dir ${destroot}${qt_bins_dir}
+    set dr_qt_frameworks_dir ${destroot}${qt_frameworks_dir}
+
+    # create all needed destroot directories that don't already exist
+
+    xinstall -m 755 -d ${dr_qt_libs_dir}
+    xinstall -m 755 -d ${dr_qt_includes_dir}
+    xinstall -m 755 -d ${dr_qt_data_dir}
+    xinstall -m 755 -d ${dr_qt_docs_dir}
+    xinstall -m 755 -d ${dr_qt_apps_dir}
+
     # Fix .pc and .prl files by changing ${worksrcpath}\${prefix} to
     # ${qt_dir}\${prefix} ("\" means 'take away').  Cannot use
     # "find -E" since it is not necessarily portable.
 
     regsub ${prefix} ${worksrcpath} "" from_dir
     regsub ${prefix} ${qt_dir} "" to_dir
-    foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
+    foreach fixfile [exec find ${dr_qt} -name "*.pc"] {
         reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
     }
-    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
+    foreach fixfile [exec find ${dr_qt} -name "*.prl"] {
         reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
     }
 
     # fix .pc files
 
-    foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
+    foreach fixfile [exec find ${dr_qt} -name "*.pc"] {
 
         # remove Libs.private; they can mess up linking
 
@@ -682,35 +699,33 @@
     # ${qt_pkg_config_dir}
 
     file delete -force ${destroot}${qt_pkg_config_dir}
-    xinstall -m 755 -d ${destroot}${qt_libs_dir}
-    move ${destroot}${qt_frameworks_dir}/pkgconfig \
-        ${destroot}${qt_libs_dir}
+    move ${dr_qt_frameworks_dir}/pkgconfig ${dr_qt_libs_dir}
 
     # move .la files from ${qt_frameworks_dir} to ${qt_libs_dir}
 
-    foreach laf [glob ${destroot}/${qt_frameworks_dir}/*.la] {
-        move ${laf} ${destroot}${qt_libs_dir}
+    foreach laf [glob ${dr_qt_frameworks_dir}/*.la] {
+        move ${laf} ${dr_qt_libs_dir}
     }
 
     # remove -L entries from .prl and .la files
 
-    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
+    foreach fixfile [exec find ${dr_qt} -name "*.prl"] {
         reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile}
     }
-    foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
+    foreach fixfile [exec find ${dr_qt} -name "*.la"] {
         reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile}
     }
 
     # remove redundant -F entries from .prl and .la files
 
-    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
+    foreach fixfile [exec find ${dr_qt} -name "*.prl"] {
         reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \
             ${fixfile}
         reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*||g" ${fixfile}
         reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
             ${fixfile}
     }
-    foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
+    foreach fixfile [exec find ${dr_qt} -name "*.la"] {
         reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \
             ${fixfile}
         reinplace "/dependency_libs/s|-F\[^ \]*||g" ${fixfile}
@@ -727,7 +742,7 @@
 
     # link includes and libraries for each actual installed framework
 
-    foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
+    foreach fixfile [exec find ${dr_qt_frameworks_dir} \
                          -name "*.framework" | \
                          sed -e "s@${destroot}@@g"] {
 
@@ -746,7 +761,7 @@
         # link headers into ${qt_includes_dir}, removing directories
         # if they are already there first
 
-        set inc_file ${destroot}${qt_includes_dir}/${tf}
+        set inc_file ${dr_qt_includes_dir}/${tf}
         if {[file exists ${inc_file}]} {
             file delete -force ${inc_file}
         }
@@ -754,8 +769,6 @@
 
         # link libraries into ${qt_libs_dir}, all 4 number variants
 
-        set dr_qt_libs_dir ${destroot}${qt_libs_dir}
-
         ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib
         ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.dylib
         ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.dylib
@@ -892,17 +905,16 @@
 
     # Install documentation.
 
-    xinstall -m 755 -d ${destroot}${qt_docs_dir}
     xinstall -m 644 -W ${worksrcpath} \
         INSTALL LGPL_EXCEPTION.txt LICENSE.FDL \
         LICENSE.GPL3 LICENSE.LGPL README \
-        ${destroot}${qt_docs_dir}
+        ${dr_qt_docs_dir}
 
     # Install private headers needed by QtCreator
 
     foreach {src_dir include_dir} \
     {corelib QtCore gui QtGui script QtScript declarative QtDeclarative} {
-        set dest_dir ${destroot}${qt_frameworks_dir}/${include_dir}.framework/Headers/private
+        set dest_dir ${dr_qt_frameworks_dir}/${include_dir}.framework/Headers/private
         xinstall -m 755 -d ${dest_dir}
         set files [exec find ${worksrcpath}/src/${src_dir} -type f -name "*_p.h"]
         eval xinstall -m 644 [split ${files}] ${dest_dir}
@@ -911,10 +923,6 @@
     # Move .apps into the applications_dir, and link each .apps'
     # executable back into ${qt_bins_dir}
 
-    set dr_qt_apps_dir ${destroot}${qt_apps_dir}
-    set dr_qt_bins_dir ${destroot}${qt_bins_dir}
-
-    xinstall -m 755 -d ${dr_qt_apps_dir}
     foreach app [glob ${dr_qt_bins_dir}/*.app] {
 
         # remove the leading stuff
@@ -935,25 +943,24 @@
 
     # move tests to ${qt_data_dir}
 
-    xinstall -m 755 -d ${destroot}${qt_data_dir}
-    move ${destroot_qt}/tests/qt4 ${destroot}${qt_data_dir}/tests
+    move ${dr_qt}/tests/qt4 ${dr_qt_data_dir}/tests
 
     # install ${qt_includes_dir}/Qt if not already and it exists in
     # the build, for support of legacy projects
 
-    if {![file exists ${destroot}${qt_includes_dir}/Qt] &&
+    if {![file exists ${dr_qt_includes_dir}/Qt] &&
         [file exists ${worksrcpath}/include/Qt]} {
 
         # copy the Qt headers directory
 
-        copy ${worksrcpath}/include/Qt ${destroot}${qt_includes_dir}
+        copy ${worksrcpath}/include/Qt ${dr_qt_includes_dir}
 
     }
 
     # link in Resource to ${qt_libs_dir}
 
     ln -s ${qt_frameworks_dir}/QtGui.framework/Resources \
-        ${destroot}${qt_libs_dir}
+        ${dr_qt_libs_dir}
 
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150701/8aad81cc/attachment.html>


More information about the macports-changes mailing list