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

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

qt4-mac:
+ use MINOR instead of os.version throughout; addresses ticket #43329;
+ MINOR is an integer, so treat is as such (e.g., use "==" etc instead of "eq");
+ fix livecheck for latest qt download method;
+ use just "error" instead of "return -code error".

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