Ticket #14601: Portfile.diff

File Portfile.diff, 7.1 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
     32set bindir ${prefix}/libexec/${name}/bin
     33
    3134# See
    3235#   http://doc.trolltech.com/qtopia4.3/buildsystem/over-configure-options-qt-1.html
    3336# for options
    3437configure.args \
    3538    -v         \
    3639    -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'     \
     40    -bindir         '${bindir}'                            \
     41    -docdir         '${prefix}/share/doc/${portname}'      \
     42    -datadir        '${prefix}/share/${portname}'          \
     43    -headerdir      '${prefix}/include/${portname}'        \
     44    -plugindir      '${prefix}/lib/${portname}-plugins'    \
     45    -translationdir '${prefix}/share/${portname}/translations' \
    4246    -optimized-qmake    -release        -shared         -stl                \
    4347    -no-openssl         -largefile                                          \
    4448    -system-libpng      -system-libjpeg -system-libmng  -system-libtiff     \
     
    5155
    5256    # not made by default, anyway: -nomake demos -nomake examples
    5357
    54 build.env           QMAKESPEC='' QTDIR='' DYLD_LIBRARY_PATH="${worksrcpath}/lib"
    5558build.target        first
    5659
    5760destroot.destdir    INSTALL_ROOT="${destroot}"
    5861
    59 set appPath         ${destroot}/Applications/MacPorts/Qt
    60 set docPath         ${destroot}${prefix}/share/doc/qt4-mac
    61 
    6262post-destroot {
    63     xinstall -d -m 0755 ${appPath}
    64     foreach app {assistant Designer Linguist pixeltool} {
    65         move ${destroot}${prefix}/bin/${app}.app ${appPath}
     63    xinstall -d -m 0755 ${destroot}${bindir}
     64    xinstall -d -m 0755 ${destroot}/Applications/MacPorts/Qt
     65    foreach bin [glob -type f -directory ${destroot}${bindir} *] {
     66        system "ln -s ${bindir}/[file tail ${bin}] ${destroot}${prefix}/bin"
     67    }
     68    foreach app [glob -type d -directory ${destroot}${bindir} *.app] {
     69        system "ln -s ${bindir}/[file tail ${app}] ${destroot}/Applications/MacPorts/Qt"
     70        foreach bin [glob -type f -directory ${app} Contents/MacOS/*] {
     71            system "ln -s ${bindir}/[file tail ${app}]/Contents/MacOS/[file tail ${bin}] ${destroot}${prefix}/bin"
     72        }
     73    }
     74    foreach bin [glob ${destroot}${prefix}/bin/*] {
     75        move ${bin} ${bin}-mac
     76    }
     77    foreach dirFull [glob -directory ${destroot}${prefix}/lib/${portname}-plugins -type d -nocomplain *] {
     78        set dir [file tail ${dirFull}]
     79        foreach libFull [glob -directory ${destroot}${prefix}/lib/${portname}-plugins/${dir} -nocomplain *.dylib] {
     80            set lib [file tail ${libFull}]
     81            system "install_name_tool -id ${prefix}/lib/${portname}-plugins/${dir}/${lib} ${libFull}"
     82        }
    6683    }
    6784    foreach doc {INSTALL LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT README \
    6885                 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT} {
    69         xinstall -c -m 644 ${worksrcpath}/$doc ${docPath}
     86        xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${portname}
    7087    }
    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    }
    7988}
    8089
    8190variant dbus description "Include DBus support" {
     
    8594
    8695variant framework description "Build frameworks" {
    8796    configure.args-delete   -no-framework
    88     configure.args-append   -framework
     97    configure.args-append   -framework -libdir '${prefix}/Library/Frameworks'
     98}
     99
     100variant nis description "Include Network Information Service (NIS) support" {
     101    configure.args-delete   -no-nis
     102    configure.args-append   -nis
    89103}
    90104
    91 variant ipv6 description "Include IPv6 support" {
    92     configure.args-delete   -no-ipv6
    93     configure.args-append   -ipv6
     105variant cups description "Include Common Unix Printing System (CUPS) support" {
     106    configure.args-delete   -no-cups
     107    configure.args-append   -cups
    94108}
    95109
    96 variant mysql description "Include support for SQL via mysql driver" {
     110variant mysql conflicts mysql5 description "Include support for SQL via mysql driver" {
    97111    depends_lib-append      lib:libmysqlclient.12:mysql4
    98112    configure.args-delete   -no-sql-mysql
    99113    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \
    100114                            -I${prefix}/include/mysql -L${prefix}/lib/mysql
    101115}
    102116
     117variant mysql5 conflicts mysql description "Include support for SQL via mysql5 driver" {
     118    depends_lib-append      port:mysql5
     119    configure.args-delete   -no-sql-mysql
     120    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \
     121                            -I${prefix}/include/mysql5/mysql -L${prefix}/lib/mysql5/mysql
     122}
     123
    103124variant sqlite description "Include support for SQL via sqlite driver" {
    104125        # depends_lib-append      port:sqlite3
    105126        configure.args-delete   -no-sql-sqlite
    106127        configure.args-append   -qt-sql-sqlite -plugin-sql-sqlite
    107128    # -system-sqlite
    108     post-destroot {
    109         # fix install-name of plugin
    110         system "install_name_tool -id ${prefix}/lib/qt4-plugins/sqldrivers/libqsqlite.dylib \
    111             ${destroot}${prefix}/lib/qt4-plugins/sqldrivers/libqsqlite.dylib"
    112     }
    113129}
    114130
    115131variant ssl description "Include OpenSSL support" {
     
    120136
    121137variant examples description "Build Qt examples" {
    122138    # configure.args-delete   "-nomake examples"
    123     configure.args-append   -make examples
     139    configure.args-append   -make examples -examplesdir ${prefix}/share/${portname}/examples
    124140}
    125141
    126142variant demos description "Build Qt demos" {
    127143    # configure.args-delete   "-nomake demos"
    128     configure.args-append   -make demos
    129     post-destroot {
    130         move ${destroot}${prefix}/demos ${appPath}
    131         move ${destroot}${prefix}/bin/qtdemo.app ${appPath}
    132     }
     144    configure.args-append   -make demos -demosdir ${prefix}/share/${portname}/demos
    133145}
     146
     147livecheck.check     regex
     148livecheck.url       http://trolltech.com/developer/downloads/qt/mac
     149livecheck.regex     "The current version of Qt/Mac Open Source Edition is (4(?:\\.\\d+)*)"