New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #16862: Portfile.diff

File Portfile.diff, 10.1 KB (added by mcalhoun@…, 5 years ago)
  • Portfile

    old new  
    55 
    66name                qt4-mac 
    77version             4.4.3 
     8revision            1 
    89categories          aqua 
    910platforms           macosx 
    10 maintainers         erickt clubjuggler@gmail.com openmaintainer 
     11maintainers         erickt gmail.com:clubjuggler openmaintainer 
    1112 
    1213homepage            http://www.trolltech.com/ 
    1314description         Qt Tool Kit (Native Aqua Version) 
     
    2223                    sha1 00cdf6df27a590565f557a7c02ba2edc634354d1 \ 
    2324                    rmd160 7c39303f7aef6a369a16e787681b78d07c59fc76 
    2425 
    25 depends_lib         port:libmng port:libpng port:jpeg port:tiff 
     26depends_lib         port:libmng port:libpng port:jpeg port:tiff port:libiconv 
    2627 
    27 patchfiles          patch-mac.conf.diff 
     28patchfiles          patch-mac.conf.diff patch-compile.test.diff 
     29 
     30post-patch { 
     31    reinplace -E "s|^I_FLAGS=\$|I_FLAGS=-isystem${prefix}/include|" \ 
     32        ${worksrcpath}/configure 
     33} 
    2834 
    2935# have to build with Apple gcc because of -fconstant-cfstrings 
    30 configure.compiler  gcc-4.0 
    31 configure.cmd       "CFLAGS=-isystem${prefix}/include CXXFLAGS=-isystem${prefix}/include ./configure" 
    3236configure.pre_args 
    3337 
    3438# directory for .app and executable files 
    3539# Once installed, they should not be moved so they can find each other 
    3640# (e.g. assistant.app) and the examples directory 
    3741set bindir ${prefix}/libexec/${name}/bin 
    38 set frameworkdir ${prefix}/Library/Frameworks 
    3942 
    4043# Can be removed once MacPorts 1.7.0 is released 
    4144if {![info exists applications_dir]} { 
    4245    set applications_dir /Applications/MacPorts 
    4346} 
     47if {![info exists frameworks_dir]} { 
     48   set frameworks_dir ${prefix}/Library/Frameworks 
     49} 
     50 
     51# Location of .a and .dylib files 
     52set libdir ${frameworks_dir} 
    4453 
    4554# See 
    4655#   http://doc.trolltech.com/qtopia4.3/buildsystem/over-configure-options-qt-1.html 
     
    6170    -system-zlib        -qt-gif                                             \ 
    6271    -no-sql-ibase       -no-sql-mysql   -no-sql-odbc    -no-sql-psql        \ 
    6372    -no-sql-sqlite      -no-nis         -no-cups                            \ 
    64     -framework          -libdir '${frameworkdir}'                           \ 
     73    -framework          -libdir '${frameworks_dir}'                         \ 
    6574    -make libs          -make tools                                         \ 
    66     -I${worksrcpath}/include \ 
    67     -L${worksrcpath}/lib -L${prefix}/lib 
     75    -L${prefix}/lib 
    6876 
    69     # Take care of this with the CXXFLAGS=-isystem${prefix}/include 
    70     # this puts the include at the end so that qt's include files are found first. 
    71     # -I${prefix}/include 
    72     # not made by default, anyway: -nomake demos -nomake examples 
     77# default: -nomake demos  -nomake examples 
     78# default: -iconv -svg -webkit -phonon -phonon-backend -xmlpatterns 
     79# default: -no-assistant-webkit 
    7380 
    7481build.target        first 
    7582use_parallel_build  yes 
    7683 
    7784destroot.destdir    INSTALL_ROOT="${destroot}" 
    7885 
     86post-configure { 
     87    reinplace "s|gcc|${configure.cc}|g" \ 
     88        ${worksrcpath}/mkspecs/common/mac-g++.conf 
     89    reinplace "s|g++|${configure.cxx}|g" \ 
     90        ${worksrcpath}/mkspecs/common/mac-g++.conf 
     91} 
     92 
    7993post-destroot { 
    80     xinstall -d -m 0755 ${destroot}${bindir} 
    8194    xinstall -d -m 0755 ${destroot}${applications_dir}/Qt 
    82     xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${portname} 
     95 
     96    # If we want to avoid conflict with qt4-x11, append -mac to all the binaries 
     97    if { [variant_isset qt4_select] } { 
     98        set binappend {-mac} 
     99    } else { 
     100        set binappend {} 
     101    } 
    83102 
    84103    # create link in ${prefix}/bin to executable files in ${bindir} 
    85     foreach bin [glob -type f -directory ${destroot}${bindir} *] { 
    86         system "ln -s ${bindir}/[file tail ${bin}] ${destroot}${prefix}/bin" 
     104    foreach bin [glob -tails -type f -directory ${destroot}${bindir} *] { 
     105        system "ln -s ${bindir}/${bin} ${destroot}${prefix}/bin/${bin}${binappend}" 
    87106    } 
    88107 
    89108    # create link in ${applications_dir}/Qt to .app directories in ${bindir} 
    90109    # create link in ${prefix}/bin to all *.app/Contents/MacOS/* 
    91110    foreach app [glob -type d -directory ${destroot}${bindir} *.app] { 
    92111        system "ln -s ${bindir}/[file tail ${app}] ${destroot}${applications_dir}/Qt" 
    93         foreach bin [glob -type f -directory ${app} Contents/MacOS/*] { 
    94             system "ln -s ${bindir}/[file tail ${app}]/Contents/MacOS/[file tail ${bin}] ${destroot}${prefix}/bin" 
     112        foreach bin [glob -tails -type f -directory ${app}/Contents/MacOS *] { 
     113            system "ln -s ${bindir}/[file tail ${app}]/Contents/MacOS/${bin} ${destroot}${prefix}/bin/${bin}${binappend}" 
    95114        } 
    96115    } 
    97116 
     
    104123        } 
    105124    } 
    106125 
    107     # Put pkgconfig directory in correct place (Fix Ticket #15353) 
    108     system "mv ${destroot}${frameworkdir}/pkgconfig ${destroot}/${prefix}/lib/" 
     126    # Put pkgconfig directory in the same place irrespective of the noframework variant 
     127    system "mv ${destroot}${libdir}/pkgconfig ${destroot}${prefix}/lib/pkgconfig-${name}" 
     128 
     129    # If the qt4_select variant is not set, allow pkg-config to find the .pc files without setting PKG_CONFIG_PATH 
     130    if { ! [variant_isset qt4_select] } { 
     131        xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig 
     132        foreach pcfile [glob -tails -directory ${destroot}${prefix}/lib/pkgconfig-${name} *.pc] { 
     133            system "ln -s ../pkgconfig-${name}/${pcfile} ${destroot}${prefix}/lib/pkgconfig" 
     134        } 
     135    } 
     136 
     137    # Fix the .pc and .prl files by removing ${destroot} 
     138    foreach fixfile [glob -directory ${destroot}${prefix}/lib/pkgconfig-${name} *.pc] { 
     139        reinplace \ 
     140            "s|[regsub ${prefix} ${worksrcpath} {}]/bin|[regsub ${prefix} ${bindir} {}]|g" \ 
     141            ${fixfile} 
     142    } 
     143    foreach fixfile [glob -nocomplain -directory ${destroot} ${prefix}/lib/pkgconfig-${name}/*.pc ${libdir}/*.prl ${libdir}/*/*.prl] { 
     144        reinplace  \ 
     145            "s|-L${worksrcpath}/lib|-L${libdir}|g" \ 
     146            ${fixfile} 
     147 
     148        reinplace  \ 
     149            "s|-F${worksrcpath}/lib|-F${frameworks_dir}|g" \ 
     150            ${fixfile} 
     151    } 
    109152 
    110153    # install documentation 
    111154    foreach doc {INSTALL LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT README \ 
     
    116159 
    117160default_variants +docs +dbus 
    118161 
    119 variant dbus description "Include DBus support" { 
     162variant qt4_select description {Do not conflict with qt4-x11} {} 
     163 
     164variant dbus description {Include DBus support} { 
    120165    depends_lib-append      port:dbus 
    121166    configure.args-append   -dbus-linked 
    122167} 
    123168 
    124 variant noframework description "Do not build frameworks" { 
    125     configure.args-delete   -framework -libdir '${frameworkdir}' 
    126     configure.args-append   -no-framework 
     169variant noframework description {Do not build frameworks} { 
     170    configure.args-delete   -framework -libdir '${frameworks_dir}' 
     171    configure.args-append   -no-framework -libdir ${prefix}/lib/${name} 
     172    set libdir ${prefix}/lib/${name} 
    127173} 
    128174 
    129 variant nis description "Include Network Information Service (NIS) support" { 
     175variant nis description {Include Network Information Service (NIS) support} { 
    130176    configure.args-delete   -no-nis 
    131177    configure.args-append   -nis 
    132178} 
    133179 
    134 variant cups description "Include Common Unix Printing System (CUPS) support" { 
     180variant cups description {Include Common Unix Printing System (CUPS) support} { 
    135181    configure.args-delete   -no-cups 
    136182    configure.args-append   -cups 
    137183} 
    138184 
    139 variant mysql4 conflicts mysql5 description "Include support for SQL via mysql4 driver" { 
     185variant mysql4 conflicts mysql5 description {Include support for SQL via mysql4 driver} { 
    140186    depends_lib-append      lib:libmysqlclient.12:mysql4 
    141187    configure.args-delete   -no-sql-mysql 
    142188    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \ 
    143189                            -I${prefix}/include/mysql -L${prefix}/lib/mysql 
    144190} 
    145191 
    146 variant mysql5 conflicts mysql4 description "Include support for SQL via mysql5 driver" { 
     192variant mysql5 conflicts mysql4 description {Include support for SQL via mysql5 driver} { 
    147193    depends_lib-append      lib:libmysqlclient.15:mysql5 
    148194    configure.args-delete   -no-sql-mysql 
    149195    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \ 
    150196                            -I${prefix}/include/mysql5/mysql -L${prefix}/lib/mysql5/mysql 
    151197} 
    152198 
    153 variant psql description "Include support for SQL via postgresql driver" { 
     199variant psql description {Include support for SQL via postgresql driver} { 
    154200    depends_lib-append      port:postgresql83 
    155201        configure.args-delete   -no-sql-psql 
    156202        configure.args-append   -qt-sql-psql -plugin-sql-psql \ 
    157203                            -I${prefix}/include/postgresql83 -L${prefix}/lib/postgresql83 
    158204} 
    159205 
    160 variant sqlite description "Include support for SQL via sqlite driver" { 
     206variant sqlite description {Include support for SQL via sqlite driver} { 
    161207        configure.args-delete   -no-sql-sqlite 
    162208        configure.args-append   -qt-sql-sqlite -plugin-sql-sqlite 
    163209} 
    164210 
    165 variant ssl description "Include OpenSSL support" { 
     211variant ssl description {Include OpenSSL support} { 
    166212    depends_lib-append      port:openssl 
    167213    configure.args-delete   -no-openssl 
    168214    configure.args-append   -openssl 
    169215} 
    170216 
    171 variant examples description "Build Qt examples" { 
     217variant webkit description {Use WebKit as html rendering engine in Assistant} { 
     218    #configure.args-delete   -no-assistant-webkit 
     219    configure.args-append   -assistant-webkit 
     220} 
     221 
     222variant examples description {Build Qt examples} { 
    172223    # configure.args-delete   "-nomake examples" 
    173224    configure.args-append   -make examples -examplesdir ${prefix}/share/${portname}/examples 
    174225} 
    175226 
    176 variant demos description "Build Qt demos" { 
     227variant demos description {Build Qt demos} { 
    177228    # configure.args-delete   "-nomake demos" 
    178229    configure.args-append   -make demos -demosdir ${prefix}/share/${portname}/demos 
    179230} 
    180231 
    181 variant docs description "Include Qt Documentation" { 
     232variant docs description {Include Qt Documentation} { 
    182233    configure.args-append   -make docs 
    183234} 
    184235 
    185  
    186236livecheck.check     regex 
    187 livecheck.url       http://trolltech.com/developer/downloads/qt/mac 
    188 livecheck.regex     "The current version of Qt/Mac Open Source Edition is (4(?:\\.\\d+)*)" 
     237livecheck.url       http://trolltech.com/downloads/opensource/appdev/mac-os-cpp 
     238livecheck.regex     "qt-mac-opensource-src-(4(?:\\.\\d+)*)${extract.suffix}"