<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[138189] trunk/dports/aqua/qt4-mac/Portfile</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/138189">138189</a></dd>
<dt>Author</dt> <dd>michaelld@macports.org</dd>
<dt>Date</dt> <dd>2015-07-01 12:19:15 -0700 (Wed, 01 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>qt4-mac: fix post-destroot to use shortcuts and always create directories before they are used.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsaquaqt4macPortfile">trunk/dports/aqua/qt4-mac/Portfile</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsaquaqt4macPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/aqua/qt4-mac/Portfile (138188 => 138189)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -624,24 +624,41 @@
</span><span class="cx"> 
</span><span class="cx"> post-destroot {
</span><span class="cx"> 
</span><del>-    set destroot_qt ${destroot}${qt_dir}
</del><ins>+    # shortcuts to destroot directories
</ins><span class="cx"> 
</span><ins>+    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}
+
</ins><span class="cx">     # Fix .pc and .prl files by changing ${worksrcpath}\${prefix} to
</span><span class="cx">     # ${qt_dir}\${prefix} (&quot;\&quot; means 'take away').  Cannot use
</span><span class="cx">     # &quot;find -E&quot; since it is not necessarily portable.
</span><span class="cx"> 
</span><span class="cx">     regsub ${prefix} ${worksrcpath} &quot;&quot; from_dir
</span><span class="cx">     regsub ${prefix} ${qt_dir} &quot;&quot; to_dir
</span><del>-    foreach fixfile [exec find ${destroot_qt} -name &quot;*.pc&quot;] {
</del><ins>+    foreach fixfile [exec find ${dr_qt} -name &quot;*.pc&quot;] {
</ins><span class="cx">         reinplace &quot;s|${from_dir}|${to_dir}|g&quot; ${fixfile}
</span><span class="cx">     }
</span><del>-    foreach fixfile [exec find ${destroot_qt} -name &quot;*.prl&quot;] {
</del><ins>+    foreach fixfile [exec find ${dr_qt} -name &quot;*.prl&quot;] {
</ins><span class="cx">         reinplace &quot;s|${from_dir}|${to_dir}|g&quot; ${fixfile}
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # fix .pc files
</span><span class="cx"> 
</span><del>-    foreach fixfile [exec find ${destroot_qt} -name &quot;*.pc&quot;] {
</del><ins>+    foreach fixfile [exec find ${dr_qt} -name &quot;*.pc&quot;] {
</ins><span class="cx"> 
</span><span class="cx">         # remove Libs.private; they can mess up linking
</span><span class="cx"> 
</span><span class="lines">@@ -682,35 +699,33 @@
</span><span class="cx">     # ${qt_pkg_config_dir}
</span><span class="cx"> 
</span><span class="cx">     file delete -force ${destroot}${qt_pkg_config_dir}
</span><del>-    xinstall -m 755 -d ${destroot}${qt_libs_dir}
-    move ${destroot}${qt_frameworks_dir}/pkgconfig \
-        ${destroot}${qt_libs_dir}
</del><ins>+    move ${dr_qt_frameworks_dir}/pkgconfig ${dr_qt_libs_dir}
</ins><span class="cx"> 
</span><span class="cx">     # move .la files from ${qt_frameworks_dir} to ${qt_libs_dir}
</span><span class="cx"> 
</span><del>-    foreach laf [glob ${destroot}/${qt_frameworks_dir}/*.la] {
-        move ${laf} ${destroot}${qt_libs_dir}
</del><ins>+    foreach laf [glob ${dr_qt_frameworks_dir}/*.la] {
+        move ${laf} ${dr_qt_libs_dir}
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # remove -L entries from .prl and .la files
</span><span class="cx"> 
</span><del>-    foreach fixfile [exec find ${destroot_qt} -name &quot;*.prl&quot;] {
</del><ins>+    foreach fixfile [exec find ${dr_qt} -name &quot;*.prl&quot;] {
</ins><span class="cx">         reinplace &quot;/QMAKE_PRL_LIBS/s|-L\[^ \]*||g&quot; ${fixfile}
</span><span class="cx">     }
</span><del>-    foreach fixfile [exec find ${destroot_qt} -name &quot;*.la&quot;] {
</del><ins>+    foreach fixfile [exec find ${dr_qt} -name &quot;*.la&quot;] {
</ins><span class="cx">         reinplace &quot;/dependency_libs/s|-L\[^ \]*||g&quot; ${fixfile}
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # remove redundant -F entries from .prl and .la files
</span><span class="cx"> 
</span><del>-    foreach fixfile [exec find ${destroot_qt} -name &quot;*.prl&quot;] {
</del><ins>+    foreach fixfile [exec find ${dr_qt} -name &quot;*.prl&quot;] {
</ins><span class="cx">         reinplace &quot;/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1&quot; \
</span><span class="cx">             ${fixfile}
</span><span class="cx">         reinplace &quot;/QMAKE_PRL_LIBS/s|-F\[^ \]*||g&quot; ${fixfile}
</span><span class="cx">         reinplace &quot;s|FREPLACEME|-F${prefix}/Library/Frameworks|1&quot; \
</span><span class="cx">             ${fixfile}
</span><span class="cx">     }
</span><del>-    foreach fixfile [exec find ${destroot_qt} -name &quot;*.la&quot;] {
</del><ins>+    foreach fixfile [exec find ${dr_qt} -name &quot;*.la&quot;] {
</ins><span class="cx">         reinplace &quot;/dependency_libs/s|-F\[^ \]*|FREPLACEME|1&quot; \
</span><span class="cx">             ${fixfile}
</span><span class="cx">         reinplace &quot;/dependency_libs/s|-F\[^ \]*||g&quot; ${fixfile}
</span><span class="lines">@@ -727,7 +742,7 @@
</span><span class="cx"> 
</span><span class="cx">     # link includes and libraries for each actual installed framework
</span><span class="cx"> 
</span><del>-    foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
</del><ins>+    foreach fixfile [exec find ${dr_qt_frameworks_dir} \
</ins><span class="cx">                          -name &quot;*.framework&quot; | \
</span><span class="cx">                          sed -e &quot;s@${destroot}@@g&quot;] {
</span><span class="cx"> 
</span><span class="lines">@@ -746,7 +761,7 @@
</span><span class="cx">         # link headers into ${qt_includes_dir}, removing directories
</span><span class="cx">         # if they are already there first
</span><span class="cx"> 
</span><del>-        set inc_file ${destroot}${qt_includes_dir}/${tf}
</del><ins>+        set inc_file ${dr_qt_includes_dir}/${tf}
</ins><span class="cx">         if {[file exists ${inc_file}]} {
</span><span class="cx">             file delete -force ${inc_file}
</span><span class="cx">         }
</span><span class="lines">@@ -754,8 +769,6 @@
</span><span class="cx"> 
</span><span class="cx">         # link libraries into ${qt_libs_dir}, all 4 number variants
</span><span class="cx"> 
</span><del>-        set dr_qt_libs_dir ${destroot}${qt_libs_dir}
-
</del><span class="cx">         ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib
</span><span class="cx">         ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.dylib
</span><span class="cx">         ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.dylib
</span><span class="lines">@@ -892,17 +905,16 @@
</span><span class="cx"> 
</span><span class="cx">     # Install documentation.
</span><span class="cx"> 
</span><del>-    xinstall -m 755 -d ${destroot}${qt_docs_dir}
</del><span class="cx">     xinstall -m 644 -W ${worksrcpath} \
</span><span class="cx">         INSTALL LGPL_EXCEPTION.txt LICENSE.FDL \
</span><span class="cx">         LICENSE.GPL3 LICENSE.LGPL README \
</span><del>-        ${destroot}${qt_docs_dir}
</del><ins>+        ${dr_qt_docs_dir}
</ins><span class="cx"> 
</span><span class="cx">     # Install private headers needed by QtCreator
</span><span class="cx"> 
</span><span class="cx">     foreach {src_dir include_dir} \
</span><span class="cx">     {corelib QtCore gui QtGui script QtScript declarative QtDeclarative} {
</span><del>-        set dest_dir ${destroot}${qt_frameworks_dir}/${include_dir}.framework/Headers/private
</del><ins>+        set dest_dir ${dr_qt_frameworks_dir}/${include_dir}.framework/Headers/private
</ins><span class="cx">         xinstall -m 755 -d ${dest_dir}
</span><span class="cx">         set files [exec find ${worksrcpath}/src/${src_dir} -type f -name &quot;*_p.h&quot;]
</span><span class="cx">         eval xinstall -m 644 [split ${files}] ${dest_dir}
</span><span class="lines">@@ -911,10 +923,6 @@
</span><span class="cx">     # Move .apps into the applications_dir, and link each .apps'
</span><span class="cx">     # executable back into ${qt_bins_dir}
</span><span class="cx"> 
</span><del>-    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}
</del><span class="cx">     foreach app [glob ${dr_qt_bins_dir}/*.app] {
</span><span class="cx"> 
</span><span class="cx">         # remove the leading stuff
</span><span class="lines">@@ -935,25 +943,24 @@
</span><span class="cx"> 
</span><span class="cx">     # move tests to ${qt_data_dir}
</span><span class="cx"> 
</span><del>-    xinstall -m 755 -d ${destroot}${qt_data_dir}
-    move ${destroot_qt}/tests/qt4 ${destroot}${qt_data_dir}/tests
</del><ins>+    move ${dr_qt}/tests/qt4 ${dr_qt_data_dir}/tests
</ins><span class="cx"> 
</span><span class="cx">     # install ${qt_includes_dir}/Qt if not already and it exists in
</span><span class="cx">     # the build, for support of legacy projects
</span><span class="cx"> 
</span><del>-    if {![file exists ${destroot}${qt_includes_dir}/Qt] &amp;&amp;
</del><ins>+    if {![file exists ${dr_qt_includes_dir}/Qt] &amp;&amp;
</ins><span class="cx">         [file exists ${worksrcpath}/include/Qt]} {
</span><span class="cx"> 
</span><span class="cx">         # copy the Qt headers directory
</span><span class="cx"> 
</span><del>-        copy ${worksrcpath}/include/Qt ${destroot}${qt_includes_dir}
</del><ins>+        copy ${worksrcpath}/include/Qt ${dr_qt_includes_dir}
</ins><span class="cx"> 
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # link in Resource to ${qt_libs_dir}
</span><span class="cx"> 
</span><span class="cx">     ln -s ${qt_frameworks_dir}/QtGui.framework/Resources \
</span><del>-        ${destroot}${qt_libs_dir}
</del><ins>+        ${dr_qt_libs_dir}
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>