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

Last change on this file since 113176 was 113176, checked in by michaelld@…, 6 years ago

qt4-mac:
+ remove unneeded configure.*flags settings; they are ignored by qmake and qt anyway, so they do not need to be cleared or set here;
+ add setting of -stdlib when using clang; addresses ticket #41301.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 42.2 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 113176 2013-11-11 18:23:50Z michaelld@macports.org $
3
4PortSystem          1.0
5
6# use the qt4 group; set 'building_qt4' so that the portgroup
7# does not include certain parts
8set building_qt4    1
9PortGroup           qt4 1.0
10PortGroup           xcodeversion 1.0
11PortGroup           compiler_blacklist_versions 1.0
12
13name                qt4-mac
14# qt4-mac-devel is "replaced_by" this port,
15# so this port cannot conflict with it.
16#conflicts           qt3 qt3-mac qt4-mac-devel
17conflicts           qt3 qt3-mac
18version             4.8.5
19set branch          [join [lrange [split ${version} .] 0 1] .]
20
21categories          aqua
22platforms           macosx
23maintainers         michaelld openmaintainer
24license             {LGPL-2.1 GPL-3}
25
26homepage            http://qt-project.org
27description         Qt Tool Kit
28long_description    Qt Tool Kit: A cross-platform framework \
29                    (headers, data, and libraries) for writing \
30                    cross-platform GUI-based applications.
31
32distname            qt-everywhere-opensource-src-${version}
33distfiles           ${distname}${extract.suffix} \
34                    libWebKitSystemInterfaceMavericks.a
35
36master_sites        http://download.qt-project.org/official_releases/qt/${branch}/${version}/  \
37    http://trac.webkit.org/export/158483/trunk/WebKitLibraries/ \
38    https://trac.macports.org/export/112811/trunk/dports/aqua/qt4-mac/files/
39
40checksums           ${distname}${extract.suffix} \
41                    rmd160  1e7bb099d5d1cda0b663cebe207c846c8d04750d \
42                    sha256  eb728f8268831dc4373be6403b7dd5d5dde03c169ad6882f9a8cb560df6aa138 \
43                    libWebKitSystemInterfaceMavericks.a \
44                    rmd160  b99bb61b3c433811ffa0ce68cf92ce4d51eef433 \
45                    sha256  d5026704ae94ba6b2d6574aa35e61c83de8e2c256df1b95e4abb3495dca8f5f7
46
47minimum_xcodeversions   {8 2.5}
48
49depends_lib-append  port:zlib path:bin/dbus-daemon:dbus \
50                    port:openssl port:tiff \
51                    port:libpng port:libmng port:jpeg
52
53###############################################
54# Patches are used to both fix compiling on various OS versions, and
55# to enhance the functionality of QMake and its build files.  Some of
56# these patches are 2-stage: use a file here, and the replace an
57# @VARIABLE@ in post-patch.  There are LOTS of patches, because Qt is
58# a large, complicated system.
59
60# (0) Fix the testing script to properly handle both +universal as
61# well as the native arch for both CXX and CC compiling; also make
62# sure it does not create a Mac app bundle.
63
64patchfiles-append   patch-config.tests_unix_compile.test.diff
65
66# (1) Test for Precompiled-headers support (a) requires a C++
67# compiler, but configure calls it, by default, with a C compiler;
68# thus, enable testing using the C compiler. (b) to work with ccache,
69# if used.
70
71patchfiles-append   patch-config.tests_unix_precomp.test.diff
72
73# (2) fix 'configure' script: (a) to allow easy replacement of arch
74# type(s). (b) to find the correct QMAKE CXX compiler by removing
75# possibilities that include the character "$". (c) to declare, use,
76# and set QT_INSTALL_FRAMEWORKS and QMAKE_FRAMEWORKDIR_QT, both here
77# and in the resulting .qmake.cache files. (d) to allow easy
78# replacement of MACOSX_DEPLOYMENT_TARGET: build for just the user's
79# current OS. (e) add hooks for C++11 testing.
80
81patchfiles-append   patch-configure.diff
82
83# (3) (a) Tweak various scripts to allow easy replacement of
84# MACOSX_DEPLOYMENT_TARGET: build for just the user's current OS.
85# (b) Assign initial OBJECTIVE_CXXFLAGS.
86
87patchfiles-append   patch-mkspecs_common_g++-macx.conf.diff
88
89# (4) (a) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build
90# for just the user's current OS; (b) allow QMake to use 'ccache' via,
91# e.g., "qmake && make CCACHE=ccache".
92
93patchfiles-append   patch-mkspecs_common_mac.conf.diff
94
95# (5) Place the -I path for local moc-created headers -before-
96# all other -I paths.
97
98patchfiles-append   patch-mkspecs_features_moc.prf.diff
99
100# (6) Remove Qt's LIBDIR and INCDIR from various QMake internal
101# variables, since they are already included in the user-supplied
102# LIBS and INCLUDEPATH.
103
104patchfiles-append   patch-mkspecs_features_qt.prf.diff
105
106# (7) (a) Change placement of Qt's LIBDIR and INCDIR, to always be
107# after those supplied by the user's QMake (.pro) files.  By the time
108# QMake gets to the patched function, it is creating the Makefile
109# parts to find Qt's headers and libraries, so moving these paths to
110# this location should always work. (b) If the library is QtWebKit,
111# and the build is library (no-framework), universal, and debug, then
112# the linkage is just -lQtWebKit, not -lQtWebKit_debug because the
113# debug library for 32-bit system cannot be created (too large).
114
115patchfiles-append   patch-mkspecs_features_qt_functions.prf.diff
116
117# (7.1) (a) Change "gcc" and "g++" to @'s for replacement in
118# post-patch; (b) add hooks for C++11.
119
120patchfiles-append   patch-mkspecs_common_g++-base.conf.diff
121
122# (7.2) Add default QMake variables for Objective C++.
123
124patchfiles-append   patch-mkspecs_objective_cxx.diff
125
126# (8) Add "absolute_library_soname" to the default CONFIG variables,
127# so that when a DYLIB is created, if "target.path" is set for it then
128# that path is prepended to its "install_name".
129
130patchfiles-append   patch-mkspecs_macx-g++_qmake.conf.diff
131
132# (9) Add QT_INSTALL_FRAMEWORKS and related variables to QMake, to
133# provide a default variable for the location of QMake installed
134# frameworks.
135
136patchfiles-append   \
137    patch-qmake_option.h.diff \
138    patch-qmake_property.cpp.diff \
139    patch-src_corelib_global_qlibraryinfo.cpp.diff \
140    patch-src_corelib_global_qlibraryinfo.h.diff
141
142# (10) In QMake, disable default MKSPECS and FEATURES path
143# concatinations if the shell environment variable QMAKE_NO_DEFAULTS
144# is set (to anything); we use this variable in this portfile to make
145# sure only internal paths (to the build) are searched by QMake.
146
147patchfiles-append   patch-qmake_project.cpp.diff
148
149# (10.1) In QMake: (a) enable correct "-framework foo,bar" parsing as
150# specified by Apple's LD; (b) disable "/Library/Frameworks" as a
151# default search path; use "PREFIX/Library/Frameworks" and replace
152# PREFIX in post-patch.  Also set "PREFIX/lib" as a default library
153# search path.
154
155patchfiles-append   patch-qmake_generators_unix_unixmakke.cpp.diff
156
157# (11) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build for
158# just the user's current OS.
159
160patchfiles-append   \
161    patch-qmake_qmake.pri.diff \
162    patch-src_tools_bootstrap_bootstrap.pro.diff
163
164# (12) fix use of CARBON, found on PPC64; does not hurt others
165
166patchfiles-append   \
167    patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff \
168    patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff
169
170# (13) fix MKSPECS install location for WebKit; fix WebCore to handle
171# 32-bit compiling correctly on x86 and ppc
172
173patchfiles-append   \
174    patch-src_3rdparty_webkit_Source_WebKit_qt_QtWebKit.pro.diff
175
176# (14) fix the corewlan qmake file to use non-standard Developer SDK
177# location under 10.6 and newer, e.g., for some developers doing both
178# iOS and OSX.  This patch does not change behavior for 10.4 or 10.5.
179# Also include fix to use the correct SDK.
180
181patchfiles-append   patch-src_plugins_bearer_corewlan_corewlan.pro.diff
182
183# (15) fix the corewlan source to work: this patch create a new
184# (primary) file qcorewlanengine.mm for 10.7 and newer APIs and a
185# secondary one qcorewlanengine_10_6.mm for 10.6 and older APIs.  The
186# primary file internally selects which one to use.
187
188patchfiles-append   patch-src_plugins_bearer_corewlan_qcorewlanengine.mm.diff
189
190# (16) Use the "target.path" for libdir for core libraries instead of
191# the standard QT_INSTALL_LIBS; allows us to set for library or
192# framework elsewhere and have the install still work here.
193
194patchfiles-append   patch-src_qbase.pri.diff
195
196# (17) (a) Disable explicit disabling of framework or static install;
197# i.e., install as a framework if that mode is selected, and as
198# library otherwise. (b) If installing as framework, use the new
199# QT_INSTALL_FRAMEWORKS directory; otherwise, use the old
200# QT_INSTALL_LIBS; (c) Get PKGCONFIG dependencies correct, hopefully;
201# (d) create and install .pc, .la, and .prl library description files,
202# including basic path replacement into DESTDIR; we couple this with a
203# post-patch to get the correct install location.
204
205patchfiles-append   \
206    patch-src_qt_install.pri.diff \
207    patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff \
208    patch-tools_assistant_lib_lib.pro.diff \
209    patch-tools_designer_src_components_lib_lib.pro.diff \
210    patch-tools_designer_src_lib_lib.pro.diff \
211    patch-tools_designer_src_uitools_uitools.pro.diff \
212    patch-mkspecs_features_uitools.prf.diff
213
214# (18) fix 'macdeployqt' to look for the correct plugins location by
215# default.  This is paired with a "reinplace" in post-patch
216
217patchfiles-append   \
218    patch-tools_macdeployqt_macdeployqt_main.cpp.diff
219
220# (19) Under 10.4 only: patch QMake build files using just "-lQtHelp"
221# to do "-lQtHelp -lQtCLucene -lQtNetwork -lQtWebKit" instead.  For
222# some reason 10.5+ "knows" that how to do this correctly.
223
224platform darwin 8 {
225    patchfiles-append patch-QtHelp_10.4_only.diff
226}
227
228# (20) fix the Mac timer's use of "mach_timebase_info"
229
230patchfiles-append   \
231    patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff
232
233# (21) fix WebCore to handle 32-bit compiling correctly on x86 and ppc
234
235patchfiles-append   \
236    patch-src_3rdparty_webkit_Source_WebCore_WebCore.pro.diff
237
238# (22) Under 10.8 and 10.9: Patch to fix corelib linking
239
240platform darwin {
241    if {${os.major} > 12} {
242        patchfiles-append patch-src_corelib_corelib.pro.diff
243    }
244}
245
246# (23) fix Framework directory in MacDeployQt tool
247
248patchfiles-append   \
249    patch-tools_macdeployqt_shared_shared.cpp.diff
250
251# (24) Fix build against libc++
252
253patchfiles-append   \
254    patch-libc++.diff
255
256# (25) Fix CLuscene to build under 10.9 CLang
257# (26) Fix qglobals.h to build under 10.9 CLang
258# (27 a-e) Fix WebKit to build under 10.9 CLang
259
260platform darwin 13 {
261    patchfiles-append   \
262        patch-src_3rdparty_clucene_src_CLucene_search_FieldCacheImpl.cpp.diff \
263        patch-src_corelib_global_qglobal.h.diff \
264        patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.h.diff \
265        patch-src_3rdparty_webkit_Source_WebCore_platform_Timer.cpp.diff \
266        patch-src_3rdparty_webkit_Source_WebKit_qt_WebCoreSupport_NotificationPresenterClientQt.cpp.diff \
267        patch-src_3rdparty_webkit_Source_WebKit_qt_Api_qgraphicswebview.cpp.diff \
268        patch-src_3rdparty_webkit_Source_WebCore_platform_network_qt_QNetworkReplyHandler.cpp.diff
269}
270
271platform darwin {
272    if {${os.major} > 13} {
273        # This project needs to be updated to build with clang++ against libc++
274        depends_lib
275        depends_run
276        pre-fetch {
277            ui_error "$name does not build on OSX later than 10.9 'Mavericks'."
278            error "unsupported platform"
279        }
280    }
281}
282
283###############################################
284
285# disable CCACHE for now (ticket #34856)
286
287configure.ccache no
288
289# find a way to specify the OS MINOR version.
290global MINOR
291set MINOR ""
292
293# hopefully the macosx_deployment_target exists and is set by now.  if
294# not, last resort (which is not desirable) is to use the os.version.
295if {${macosx_deployment_target} != ""} {
296    set MINOR [lindex [split ${macosx_deployment_target} "."] 1]
297} else {
298    set MINOR [expr [lindex [split ${os.version} "."] 0] - 4]
299}
300
301# find a way to specify the SDK to use; Qt will use the 10.4u by
302# default which won't work on 10.6 since it is not supported.  Allow
303# the user to specify the SDK if desired.
304
305global SDK
306set SDK ${configure.sdkroot}
307if {${SDK} == ""} {
308    # set SDK version depending on OS version
309    set sdk_version ""
310    if {${MINOR} == "4"} {
311        # OSX 10.4 requires an additional 'u'
312        set sdk_version "10.4u"
313    } else {
314        set sdk_version "10.${MINOR}"
315    }
316    if {[vercmp ${xcodeversion} 4.3] < 0} {
317        set SDK ${developer_dir}/SDKs/MacOSX${sdk_version}.sdk
318    } else {
319        set SDK ${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${sdk_version}.sdk
320    }
321}
322
323post-patch {
324    # set ARCHES in configure (per the third patchfile above), for
325    # building QMake.  join any 2 or more arch entries with the GCC
326    # arch flag (join does not effect a single entry).  first "-arch"
327    # is already in place in the 'configure' script (since there has
328    # to be at least 1 arch).
329    set ARCHES ""
330    if {[variant_exists universal] && [variant_isset universal]} {
331        set ARCHES [join ${universal_archs} " -arch "]
332    } else {
333        set ARCHES ${build_arch}
334    }
335    reinplace "s|@ARCHES@|${ARCHES}|g" ${worksrcpath}/configure
336
337    # set MACOSX_DEPLOYMENT_TARGET version in various places.  These
338    # were all patched in (2) above, and can be easily changed or
339    # overridden by the user in a project-local qmake .pro script.
340    set TARGET "10.${MINOR}"
341    foreach fixfile {configure mkspecs/common/g++-macx.conf \
342                     mkspecs/common/mac.conf qmake/qmake.pri \
343                     src/tools/bootstrap/bootstrap.pro } {
344        reinplace "s|@MACOSX_DEPLOYMENT_TARGET@|${TARGET}|g" \
345            ${worksrcpath}/${fixfile}
346    }
347
348    # Fix OS version on Bearer CoreWLAN QMake file
349    reinplace "s|@MACOSX_VERSION_MINOR@|${MINOR}|g" \
350        ${worksrcpath}/src/plugins/bearer/corewlan/corewlan.pro
351
352    # Ensure that correct C/C++ compilers are used.
353
354    reinplace "s|@CXX@|${configure.cxx}|" \
355        ${worksrcpath}/mkspecs/common/g++-base.conf
356    reinplace "s|@CC@|${configure.cc}|"  \
357        ${worksrcpath}/mkspecs/common/g++-base.conf
358
359    # fix the corewlan .pro file to use the correct developer SDK
360
361    reinplace "s,@DEVELOPER_SDK@,${SDK},g" \
362        ${worksrcpath}/src/plugins/bearer/corewlan/corewlan.pro
363
364    # fix 'macdeployqt' to look for the correct plugins location by default.
365
366    reinplace "s,@QT_PLUGINS_DIR@,${qt_plugins_dir},g" \
367        ${worksrcpath}/tools/macdeployqt/macdeployqt/main.cpp
368
369    # fix PREFIX in QMake makefile generator
370
371    reinplace "s,@PREFIX@,${qt_dir},g" \
372        ${worksrcpath}/qmake/generators/unix/unixmake.cpp
373
374    # if no debug, then do not even build debug code
375
376    if {![variant_isset debug]} {
377        foreach fixfile { src/qbase.pri \
378                          src/3rdparty/webkit/Source/WebKit.pri \
379                          src/imports/qimportbase.pri \
380                          src/plugins/qpluginbase.pri \
381                          tools/designer/src/components/lib/lib.pro \
382                          tools/designer/src/lib/lib.pro \
383                          tools/designer/src/plugins/activeqt/activeqt.pro \
384                          tools/designer/src/plugins/plugins.pri \
385                          tools/designer/src/uitools/uitools.pro \
386                          src/3rdparty/webkit/Source/WebKit/qt/declarative/declarative.pro } {
387            reinplace "/+=/s@debug_and_release@@g" \
388                ${worksrcpath}/${fixfile}
389        }
390    }
391
392    # copy C++11 files into place, if that variant is set
393
394    if {[variant_isset cxx11]} {
395        copy ${filespath}/c++11.prf ${worksrcpath}/mkspecs/features
396        copy ${filespath}/c++11 ${worksrcpath}/config.tests/mac
397    }
398
399    # copy Objective C / CXX files into place
400
401    copy ${filespath}/objective_cxx.prf \
402        ${worksrcpath}/mkspecs/features/mac
403    copy ${filespath}/split_sources.prf \
404        ${worksrcpath}/mkspecs/features/mac
405
406    # copy extra compiler tests into place; these are patched into the
407    # configure script to the area before qmake is built.  If any
408    # fail, configure will fail quickly.
409
410    copy ${filespath}/fconstant_cfstrings.test \
411        ${worksrcpath}/config.tests/mac
412    copy ${filespath}/objc_block \
413        ${worksrcpath}/config.tests/mac
414    copy ${filespath}/cpath \
415        ${worksrcpath}/config.tests/mac
416    copy ${filespath}/library_path \
417        ${worksrcpath}/config.tests/mac
418
419    platform darwin 13 {
420
421        # Copy new Version of webkits' lib for OSX 10.9 only.
422        # Attached by reference:
423        # https://codereview.qt-project.org/#change,69328
424        # http://trac.webkit.org/browser/trunk/WebKitLibraries/ChangeLog?rev=157771
425
426        copy ${distpath}/libWebKitSystemInterfaceMavericks.a \
427            ${worksrcpath}/src/3rdparty/webkit/WebKitLibraries
428    }
429}
430
431# Block various compilers:
432#
433# * The build process requires -Xarch, -fconstant-cfstring, and
434# Objective-C(++) blocks (^), which are not supported with vanilla GCC
435# as installed by MacPorts but are supported by all versions of CLANG
436# (both MacPorts' and Apple's).
437#
438# * Some older versions of CLANG do not honor the CPATH
439# environment variables, which is required for compiling
440# this port when using MacPorts.  The versions seem to be: MacPorts
441# CLANG 2.9 or earlier, and Apple CLANG 318.0.58 or older.
442#
443# * Some older versions of CLANG do not honor the LIBRARY_PATH
444# environment variables, which is required for compiling
445# this port when using MacPorts.  The versions seem to be: MacPorts
446# CLANG 3.0 or earlier, and Apple CLANG 318.0.61 or older.
447#
448# See also:
449# < http://llvm.org/bugs/show_bug.cgi?id=8971 >,
450# < https://trac.macports.org/ticket/30271 >,
451# < https://trac.macports.org/ticket/31076 >,
452# < https://trac.macports.org/ticket/31638 >, and
453# < https://trac.macports.org/ticket/37868 >.
454#
455# NOTE: qt4-mac augments the standard Qt4 configure script with
456# pre-qmake-build tests for CPATH, LIBRARY_PATH, -Xarch,
457# -fconstant-cfstring, Objective-C(++) blocks, and, if requested,
458# C++11.  The script will error out quickly if the compiler does not
459# seem to provide support for any one of these properties, no matter
460# this blacklist.
461
462compiler.blacklist-append { clang <= 318.0.61 } \
463    macports-gcc-4.1 macports-gcc-4.2 macports-gcc-4.3 \
464    macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 \
465    macports-gcc-4.7 macports-gcc-4.8 \
466    macports-clang-2.9 macports-clang-3.0
467
468# --prefix is not recognized.
469configure.pre_args-delete       --prefix=${prefix}
470
471# --disable-dependency-tracking is not recognized.
472configure.universal_args-delete --disable-dependency-tracking
473
474# Use compiler.cpath and compiler.library_path for all -I and -L
475# entries, so-as to avoid conflicts with already-installed headers and
476# libraries (giving preference to internal-to-this-port first).  CPATH
477# is used instead of -I to avoid conflicts with other ports.
478#
479# See also:
480# < https://trac.macports.org/ticket/15219 >,
481# < https://trac.macports.org/ticket/18723 >, and
482# < https://trac.macports.org/ticket/25321 >.
483
484# set the default paths to include those for SQLITE3 and DBUS-1
485
486set header_path [ list ${prefix}/include/dbus-1.0 \
487                       ${prefix}/lib/dbus-1.0/include \
488                       ${prefix}/include ]
489
490set library_path [ list ${prefix}/lib ]
491
492# -dbus-linked prevends qt4 from trying to dynamically load libdbus-1,
493#     which it is not able to find in ${prefix}.
494#
495# -openssl-linked ensures that the MacPorts openssl is used.
496#
497# -framework ensures that this port is installed as frameworks
498#     (collections of {library, headers, resources}); in
499#     post-destroot, link headers and libraries from the frameworks
500#     into non-framework locations as if "-no-framework" were
501#     specified.  Some dependent projects will not work properly if Qt
502#     is installed as libraries by default, thus make it so #1.
503#
504# -no-phonon ensures that Qt does not install the 3rd-parth Phonon
505#     port or its backend to QuickTime 7; Phonon is now installed via
506#     the 'phonon' port, which is more up to date than that provided
507#     by Qt.
508
509configure.args                                            \
510    -v                                                    \
511    -confirm-license                                      \
512    -opensource                                           \
513    -prefix          ${qt_dir}                            \
514    -bindir          ${qt_bins_dir}                       \
515    -libdir          ${qt_libs_dir}                       \
516    -docdir          ${qt_docs_dir}                       \
517    -headerdir       ${qt_includes_dir}                   \
518    -plugindir       ${qt_plugins_dir}                    \
519    -importdir       ${qt_imports_dir}                    \
520    -datadir         ${qt_data_dir}                       \
521    -translationdir  ${qt_translations_dir}               \
522    -sysconfdir      ${qt_sysconf_dir}                    \
523    -examplesdir     ${qt_examples_dir}                   \
524    -demosdir        ${qt_demos_dir}                      \
525    -openssl-linked                                       \
526    -dbus-linked                                          \
527    -fast                                                 \
528    -optimized-qmake                                      \
529    -no-pch                                               \
530    -framework                                            \
531    -no-phonon                                            \
532    -no-phonon-backend
533
534# Stop configure script from searching for SQL Drivers
535#    not available from MacPorts.
536foreach driver {db2 ibase oci tds} {
537    configure.args-append -no-sql-${driver}
538}
539
540# Disable all remaining SQL Drivers.  These are available via the
541# ports qt4-mac-*-plugin.
542
543foreach driver {mysql odbc psql sqlite sqlite2} {
544    configure.args-append -no-sql-${driver}
545}
546
547pre-configure {
548    # use the corrected CPATH and LIBRARY_PATH for build
549    compiler.cpath [join ${header_path} :]
550    compiler.library_path [join ${library_path} :]
551
552    # for 10.4 or 10.5 32-bit PPC, build as Carbon only, not Cocoa
553
554    if {${MINOR} == "4"} {
555
556        configure.args-append -carbon
557
558        # required linking flags?
559
560        configure.ldflags-append -lcrypto -ldbus-1 -ljpeg -llcms \
561            -lssl -lz
562
563    } elseif {${MINOR} == "5" &&
564              [llength ${qt_arch_types}] == 1 &&
565              [lsearch -exact ${qt_arch_types} ppc] == 0} {
566
567        configure.args-append -carbon
568
569    }
570
571    # set the arch type(s) to use, in Qt-speak
572
573    configure.args-append -arch \"${qt_arch_types}\"
574
575    # cannot use pre-compiled headers when compiling with more than 1
576    # arch type (typically +universal) or for X11
577
578    #if {[llength ${qt_arch_types}] != 1 || [variant_isset x11]}
579
580    # check to see if not compiling for the native machine hardware
581    # (e.g., compiling for just i386 but CPU is x86_64); optimization
582    # of QMake does not work in this circumstance.
583
584    if {[lsearch -exact ${qt_arch_types} ${os.arch}] == -1} {
585
586        # not building for native arch: disable optimizing qmake
587        configure.args-delete -optimized-qmake
588
589    } elseif {${MINOR} == "6" &&
590              [llength ${qt_arch_types}] == 1 &&
591              [lsearch -exact ${qt_arch_types} x86] == 0} {
592
593        # disable qmake optimization on 10.6 32-bit
594        configure.args-delete -optimized-qmake
595
596    }
597
598    # set the SDK, if it was found and exists
599
600    if {[file exists ${SDK}]} {
601        configure.args-append -sdk ${SDK}
602    }
603
604    # set which pkg-config to use
605
606    configure.env-append PKG_CONFIG=${prefix}/bin/pkg-config
607
608    # set which stdlib to use; clang only; use configure.cxx_stdlib if
609    # that exists, and otherwise use libc++ on 10.9 or libstdc++ on
610    # 10.8 or earler.
611
612    if {[string match *clang* ${configure.compiler}]} {
613        if {[info exists configure.cxx_stdlib]} {
614            configure.env-append QMAKE_STDLIB="-stdlib=${configure.cxx_stdlib}"
615        } elseif {${MINOR} = "9"} {
616            configure.env-append QMAKE_STDLIB="-stdlib=libc++"
617        } else {
618            configure.env-append QMAKE_STDLIB="-stdlib=libstdc++"
619        }
620    }
621}
622
623post-configure {
624
625    # Remove any '-I' and '-L' string from the *FLAGS for SQLITE,
626    # DBUS, ODBC, and OPENSSL, so that what remains are just non-I/L
627    # flags; these paths are in compiler.cpath and
628    # compiler.library_path.  The header and library paths for all the
629    # other variants are not used by 'configure', and are already
630    # included in the compiler.cpath and compiler.library_path
631    # . during the 'build' stage, 'make' will rebuild the Makefiles
632    # that depend on any of these changed files.  These patches are
633    # sufficient to make sure local (to this build) paths are searched
634    # first, and then system paths last (via the compiler.X settings).
635    # Ideally, 'qmake' -- either via its mkspecs files or the
636    # project's build files -- would distinguish between "local" and
637    # "system" includes & libraries.
638
639    # SQLITE
640    reinplace "/SQLITE/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
641        ${worksrcpath}/.qmake.cache
642    reinplace "/SQLITE/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
643        ${worksrcpath}/.qmake.cache
644    # DBUS
645    reinplace "/DBUS/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
646        ${worksrcpath}/.qmake.cache
647    reinplace "/DBUS/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
648        ${worksrcpath}/.qmake.cache
649    # OPENSSL
650    reinplace "/OPENSSL/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
651        ${worksrcpath}/.qmake.cache
652    reinplace "/OPENSSL/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
653        ${worksrcpath}/.qmake.cache
654    # ODBC
655    reinplace "/ODBC/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
656        ${worksrcpath}/.qmake.cache
657    reinplace "/ODBC/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
658        ${worksrcpath}/.qmake.cache
659}
660
661pre-build {
662    # use the corrected CPATH and LIBRARY_PATH for build
663    compiler.cpath [join ${header_path} :]
664    compiler.library_path [join ${library_path} :]
665}
666
667# do not use DESTDIR directly in the destroot command; Qt uses DISTDIR
668# internally for other purposes, and instead uses INSTALL_ROOT for the
669# additional install root prefix.
670
671destroot.post_args
672
673post-destroot {
674
675    set destroot_qt ${destroot}${qt_dir}
676
677    # Fix .pc and .prl files by changing ${worksrcpath}\${prefix} to
678    # ${qt_dir}\${prefix} ("\" means 'take away').  Cannot use
679    # "find -E" since it is not necessarily portable.
680
681    regsub ${prefix} ${worksrcpath} "" from_dir
682    regsub ${prefix} ${qt_dir} "" to_dir
683    foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
684        reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
685    }
686    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
687        reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
688    }
689
690    # fix .pc files
691
692    foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
693
694        # remove Libs.private; they can mess up linking
695
696        reinplace "/Libs\.private/d" ${fixfile}
697
698        # use ${prefix} correctly
699
700        reinplace "s|${prefix}/|\${prefix}/|g" ${fixfile}
701
702        # fix libdir
703
704        reinplace "/libdir=/s|Library/Frameworks|lib|" ${fixfile}
705
706        # fix Libs: to use -L instead of -F
707
708        reinplace "/Libs:/s|-F|-L|" ${fixfile}
709
710        # fix Libs: to use -lQt* instead of "-framework Qt*"
711        # depends on whether for release or debug
712
713        set fn [lindex [split ${fixfile} /] end]
714
715        if {[lsearch -regexp ${fn} debug] == 0} {
716
717            # debug; need to add that string to all Qt dependency libraries
718            reinplace "/Libs:/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|" \
719                ${fixfile}
720
721        } else {
722
723            # no debug; just replace
724            reinplace "/Libs:/s|-framework Qt|-lQt|" ${fixfile}
725
726        }
727    }
728
729    # move .pc files from ${qt_frameworks_dir}/pkgconfig to
730    # ${qt_pkg_config_dir}
731
732    file delete -force ${destroot}${qt_pkg_config_dir}
733    xinstall -m 755 -d ${destroot}${qt_libs_dir}
734    move ${destroot}${qt_frameworks_dir}/pkgconfig \
735        ${destroot}${qt_libs_dir}
736
737    # move .la files from ${qt_frameworks_dir} to ${qt_libs_dir}
738
739    foreach laf [glob ${destroot}/${qt_frameworks_dir}/*.la] {
740        move ${laf} ${destroot}${qt_libs_dir}
741    }
742
743    # remove -L entries from .prl and .la files
744
745    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
746        reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile}
747    }
748    foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
749        reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile}
750    }
751
752    # remove redundant -F entries from .prl and .la files
753
754    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
755        reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \
756            ${fixfile}
757        reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*||g" ${fixfile}
758        reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
759            ${fixfile}
760    }
761    foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
762        reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \
763            ${fixfile}
764        reinplace "/dependency_libs/s|-F\[^ \]*||g" ${fixfile}
765        reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
766            ${fixfile}
767    }
768
769    # get Qt's version numbers
770
771    set qt_vers [split ${version} "."]
772    set qt_major [lindex ${qt_vers} 0]
773    set qt_minor [lindex ${qt_vers} 1]
774    set qt_patch [lindex ${qt_vers} 2]
775
776    # link includes and libraries for each actual installed framework
777
778    foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
779                         -name "*.framework" | \
780                         sed -e "s@${destroot}@@g"] {
781
782        set tf_full [strsed ${fixfile} {s@\\.framework@@}]
783        set tf [strsed ${tf_full} {g@.*\/@@}]
784
785        # special for QtWebKit entries
786
787        set t_minor ${qt_minor}
788        set is_QtWebKit 0
789        if {[string compare ${tf} QtWebKit] == 0} {
790            set t_minor 9
791            set is_QtWebKit 1
792        }
793
794        # link headers into ${qt_includes_dir}, removing directories
795        # if they are already there first
796
797        set inc_file ${destroot}${qt_includes_dir}/${tf}
798        if {[file exists ${inc_file}]} {
799            file delete -force ${inc_file}
800        }
801        ln -s ${tf_full}.framework/Headers ${inc_file}
802
803        # link libraries into ${qt_libs_dir}, all 4 number variants
804
805        set dr_qt_libs_dir ${destroot}${qt_libs_dir}
806
807        ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib
808        ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.dylib
809        ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.dylib
810        ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib
811
812        # copy .prl file, then correct it for library usage
813
814        copy ${destroot}${tf_full}.framework/${tf}.prl ${dr_qt_libs_dir}/lib${tf}.prl
815
816        # fix TARGET in .prl file
817
818        reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}.prl
819
820        # fix PRL_LIBS -F -> -L in .prl file
821
822        reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}.prl
823
824        # fix "-framework Qt*" -> "-lQt*" in .prl file
825
826        reinplace "/QMAKE_PRL_LIBS/s|-framework Qt|-lQt|g" \
827            ${dr_qt_libs_dir}/lib${tf}.prl
828
829        # fix up .la files to work with ${prefix}/lib entries
830
831        # rename .la file
832
833        move ${dr_qt_libs_dir}/${tf}.la ${dr_qt_libs_dir}/lib${tf}.la
834
835        # fix "name that we can dlopen" in .la file
836
837        reinplace "s|dlname=''|dlname='lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib'|" ${dr_qt_libs_dir}/lib${tf}.la
838
839        # fix "names of this library" in .la file
840
841        reinplace "s|library_names='\[^'\]*'|library_names='lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib lib${tf}.${qt_major}.${t_minor}.dylib lib${tf}.${qt_major}.dylib lib${tf}.dylib'|" \
842            ${dr_qt_libs_dir}/lib${tf}.la
843
844        # fix "name of the static archive"; there is none in .la file
845
846        reinplace "s|old_library='\[^'\]*'|old_library=''|" \
847            ${dr_qt_libs_dir}/lib${tf}.la
848
849        # fix "libraries that this one depends upon" in .la file
850
851        reinplace "/dependency_libs/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|"  ${dr_qt_libs_dir}/lib${tf}.la
852        reinplace "/dependency_libs/s|-framework Qt|-lQt|g" \
853            ${dr_qt_libs_dir}/lib${tf}.la
854        reinplace "/dependency_libs/s| ${worksrcpath}\[^ \]*||g" \
855            ${dr_qt_libs_dir}/lib${tf}.la
856        reinplace "/dependency_libs/s| -lwebcore||" \
857            ${dr_qt_libs_dir}/lib${tf}.la
858        reinplace "/dependency_libs/s| -ljscore||" \
859            ${dr_qt_libs_dir}/lib${tf}.la
860
861        # fix "directory that this library needs to be installed in" in .la file
862
863        reinplace "/libdir/s|${qt_frameworks_dir}|${qt_libs_dir}|" \
864            ${dr_qt_libs_dir}/lib${tf}.la
865
866        # deal with debug files
867
868        if {[variant_isset debug]} {
869
870            # but not if QtWebKit and +universal, since that one does
871            # not exist (the 32-bit version of the debug library is
872            # larger than fits into the 32-bit filespace).
873
874            if {[variant_isset debug] && ${is_QtWebKit}} {
875                continue
876            }
877
878            # link libraries into ${qt_libs_dir}, all 4 number variants
879
880            ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.dylib
881            ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.dylib
882            ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.dylib
883            ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib
884
885            # copy .prl file, then correct it for library usage
886
887            copy ${destroot}${tf_full}.framework/${tf}_debug.prl ${dr_qt_libs_dir}/lib${tf}_debug.prl
888
889            # fix TARGET in .prl file
890
891            reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}_debug.prl
892
893            # fix PRL_LIBS -F -> -L in .prl file
894
895            reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.prl
896
897            # fix "-framework Qt*" -> "-lQt*_debug" in .prl file
898
899            reinplace "/QMAKE_PRL_LIBS/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.prl
900
901            # fix up .la files to work with ${prefix}/lib entries
902
903            # rename .la file
904
905            move ${dr_qt_libs_dir}/${tf}_debug.la \
906                ${dr_qt_libs_dir}/lib${tf}_debug.la
907
908            # fix "name that we can dlopen" in .la file
909
910            reinplace "s|dlname=''|dlname='lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib'|" ${dr_qt_libs_dir}/lib${tf}_debug.la
911
912            # fix "names of this library" in .la file
913
914            reinplace "s|library_names='\[^'\]*'|library_names='lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib lib${tf}_debug.${qt_major}.${t_minor}.dylib lib${tf}_debug.${qt_major}.dylib lib${tf}_debug.dylib'|" \
915                ${dr_qt_libs_dir}/lib${tf}_debug.la
916
917            # fix "name of the static archive"; there is none in .la file
918
919            reinplace "s|old_library='\[^'\]*'|old_library=''|" \
920                ${dr_qt_libs_dir}/lib${tf}_debug.la
921
922            # fix "libraries that this one depends upon" in .la file
923
924            reinplace "/dependency_libs/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.la
925            reinplace "/dependency_libs/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.la
926            reinplace "/dependency_libs/s| ${worksrcpath}\[^ \]*||g" \
927                ${dr_qt_libs_dir}/lib${tf}_debug.la
928            reinplace "/dependency_libs/s| -lwebcored||" \
929                ${dr_qt_libs_dir}/lib${tf}_debug.la
930            reinplace "/dependency_libs/s| -ljscored||" \
931                ${dr_qt_libs_dir}/lib${tf}_debug.la
932
933            # fix "directory that this library needs to be installed in" in .la file
934
935            reinplace "/libdir/s|${qt_frameworks_dir}|${qt_libs_dir}|" \
936                ${dr_qt_libs_dir}/lib${tf}_debug.la
937
938        }
939    }
940
941    # Install documentation.
942
943    xinstall -m 755 -d ${worksrcpath}/${qt_docs_dir}
944    xinstall -m 644 -W ${worksrcpath} \
945        INSTALL LGPL_EXCEPTION.txt LICENSE.FDL \
946        LICENSE.GPL3 LICENSE.LGPL README \
947        ${destroot}${qt_docs_dir}
948
949    # Install private headers needed by QtCreator
950
951    foreach {src_dir include_dir} \
952    {corelib QtCore gui QtGui script QtScript declarative QtDeclarative} {
953        set dest_dir ${destroot}${qt_frameworks_dir}/${include_dir}.framework/Headers/private
954        xinstall -m 755 -d ${dest_dir}
955        set files [exec find ${worksrcpath}/src/${src_dir} -type f -name "*_p.h"]
956        eval xinstall -m 644 [split ${files}] ${dest_dir}
957    }
958
959    # Move .apps into the applications_dir, and link each .apps'
960    # executable back into ${qt_bins_dir}
961
962    set dr_qt_apps_dir ${destroot}${qt_apps_dir}
963    set dr_qt_bins_dir ${destroot}${qt_bins_dir}
964
965    xinstall -m 755 -d ${dr_qt_apps_dir}
966    foreach app [glob ${dr_qt_bins_dir}/*.app] {
967
968        # remove the leading stuff
969
970        set app [lindex [split ${app} /] end]
971
972        # move the .app
973
974        move ${dr_qt_bins_dir}/${app} ${dr_qt_apps_dir}
975
976        # link the app's executable back
977
978        set texe [strsed ${app} {g@\.app@@}]
979        ln -s ${qt_apps_dir}/${app}/Contents/MacOS/${texe} \
980            ${dr_qt_bins_dir}
981
982    }
983
984    # move tests to ${qt_data_dir}
985
986    xinstall -m 755 -d ${destroot}${qt_data_dir}
987    move ${destroot_qt}/tests/qt4 ${destroot}${qt_data_dir}/tests
988
989    # install ${qt_includes_dir}/Qt if not already and it exists in
990    # the build, for support of legacy projects
991
992    if {![file exists ${destroot}${qt_includes_dir}/Qt] &&
993        [file exists ${worksrcpath}/include/Qt]} {
994
995        # copy the Qt headers directory
996
997        copy ${worksrcpath}/include/Qt ${destroot}${qt_includes_dir}
998
999    }
1000
1001    # link in Resource to ${qt_libs_dir}
1002
1003    ln -s ${qt_frameworks_dir}/QtGui.framework/Resources \
1004        ${destroot}${qt_libs_dir}
1005
1006}
1007
1008pre-activate {
1009    # make sure 'none' is selected by qt4_select, so that there is no
1010    # conflict between it and this port.
1011    if {[file exists ${prefix}/bin/qt4_select]} {
1012        if {[exec ${prefix}/bin/qt4_select -s] != "none"} {
1013            ui_msg "Disabling 'qt4_select' selection."
1014            system "exec ${prefix}/bin/qt4_select none"
1015        }
1016    }
1017}
1018
1019variant framework description {Framework Legacy Compatibility Variant} {
1020    ui_error "${name} variant +framework has been disabled because ${name} now installs as both libraries and frameworks.  Please install ${name} without +framework."
1021    return -code error "Variant disabled"
1022}
1023
1024variant mysql description {MySQL Qt4 Plugin Legacy Compatibility Variant} {
1025    ui_error "${name} variant +mysql has been replaced by the port 'qt4-mac-mysql55-plugin' and its subports.  Please install ${name} without +mysql, then install your desired MySQL Qt plugin."
1026    return -code error "Variant disabled"
1027}
1028
1029variant odbc description {Enable iODBC SQL Driver} {
1030    depends_lib-append port:libiodbc
1031    configure.args-delete -no-sql-odbc
1032    configure.args-append -plugin-sql-odbc
1033}
1034
1035variant psql83 conflicts psql84 psql90 psql91 \
1036description {PostgreSQL 8.3 Qt4 Plugin Legacy Compatibility Variant} {}
1037
1038variant psql84 conflicts psql83 psql90 psql91 \
1039description {PostgreSQL 8.4 Qt4 Plugin Legacy Compatibility Variant} {}
1040
1041variant psql90 conflicts psql83 psql84 psql91 \
1042description {PostgreSQL 9.0 Qt4 Plugin Legacy Compatibility Variant} {}
1043
1044variant psql91 conflicts psql83 psql84 psql90 \
1045description {PostgreSQL 9.1 Qt4 Plugin Legacy Compatibility Variant} {}
1046
1047global psql_version
1048set psql_version ""
1049
1050if {[variant_isset psql83]} {
1051    set psql_version "83"
1052} elseif {[variant_isset psql84]} {
1053    set psql_version "84"
1054} elseif {[variant_isset psql90]} {
1055    set psql_version "90"
1056} elseif {[variant_isset psql91]} {
1057    set psql_version "91"
1058}
1059
1060if {${psql_version} != ""} {
1061    ui_error "${name} variant +psql${psql_version} has been replaced by the port 'qt4-mac-postgresql91-plugin' and its subports.  Please install ${name} without +psql${psql_version}, then install your desired PostgreSQL Qt plugin."
1062    return -code error "Variant disabled"
1063}
1064
1065variant raster description {Use raster graphics system by default} {
1066    configure.args-append -graphicssystem raster
1067}
1068
1069variant demos description {Build demos} {}
1070
1071if {![variant_isset demos]} {
1072   configure.args-append -nomake demos
1073}
1074
1075variant examples description {Build examples} {}
1076
1077if {![variant_isset examples]} {
1078   configure.args-append -nomake examples
1079}
1080
1081variant debug description {Build both release and debug library} {}
1082
1083if {[variant_isset debug]} {
1084    configure.args-append -debug-and-release -declarative-debug
1085} else {
1086    configure.args-append -release -no-declarative-debug
1087}
1088
1089variant openvg description {Build with support for OpenVG} {
1090
1091    depends_lib-append port:mesa
1092
1093    pre-configure {
1094
1095        # set OpenVG arg, for both testing and building
1096
1097        configure.env-append QMAKE_OPENVG_ARG=-lOpenVG
1098
1099    }
1100}
1101
1102variant cxx11 description {Add library support for C++11 (EXPERIMENTAL)} {
1103
1104    # Block compilers that do not support C++11. This variant seems to
1105    # work with MacPorts' clang 3.0 or newer and Apple clang newer
1106    # than 318.0.58 (but, not that version, which is already blocked).
1107
1108    compiler.blacklist-append \
1109        apple-gcc-4.0 apple-gcc-4.2 \
1110        gcc-3.3 gcc-4.0 gcc-4.2 \
1111        llvm-gcc-4.2
1112
1113    pre-extract {
1114
1115        ui_msg "WARNING: You have enabled C++11 support for Qt4, which is EXPERIMENTAL.  Qt's libraries and applications (not including QMake) will be compiled using C++11.  That said, C++11 will NOT be enabled by default when using QMake.  You can enable C++11 by specifying, e.g. \'CONFIG += c++11\', in any QMake build file."
1116
1117    }
1118
1119    # patches for C++11 only
1120
1121    patchfiles-append patch-cxx11.diff
1122
1123    # have configure test for C++11; our hooks
1124    # will error out if C++11 is not found.
1125
1126    configure.args-append -c++11
1127
1128}
1129
1130post-activate {
1131    ui_msg "NOTE: Qt database plugins for mysql55, postgresql91, and sqlite2 are NOT installed by this port\; they are installed by qt4-mac-*-plugin instead."
1132}
1133
1134#variant quartz conflicts x11
1135#variant quartz \
1136#description {Build for Native OSX Quartz GUI, not X11 (default)} {}
1137
1138#variant x11 conflicts quartz \
1139#description {Build for X11 GUI, not Native OSX Quartz} {}
1140
1141# if neither +x11 or +quartz were specified, default to the latter
1142#if {![variant_isset quartz] && ![variant_isset x11]} {
1143#    default_variants +quartz
1144#}
1145
1146# check to see if user specified just "-quartz", which can't work.
1147#if {![variant_isset quartz] && ![variant_isset x11]} {
1148#    return -code error \
1149#"\n\nThe variant -quartz will not work alone.
1150#Please select one of +quartz or +x11 as a variant.\n"
1151#}
1152
1153#if {[variant_isset x11]} {
1154#    return -code error "\n\nVariant +x11 is not yet functional; \
1155#please use +quartz for now.\n"
1156#}
1157
1158livecheck.type      regex
1159livecheck.url       http://releases.qt-project.org/qt4/source
1160livecheck.regex     "qt-everywhere-opensource-src-(\[0-9a-z.-\]+)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.