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