source: trunk/dports/aqua/qt4-mac/Portfile @ 61377

Last change on this file since 61377 was 61377, checked in by jmr@…, 10 years ago

jpeg: update to version 7, rev bump dependents (#20193)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.2 KB
Line 
1# -*- 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
2# $Id: Portfile 61377 2009-12-09 23:32:32Z jmr@macports.org $
3
4PortSystem          1.0
5
6name                qt4-mac
7conflicts           qt4-mac-devel kdelibs3 libevent
8version             4.5.3
9revision            1
10categories          aqua
11platforms           macosx
12maintainers         nomaintainer
13
14homepage            http://www.trolltech.com/
15description         Qt Tool Kit (Native Aqua Version)
16long_description    This is Qt, TrollTech's C++ toolkit for writing cross-platform GUI applications. \
17                    This version uses the native Aqua UI. For a X11 version, see qt4-x11.
18master_sites        trolltech
19distname            qt-mac-opensource-src-${version}
20
21checksums           \
22    md5     484e3739fdc51540218ed92f4b732881 \
23    sha1    566a9c45b261447c07c784b9317c9b5aae1ccbd8 \
24    rmd160  290fecbe8698ead4f884617ae4dd20b37663545e
25
26depends_build       port:pkgconfig
27
28depends_lib       \
29    port:zlib     \
30    port:tiff     \
31    port:libpng   \
32    port:libmng   \
33    port:jpeg     \
34    port:dbus     \
35    port:openssl  \
36    port:sqlite3
37
38# Build plugins as bundle files instead of dylib files.
39# Test for Precompiled-headers support requires a C++ compiler, but configure calls it, by default, with a C compiler.
40# Use unixODBC provided by MacPorts instead of iODBC provided my Mac OS.
41# Ensure that securesocketclient demo is built even with configure option -openssl-linked.
42patchfiles                   \
43    patch-mac.conf.diff      \
44    patch-precomp.test.diff  \
45    patch-odbc.diff          \
46    patch-network.pro.diff   \
47    patch-qt3support-for-cocoa.diff
48
49# The build process uses -fconstant-cfstrings.
50# configure.compiler should therefore not be one of the MacPorts compilers.
51
52# --prefix is not recognized.
53configure.pre_args-delete  --prefix=${prefix}
54# -I${prefix}/include and -L${prefix}/lib must be set in ${configure.args}
55# or else some generated Makefiles will not see them.
56configure.cppflags
57configure.ldflags
58
59################################################################################
60# We do not want flags of any kind -- QT is smart enough to set up its own.    #
61################################################################################
62
63configure.universal_cflags
64configure.universal_cppflags
65configure.universal_cxxflags
66configure.universal_ldflags
67
68set dirname qt4-mac
69set qt_dir ${prefix}/libexec/${dirname}
70
71#  CPATH is used instead of -I to avoid conflicts with other ports.
72#  See http://trac.macports.org/ticket/15219 and http://trac.macports.org/ticket/18723.
73#
74# -system-sqlite ensures the use SQLite provided by MacPorts instead of Qt.
75#
76# -dbus-linked prevends qt4 from trying to dynamically load libdbus-1,
77#     which it is not able to find in ${prefix}.
78# -openssl-linked ensures that the MacPorts openssl is used.
79#
80configure.args                                            \
81    -v                                                    \
82    -debug-and-release                                    \
83    -confirm-license                                      \
84    -opensource                                           \
85    -prefix          ${qt_dir}                            \
86    -docdir          ${prefix}/share/doc/${dirname}       \
87    -examplesdir     ${prefix}/share/${dirname}/examples  \
88    -demosdir        ${prefix}/share/${dirname}/demos     \
89    -system-sqlite                                        \
90    -openssl-linked                                       \
91    -dbus-linked                                          \
92    -L${prefix}/lib                                       \
93    -arch            \"${build_arch}\"
94
95lappend cpath        ${prefix}/include
96lappend library_path ${prefix}/lib
97
98pre-configure {
99    configure.env-append \
100        CPATH=[join ${cpath} :] \
101        LIBRARY_PATH=[join ${library_path} :]
102}
103
104pre-build {
105    build.env-append \
106        CPATH=[join ${cpath} :] \
107        LIBRARY_PATH=[join ${library_path} :]
108}
109
110# Stop configure script from searching for SQL Drivers
111#    not available from MacPorts.
112foreach driver {db2 ibase oci tds} {
113    configure.args-append -no-sql-${driver}
114}
115
116# By default, disable most SQL Drivers.
117# There must be at least one enabled (http://trac.macports.org/ticket/15627).
118# SQLite is chosen to be always enabled because a copy of it is distributed
119#    with Qt, so it is reasonable for the user to expect it.
120foreach driver {mysql odbc psql sqlite2} {
121    configure.args-append -no-sql-${driver}
122}
123
124platform darwin 10 {
125    default_variants +cocoa
126}
127
128variant mysql description {Enable MySQL SQL Driver} {
129    depends_lib-append path:lib/mysql5:mysql5
130
131    lappend cpath        ${prefix}/include/mysql5/mysql
132    lappend library_path ${prefix}/lib/mysql5/mysql
133
134    configure.args-delete -no-sql-mysql
135}
136
137variant odbc description {Enable unixODBC SQL Driver} {
138    depends_lib-append port:unixODBC
139    configure.args-delete -no-sql-odbc
140}
141
142variant psql description {Enable PostgreSQL SQL Driver} {
143    depends_lib-append port:postgresql83
144
145    lappend cpath        ${prefix}/include/postgresql83
146    lappend library_path ${prefix}/lib/postgresql83
147
148    configure.args-delete -no-sql-psql
149}
150
151variant sqlite2 description {Enable SQLite version 2 SQL Driver} {
152    depends_lib-append port:sqlite2
153    configure.args-delete -no-sql-sqlite2
154}
155
156variant cocoa description {Build the Cocoa version of Qt in 32-bit mode} conflicts noframework {
157    configure.args-append  -cocoa
158
159    # Everything might build, but nothing will run.
160    pre-fetch {
161        if { ${os.major} < 9 } {
162            return -code error "Variant cocoa creates Qt binaries which require Mac OS X 10.5 or higher."
163        }
164    }
165}
166
167variant noframework description {Do not build frameworks} conflicts cocoa {
168    configure.args-append   -no-framework
169}
170
171build.target        first
172use_parallel_build  yes
173
174destroot.destdir    INSTALL_ROOT="${destroot}"
175
176post-patch {
177    # Ensure that correct compilers are used.
178    reinplace "s| g++\$| ${configure.cxx}|" ${worksrcpath}/mkspecs/common/g++.conf
179    reinplace "s| gcc\$| ${configure.cc}|"  ${worksrcpath}/mkspecs/common/g++.conf
180    reinplace "s| g++\$| ${configure.cxx}|" ${worksrcpath}/mkspecs/macx-g++/qmake.conf
181}
182
183post-destroot {
184    # Install documentation.
185    foreach doc { FAQ.txt INSTALL LGPL_EXCEPTION.txt LICENSE.GPL3 LICENSE.LGPL README } {
186        xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${name}
187    }
188
189    # Create link in ${prefix}/bin to executable files in ${qt_dir}/bin.
190    foreach bin [glob -type f -directory ${destroot}${qt_dir}/bin *] {
191        ln -s ${qt_dir}/bin/[file tail ${bin}] ${destroot}${prefix}/bin
192    }
193
194    xinstall -d -m 0755 ${destroot}${applications_dir}/Qt
195    # Create link in ${applications_dir}/Qt to .app directories in ${qt_dir}/bin/.
196    # Create link in ${prefix}/bin to all *.app/Contents/MacOS/*.
197    foreach app [glob -type d -directory ${destroot}${qt_dir}/bin *.app] {
198        ln -s ${qt_dir}/bin/[file tail ${app}] ${destroot}${applications_dir}/Qt
199        foreach bin [glob -tails -type f -directory ${app}/Contents/MacOS *] {
200            ln -s ${qt_dir}/bin/[file tail ${app}]/Contents/MacOS/${bin} ${destroot}${prefix}/bin
201        }
202    }
203
204    # Avoid conflict with other qt packages.
205    # Ensure lower case names.
206    foreach bin [glob ${destroot}${prefix}/bin/*] {
207        file rename ${bin} ${destroot}${prefix}/bin/[string tolower [file tail ${bin}]]-mac
208    }
209
210    # Fix the .pc and .prl files by removing ${destroot}.
211    foreach fixfile [glob -nocomplain -directory ${destroot} ${qt_dir}/lib/pkgconfig/*.pc ${qt_dir}/lib/*.prl ${qt_dir}/lib/*/*.prl ${prefix}/share/${dirname}/demos/shared/*.prl] {
212        reinplace  \
213            "s|-L${worksrcpath}/lib|-L${qt_dir}/lib|g" \
214            ${fixfile}
215        reinplace  \
216            "s|-F${worksrcpath}/lib|-F${qt_dir}/lib|g" \
217            ${fixfile}
218    }
219
220    # Create link to Frameworks in Frameworks directory.
221    xinstall -d -m 0755 ${destroot}${frameworks_dir}
222    foreach fdir [glob -tails -directory ${destroot}${qt_dir}/lib -nocomplain *.framework] {
223        ln -s ${qt_dir}/lib/${fdir} ${destroot}${frameworks_dir}
224    }
225
226    # The debug .pc files have no counterpart in qt4-x11, so set a link to them in the pkgconfig directory.
227    xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
228    foreach fl [glob -tails -directory ${destroot}${qt_dir}/lib/pkgconfig *_debug.pc] {
229        ln -s ${qt_dir}/lib/pkgconfig/${fl} ${destroot}${prefix}/lib/pkgconfig/
230    }
231
232    # Install select file for qt4_select.
233    xinstall -m 755 -d ${destroot}${prefix}/etc/select/qt4
234    xinstall -m 644 ${filespath}/${dirname} ${destroot}${prefix}/etc/select/qt4/
235}
236
237variant raster description {Use raster graphics system by default} {
238    configure.args-append   -graphicssystem  raster
239}
240
241variant universal {
242    configure.universal_args-delete --disable-dependency-tracking
243    configure.args-delete -arch            \"${build_arch}\"
244    configure.args-append -arch            \"${universal_archs}\"
245    if {[info exists universal_sysroot]} {
246        configure.args-append -sdk ${universal_sysroot}
247    }
248}
249
250livecheck.type      regex
251livecheck.url       http://qt.nokia.com/downloads/mac-os-cpp
252livecheck.regex     "qt-mac-opensource-src-(4(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.