# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4 # $Id: Portfile 44214 2008-12-23 21:17:33Z mcalhoun@macports.org $ PortSystem 1.0 name qt4-mac version 4.4.3 revision 1 categories aqua platforms macosx maintainers erickt gmail.com:clubjuggler openmaintainer homepage http://www.trolltech.com/ description Qt Tool Kit (Native Aqua Version) long_description This is Qt, TrollTech's C++ toolkit for writing cross-platform GUI applications. \ This version uses the native Aqua UI. For a X11 version, see qt4-x11. master_sites ftp://ftp.trolltech.com/qt/source/ \ http://wftp.tu-chemnitz.de/pub/Qt/qt/source/ \ http://ftp.heanet.ie/mirrors/ftp.trolltech.com/pub/qt/source/ distname qt-mac-opensource-src-${version} checksums \ md5 766c02e23d2de1b19c9a25a68297b04e \ sha1 00cdf6df27a590565f557a7c02ba2edc634354d1 \ rmd160 7c39303f7aef6a369a16e787681b78d07c59fc76 depends_build port:pkgconfig depends_lib \ port:zlib \ port:tiff \ port:libpng \ port:libmng \ port:jpeg \ port:dbus \ port:unixODBC \ port:mysql5 \ port:postgresql83 \ port:openssl \ port:sqlite3 patchfiles patch-compile.test.diff patch-mac.conf.diff # have to build with Apple gcc because of -fconstant-cfstrings # configure.compiler should therefore not be one of the MacPorts compilers # --prefix is not recognized configure.pre_args-delete --prefix=${prefix} # -I${prefix}/include and -L${prefix}/lib must be set in ${configure.args} # or else some generated Makefiles will not seem them configure.cppflags configure.ldflags # ensure that MacPorts compilers are used configure.cmd \ /usr/bin/sed -ibak -e \"s| gcc\\\$| \${CC}|g\" -e \"s| g++\\\$| \${CXX}|g\" ${worksrcpath}/mkspecs/common/mac-g++.conf && ${configure.cmd} set qt_dir ${prefix}/libexec/${name} # See # http://doc.trolltech.com/qtopia4.3/buildsystem/over-configure-options-qt-1.html # for options # # -I${prefix}/include should be set in ${configure.args}, but # we instead patch -isystem ${prefix}/include into the configure # script to avoid conflicts with other ports (e.g. pcre). # See http://trac.macports.org/ticket/15219 # # -dbus-linked prevends qt4 from trying to dynamically load libdbus-1, # which it is not able to find in ${prefix} # -openssl-linked ensures that the MacPorts openssl is used configure.args \ -v \ -debug-and-release \ -framework \ -confirm-license \ -prefix ${qt_dir} \ -docdir ${prefix}/share/doc/${name} \ -examplesdir ${prefix}/share/${name}/examples \ -demosdir ${prefix}/share/${name}/demos \ -system-sqlite \ -openssl-linked \ -dbus-linked \ -I${prefix}/include/mysql5/mysql \ -I${prefix}/include/postgresql83 \ -L${prefix}/lib \ -L${prefix}/lib/mysql5/mysql \ -L${prefix}/lib/postgresql83 build.target first use_parallel_build yes destroot.destdir INSTALL_ROOT="${destroot}" post-patch { # configure script only accepts -I..., but we want -isystem... reinplace -E "s|^I_FLAGS=\$|I_FLAGS=-isystem${prefix}/include|" \ ${worksrcpath}/configure # ensure that the MacPorts odbc is used reinplace "s|-liodbc|-lodbc|" \ ${worksrcpath}/src/plugins/sqldrivers/odbc/odbc.pro # ensure that securesocketclient demo is built reinplace "s|contains(QT_CONFIG, openssl)|contains(QT_CONFIG, openssl) \\| contains(QT_CONFIG, openssl-linked)|" \ examples/network/network.pro } post-destroot { # install documentation foreach doc {INSTALL LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT README \ GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT} { xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${portname} } # create link in ${prefix}/bin to executable files in ${qt_dir}/bin foreach bin [glob -type f -directory ${destroot}${qt_dir}/bin *] { ln -s ${qt_dir}/bin/[file tail ${bin}] ${destroot}${prefix}/bin } xinstall -d -m 0755 ${destroot}${applications_dir}/Qt # create link in ${applications_dir}/Qt to .app directories in ${qt_dir}/bin/ # create link in ${prefix}/bin to all *.app/Contents/MacOS/* foreach app [glob -type d -directory ${destroot}${qt_dir}/bin *.app] { ln -s ${qt_dir}/bin/[file tail ${app}] ${destroot}${applications_dir}/Qt foreach bin [glob -tails -type f -directory ${app}/Contents/MacOS *] { ln -s ${qt_dir}/bin/[file tail ${app}]/Contents/MacOS/${bin} ${destroot}${prefix}/bin } } # avoid conflict with other qt packages # ensure lower case names foreach bin [glob ${destroot}${prefix}/bin/*] { file rename ${bin} [string tolower ${bin}]-mac } # Fix the .pc and .prl files by removing ${destroot} foreach fixfile [glob -directory ${destroot}${qt_dir}/lib/pkgconfig *.pc] { reinplace \ "s|[regsub ${prefix} ${worksrcpath} {}]/bin|[regsub ${prefix} ${qt_dir}/bin {}]|g" \ ${fixfile} } foreach fixfile [glob -nocomplain -directory ${destroot} ${qt_dir}/lib/pkgconfig/*.pc ${qt_dir}/lib/*.prl ${qt_dir}/lib/*/*.prl ${prefix}/share/${name}/demos/shared/*.prl] { reinplace \ "s|-L${worksrcpath}/lib|-L${qt_dir}/lib|g" \ ${fixfile} reinplace \ "s|-F${worksrcpath}/lib|-F${qt_dir}/lib|g" \ ${fixfile} } # Create link to Frameworks in Frameworks directory xinstall -d -m 0755 ${destroot}${frameworks_dir} foreach fdir [glob -tails -directory ${destroot}${qt_dir}/lib -nocomplain *.framework] { ln -s ${qt_dir}/lib/${fdir} ${destroot}${frameworks_dir} } # The debug .pc files have no counterpart in qt4-x11, so set a link to them in the pkgconfig directory xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig foreach fl [glob -tails -directory ${destroot}${qt_dir}/lib/pkgconfig *_debug.pc] { ln -s ${qt_dir}/lib/pkgconfig/${fl} ${destroot}${prefix}/lib/pkgconfig/ } # install select file for qt4_select xinstall -m 755 -d ${destroot}${prefix}/etc/select/qt4 xinstall -m 644 ${filespath}/${name} ${destroot}${prefix}/etc/select/qt4/ } variant noframework description {Do not build frameworks} { configure.args-delete -framework configure.args-append -no-framework } variant webkit description {Use WebKit as html rendering engine in Assistant} { configure.args-append -assistant-webkit } variant universal { configure.universal_args-delete --disable-dependency-tracking configure.args-append -universal } livecheck.check regex livecheck.url http://trolltech.com/downloads/opensource/appdev/mac-os-cpp livecheck.regex "qt-mac-opensource-src-(4(?:\\.\\d+)*)${extract.suffix}"