Changeset 138189 for trunk/dports/aqua


Ignore:
Timestamp:
Jul 1, 2015, 7:19:15 PM (4 years ago)
Author:
michaelld@…
Message:

qt4-mac: fix post-destroot to use shortcuts and always create directories before they are used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/aqua/qt4-mac/Portfile

    r137008 r138189  
    625625post-destroot {
    626626
    627     set destroot_qt ${destroot}${qt_dir}
     627    # shortcuts to destroot directories
     628
     629    set dr_qt ${destroot}${qt_dir}
     630    set dr_qt_libs_dir ${destroot}${qt_libs_dir}
     631    set dr_qt_includes_dir ${destroot}${qt_includes_dir}
     632    set dr_qt_data_dir ${destroot}${qt_data_dir}
     633    set dr_qt_docs_dir ${destroot}${qt_docs_dir}
     634    set dr_qt_apps_dir ${destroot}${qt_apps_dir}
     635    set dr_qt_bins_dir ${destroot}${qt_bins_dir}
     636    set dr_qt_frameworks_dir ${destroot}${qt_frameworks_dir}
     637
     638    # create all needed destroot directories that don't already exist
     639
     640    xinstall -m 755 -d ${dr_qt_libs_dir}
     641    xinstall -m 755 -d ${dr_qt_includes_dir}
     642    xinstall -m 755 -d ${dr_qt_data_dir}
     643    xinstall -m 755 -d ${dr_qt_docs_dir}
     644    xinstall -m 755 -d ${dr_qt_apps_dir}
    628645
    629646    # Fix .pc and .prl files by changing ${worksrcpath}\${prefix} to
     
    633650    regsub ${prefix} ${worksrcpath} "" from_dir
    634651    regsub ${prefix} ${qt_dir} "" to_dir
    635     foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
     652    foreach fixfile [exec find ${dr_qt} -name "*.pc"] {
    636653        reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
    637654    }
    638     foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
     655    foreach fixfile [exec find ${dr_qt} -name "*.prl"] {
    639656        reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
    640657    }
     
    642659    # fix .pc files
    643660
    644     foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
     661    foreach fixfile [exec find ${dr_qt} -name "*.pc"] {
    645662
    646663        # remove Libs.private; they can mess up linking
     
    683700
    684701    file delete -force ${destroot}${qt_pkg_config_dir}
    685     xinstall -m 755 -d ${destroot}${qt_libs_dir}
    686     move ${destroot}${qt_frameworks_dir}/pkgconfig \
    687         ${destroot}${qt_libs_dir}
     702    move ${dr_qt_frameworks_dir}/pkgconfig ${dr_qt_libs_dir}
    688703
    689704    # move .la files from ${qt_frameworks_dir} to ${qt_libs_dir}
    690705
    691     foreach laf [glob ${destroot}/${qt_frameworks_dir}/*.la] {
    692         move ${laf} ${destroot}${qt_libs_dir}
     706    foreach laf [glob ${dr_qt_frameworks_dir}/*.la] {
     707        move ${laf} ${dr_qt_libs_dir}
    693708    }
    694709
    695710    # remove -L entries from .prl and .la files
    696711
    697     foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
     712    foreach fixfile [exec find ${dr_qt} -name "*.prl"] {
    698713        reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile}
    699714    }
    700     foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
     715    foreach fixfile [exec find ${dr_qt} -name "*.la"] {
    701716        reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile}
    702717    }
     
    704719    # remove redundant -F entries from .prl and .la files
    705720
    706     foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
     721    foreach fixfile [exec find ${dr_qt} -name "*.prl"] {
    707722        reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \
    708723            ${fixfile}
     
    711726            ${fixfile}
    712727    }
    713     foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
     728    foreach fixfile [exec find ${dr_qt} -name "*.la"] {
    714729        reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \
    715730            ${fixfile}
     
    728743    # link includes and libraries for each actual installed framework
    729744
    730     foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
     745    foreach fixfile [exec find ${dr_qt_frameworks_dir} \
    731746                         -name "*.framework" | \
    732747                         sed -e "s@${destroot}@@g"] {
     
    747762        # if they are already there first
    748763
    749         set inc_file ${destroot}${qt_includes_dir}/${tf}
     764        set inc_file ${dr_qt_includes_dir}/${tf}
    750765        if {[file exists ${inc_file}]} {
    751766            file delete -force ${inc_file}
     
    754769
    755770        # link libraries into ${qt_libs_dir}, all 4 number variants
    756 
    757         set dr_qt_libs_dir ${destroot}${qt_libs_dir}
    758771
    759772        ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib
     
    893906    # Install documentation.
    894907
    895     xinstall -m 755 -d ${destroot}${qt_docs_dir}
    896908    xinstall -m 644 -W ${worksrcpath} \
    897909        INSTALL LGPL_EXCEPTION.txt LICENSE.FDL \
    898910        LICENSE.GPL3 LICENSE.LGPL README \
    899         ${destroot}${qt_docs_dir}
     911        ${dr_qt_docs_dir}
    900912
    901913    # Install private headers needed by QtCreator
     
    903915    foreach {src_dir include_dir} \
    904916    {corelib QtCore gui QtGui script QtScript declarative QtDeclarative} {
    905         set dest_dir ${destroot}${qt_frameworks_dir}/${include_dir}.framework/Headers/private
     917        set dest_dir ${dr_qt_frameworks_dir}/${include_dir}.framework/Headers/private
    906918        xinstall -m 755 -d ${dest_dir}
    907919        set files [exec find ${worksrcpath}/src/${src_dir} -type f -name "*_p.h"]
     
    912924    # executable back into ${qt_bins_dir}
    913925
    914     set dr_qt_apps_dir ${destroot}${qt_apps_dir}
    915     set dr_qt_bins_dir ${destroot}${qt_bins_dir}
    916 
    917     xinstall -m 755 -d ${dr_qt_apps_dir}
    918926    foreach app [glob ${dr_qt_bins_dir}/*.app] {
    919927
     
    936944    # move tests to ${qt_data_dir}
    937945
    938     xinstall -m 755 -d ${destroot}${qt_data_dir}
    939     move ${destroot_qt}/tests/qt4 ${destroot}${qt_data_dir}/tests
     946    move ${dr_qt}/tests/qt4 ${dr_qt_data_dir}/tests
    940947
    941948    # install ${qt_includes_dir}/Qt if not already and it exists in
    942949    # the build, for support of legacy projects
    943950
    944     if {![file exists ${destroot}${qt_includes_dir}/Qt] &&
     951    if {![file exists ${dr_qt_includes_dir}/Qt] &&
    945952        [file exists ${worksrcpath}/include/Qt]} {
    946953
    947954        # copy the Qt headers directory
    948955
    949         copy ${worksrcpath}/include/Qt ${destroot}${qt_includes_dir}
     956        copy ${worksrcpath}/include/Qt ${dr_qt_includes_dir}
    950957
    951958    }
     
    954961
    955962    ln -s ${qt_frameworks_dir}/QtGui.framework/Resources \
    956         ${destroot}${qt_libs_dir}
     963        ${dr_qt_libs_dir}
    957964
    958965}
Note: See TracChangeset for help on using the changeset viewer.