Ticket #14601: Portfile.2.diff

File Portfile.2.diff, 8.4 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 17 years ago)
  • Portfile

    old new  
    1919                    http://wftp.tu-chemnitz.de/pub/Qt/qt/source/
    2020distname            qt-mac-opensource-src-${version}
    2121checksums           md5 e3997f7c7620bcf03c635676c3b01fef \
    22                     sha1 bdba9cd2a5ad79724d536f8a4a3010c3a223108b
     22                    sha1 bdba9cd2a5ad79724d536f8a4a3010c3a223108b \
     23                    rmd160 b02600a73ce54e367b3f362223cfafbaf337ca80
    2324
    2425depends_lib         port:libmng port:libpng port:jpeg port:tiff
    2526
    2627# have to build with Apple gcc because of -fconstant-cfstrings
    2728configure.compiler  gcc-4.0
    2829configure.cmd       "echo yes | ./configure"
    29 configure.env       QMAKESPEC='' QTDIR='' DYLD_LIBRARY_PATH=''
    3030configure.pre_args
     31
     32# directory to put .app and executable files
     33# once installed there, should not be moved so they can find each other
     34#   (e.g. assistant.app) and the examples directory
     35set bindir ${prefix}/libexec/${name}/bin
     36
    3137# See
    3238#   http://doc.trolltech.com/qtopia4.3/buildsystem/over-configure-options-qt-1.html
    3339# for options
    3440configure.args \
    3541    -v         \
    3642    -prefix         '${prefix}'                            \
    37     -docdir         '${prefix}/share/doc/${portname}/html' \
    38     -datadir        '${prefix}/share/qt4'                  \
    39     -headerdir      '${prefix}/include/qt4'                \
    40     -plugindir      '${prefix}/lib/qt4-plugins'            \
    41     -translationdir '${prefix}/share/qt4/translations'     \
     43    -bindir         '${bindir}'                            \
     44    -docdir         '${prefix}/share/doc/${portname}'      \
     45    -datadir        '${prefix}/share/${portname}'          \
     46    -headerdir      '${prefix}/include/${portname}'        \
     47    -plugindir      '${prefix}/lib/${portname}-plugins'    \
     48    -translationdir '${prefix}/share/${portname}/translations' \
    4249    -optimized-qmake    -release        -shared         -stl                \
    4350    -no-openssl         -largefile                                          \
    4451    -system-libpng      -system-libjpeg -system-libmng  -system-libtiff     \
    4552    -system-zlib        -qt-gif                                             \
    4653    -no-sql-ibase       -no-sql-mysql   -no-sql-odbc    -no-sql-psql        \
    47     -no-sql-sqlite      -no-nis         -no-cups        -no-framework       \
     54    -no-sql-sqlite      -no-nis         -no-cups                            \
     55    -framework          -libdir '${prefix}/Library/Frameworks'              \
    4856    -make libs          -make tools                                         \
    4957    -I${worksrcpath}/include -I${prefix}/include \
    5058    -L${worksrcpath}/lib -L${prefix}/lib
    5159
    5260    # not made by default, anyway: -nomake demos -nomake examples
    5361
    54 build.env           QMAKESPEC='' QTDIR='' DYLD_LIBRARY_PATH="${worksrcpath}/lib"
    5562build.target        first
    5663
    5764destroot.destdir    INSTALL_ROOT="${destroot}"
    5865
    59 set appPath         ${destroot}/Applications/MacPorts/Qt
    60 set docPath         ${destroot}${prefix}/share/doc/qt4-mac
    61 
    6266post-destroot {
    63     xinstall -d -m 0755 ${appPath}
    64     foreach app {assistant Designer Linguist pixeltool} {
    65         move ${destroot}${prefix}/bin/${app}.app ${appPath}
     67    xinstall -d -m 0755 ${destroot}${bindir}
     68    xinstall -d -m 0755 ${destroot}/Applications/MacPorts/Qt
     69   
     70    # create link in ${prefix}/bin to executable files in ${bindir}
     71    foreach bin [glob -type f -directory ${destroot}${bindir} *] {
     72        system "ln -s ${bindir}/[file tail ${bin}] ${destroot}${prefix}/bin"
     73    }
     74   
     75    # create link in /Applications/MacPorts/Qt to .app directories in ${bindir}
     76    # create link in ${prefix}/bin to all *.app/Contents/MacOS/*
     77    foreach app [glob -type d -directory ${destroot}${bindir} *.app] {
     78        system "ln -s ${bindir}/[file tail ${app}] ${destroot}/Applications/MacPorts/Qt"
     79        foreach bin [glob -type f -directory ${app} Contents/MacOS/*] {
     80            system "ln -s ${bindir}/[file tail ${app}]/Contents/MacOS/[file tail ${bin}] ${destroot}${prefix}/bin"
     81        }
     82    }
     83   
     84    # append -mac to links in ${prefix}/bin to avoid conflict with qt4-x11
     85    foreach bin [glob ${destroot}${prefix}/bin/*] {
     86        move ${bin} ${bin}-mac
     87    }
     88   
     89    # fix id of plugins shared libraries
     90    foreach dirFull [glob -directory ${destroot}${prefix}/lib/${portname}-plugins -type d -nocomplain *] {
     91        set dir [file tail ${dirFull}]
     92        foreach libFull [glob -directory ${destroot}${prefix}/lib/${portname}-plugins/${dir} -nocomplain *.dylib] {
     93            set lib [file tail ${libFull}]
     94            system "install_name_tool -id ${prefix}/lib/${portname}-plugins/${dir}/${lib} ${libFull}"
     95        }
    6696    }
     97   
     98    # install documentation
    6799    foreach doc {INSTALL LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT README \
    68100                 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT} {
    69         xinstall -c -m 644 ${worksrcpath}/$doc ${docPath}
     101        xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${portname}
    70102    }
    71     if {![file exists ${destroot}${prefix}/lib/libqt.dylib]} {
    72         set majorver [strsed ${version} {s/\.[0-9]*\.[0-9]*$//}]
    73         set minorver [strsed ${version} {s/\.[0-9]*$//}]
    74         system "cd ${destroot}${prefix}/lib &&
    75             ln -s libqt-mt.${version}.dylib libqt.dylib &&
    76             ln -s libqt-mt.${version}.dylib libqt.${majorver}.dylib &&
    77             ln -s libqt-mt.${version}.dylib libqt.${minorver}.dylib"
    78    }
    79103}
    80104
    81105variant dbus description "Include DBus support" {
     
    83107    configure.args-append   -qdbus
    84108}
    85109
    86 variant framework description "Build frameworks" {
    87     configure.args-delete   -no-framework
    88     configure.args-append   -framework
     110variant noframework description "Do not build frameworks" {
     111    configure.args-delete   -framework -libdir '${prefix}/Library/Frameworks'
     112    configure.args-append   -no-framework
    89113}
    90114
    91 variant ipv6 description "Include IPv6 support" {
    92     configure.args-delete   -no-ipv6
    93     configure.args-append   -ipv6
     115variant nis description "Include Network Information Service (NIS) support" {
     116    configure.args-delete   -no-nis
     117    configure.args-append   -nis
    94118}
    95119
    96 variant mysql description "Include support for SQL via mysql driver" {
     120variant cups description "Include Common Unix Printing System (CUPS) support" {
     121    configure.args-delete   -no-cups
     122    configure.args-append   -cups
     123}
     124
     125variant mysql description conflicts mysql5 "Include support for SQL via mysql driver" {
    97126    depends_lib-append      lib:libmysqlclient.12:mysql4
    98127    configure.args-delete   -no-sql-mysql
    99128    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \
    100129                            -I${prefix}/include/mysql -L${prefix}/lib/mysql
    101130}
    102131
    103 variant mysql5 description "Include support for SQL via mysql driver" {
     132variant mysql5 conflicts mysql description "Include support for SQL via mysql5 driver" {
    104133    depends_lib-append      lib:libmysqlclient.15:mysql5
    105134    configure.args-delete   -no-sql-mysql
    106135    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \
     
    112141        configure.args-delete   -no-sql-sqlite
    113142        configure.args-append   -qt-sql-sqlite -plugin-sql-sqlite
    114143    # -system-sqlite
    115     post-destroot {
    116         # fix install-name of plugin
    117         system "install_name_tool -id ${prefix}/lib/qt4-plugins/sqldrivers/libqsqlite.dylib \
    118             ${destroot}${prefix}/lib/qt4-plugins/sqldrivers/libqsqlite.dylib"
    119     }
    120144}
    121145
    122146variant ssl description "Include OpenSSL support" {
    123     depends_lib             port:openssl
     147    depends_lib-append      port:openssl
    124148    configure.args-delete   -no-openssl
    125149    configure.args-append   -openssl
    126150}
    127151
    128152variant examples description "Build Qt examples" {
    129153    # configure.args-delete   "-nomake examples"
    130     configure.args-append   -make examples
     154    configure.args-append   -make examples -examplesdir ${prefix}/share/${portname}/examples
    131155}
    132156
    133157variant demos description "Build Qt demos" {
    134158    # configure.args-delete   "-nomake demos"
    135     configure.args-append   -make demos
    136     post-destroot {
    137         move ${destroot}${prefix}/demos ${appPath}
    138         move ${destroot}${prefix}/bin/qtdemo.app ${appPath}
    139     }
     159    configure.args-append   -make demos -demosdir ${prefix}/share/${portname}/demos
    140160}
     161
     162livecheck.check     regex
     163livecheck.url       http://trolltech.com/developer/downloads/qt/mac
     164livecheck.regex     "The current version of Qt/Mac Open Source Edition is (4(?:\\.\\d+)*)"