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

Last change on this file since 97300 was 97300, checked in by rmstonecipher@…, 7 years ago

graphics/libpng upgraded to version 1.5.12, 232 dependent ports revision bumped due to library version number change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 27.6 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 97300 2012-09-03 03:05:48Z rmstonecipher@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
11
12name                qt4-mac
13conflicts           qt3 qt3-mac qt4-mac-devel
14version             4.8.2
15revision            3
16categories          aqua
17platforms           macosx
18maintainers         michaelld openmaintainer
19license             {LGPL-2.1 GPL-3}
20
21homepage            http://qt.nokia.com/
22description         Qt Tool Kit
23long_description    Qt Tool Kit: A cross-platform framework \
24                    (headers, data, and libraries) for writing \
25                    cross-platform GUI-based applications.
26
27master_sites        trolltech
28distname            qt-everywhere-opensource-src-${version}
29
30checksums           sha1    e1e2edef1d63ed677d6534d32800c2e1f7ad0e73 \
31                    rmd160  6a15077aee1e84076380787127b80c7bb97ebe86
32
33minimum_xcodeversions   {8 2.5}
34
35depends_lib-append  port:zlib path:bin/dbus-daemon:dbus \
36                    port:openssl port:sqlite3 port:tiff \
37                    port:libpng port:libmng port:jpeg
38
39###############################################
40# Patches are used to both fix compiling on various OS versions, and
41# to enhance the functionality of QMake and its build files.  Some of
42# these patches are 2-stage: use a file here, and the replace an
43# @VARIABLE@ in post-patch.  There are LOTS of patches, because Qt is
44# a large, complicated system.
45
46# (0) Fix the testing script to properly handle both +universal as
47# well as the native arch for both CXX and CC compiling; also make
48# sure it does not create a Mac app bundle.
49
50patchfiles-append   patch-config.tests_unix_compile.test.diff
51
52# (1) Test for Precompiled-headers support (a) requires a C++
53# compiler, but configure calls it, by default, with a C compiler;
54# thus, enable testing using the C compiler. (b) to work with ccache,
55# if used.
56
57patchfiles-append   patch-config.tests_unix_precomp.test.diff
58
59# (2) fix 'configure' script: (a) to allow easy replacement of arch
60# type(s). (b) to find the correct QMAKE CXX compiler by removing
61# possibilities that include the character "$". (c) to declare, use,
62# and set QT_INSTALL_FRAMEWORKS and QMAKE_FRAMEWORKDIR_QT, both here
63# and in the resulting .qmake.cache files. (d) to allow easy
64# replacement of MACOSX_DEPLOYMENT_TARGET: build for just the user's
65# current OS.
66
67patchfiles-append   patch-configure.diff
68
69# (3) Tweak various scripts to allow easy replacement of
70# MACOSX_DEPLOYMENT_TARGET: build for just the user's current OS.
71
72patchfiles-append   patch-mkspecs_common_g++-macx.conf.diff
73
74# (4) (a) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build
75# for just the user's current OS; (b) allow QMake to use 'ccache' via,
76# e.g., "qmake && make CCACHE=ccache".
77
78patchfiles-append   patch-mkspecs_common_mac.conf.diff
79
80# (5) Place the -I path for local moc-created headers -before-
81# all other -I paths.
82
83patchfiles-append   patch-mkspecs_features_moc.prf.diff
84
85# (6) Remove Qt's LIBDIR and INCDIR from various Qmake internal
86# variables, since they are already included in the user-supplied
87# LIBS and INCLUDEPATH.
88
89patchfiles-append   patch-mkspecs_features_qt.prf.diff
90
91# (7) (a) Change placement of Qt's LIBDIR and INCDIR, to always be
92# after those supplied by the user's QMake (.pro) files.  By the time
93# QMake gets to the patched function, it is creating the Makefile
94# parts to find Qt's headers and libraries, so moving these paths to
95# this location should always work. (b) If the library is QtWebKit,
96# and the build is library (no-framework), universal, and debug, then
97# the linkage is just -lQtWebKit, not -lQtWebKit_debug because the
98# debug library for 32-bit system cannot be created (too large).
99
100patchfiles-append   patch-mkspecs_features_qt_functions.prf.diff
101
102# (8) Add "absolute_library_soname" to the default CONFIG variables,
103# so that when a DYLIB is created, if "target.path" is set for it then
104# that path is prepended to its "install_name".
105
106patchfiles-append   patch-mkspecs_macx-g++_qmake.conf.diff
107
108# (9) Add QT_INSTALL_FRAMEWORKS and related variables to QMake, to
109# provide a default variable for the location of QMake installed
110# frameworks.
111
112patchfiles-append   \
113    patch-qmake_option.h.diff \
114    patch-qmake_property.cpp.diff \
115    patch-src_corelib_global_qlibraryinfo.cpp.diff \
116    patch-src_corelib_global_qlibraryinfo.h.diff
117
118# (10) In QMake, disable default MKSPECS and FEATURES path
119# concatinations if the shell environment variable QMAKE_NO_DEFAULTS
120# is set (to anything); we use this variable in this portfile to make
121# sure only internal paths (to the build) are searched by QMake.
122
123patchfiles-append   patch-qmake_project.cpp.diff
124
125# (11) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build for
126# just the user's current OS.
127
128patchfiles-append   \
129    patch-qmake_qmake.pri.diff \
130    patch-src_tools_bootstrap_bootstrap.pro.diff
131
132# (12) fix compiling of MediaPlayerPrivateQTKit.mm for 10.5; does not
133# hurt others
134
135patchfiles-append   patch-src_3rdparty_webkit_Source_WebCore_platform_graphics_mac_MediaPlayerPrivateQTKit.mm.diff
136
137# (13) fix use of CARBON, found on PPC64; does not hurt others
138
139patchfiles-append   \
140    patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff \
141    patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff
142
143# (14) fix MKSPECS install location for WebKit; fix WebCore to handle
144# 32-bit compiling correctly on x86 and ppc
145
146patchfiles-append   \
147    patch-src_3rdparty_webkit_Source_WebKit_qt_QtWebKit.pro.diff
148
149# (15) fix the corewlan qmake file to use non-standard Developer SDK
150# location under 10.6 and newer, e.g., for some developers doing both
151# iOS and OSX.  This patch does not change behavior for 10.4 or 10.5.
152# Also include fix to use the correct SDK.
153
154patchfiles-append   patch-src_plugins_bearer_corewlan_corewlan.pro.diff
155
156# (16) fix the corewlan source to work under 10.7
157
158patchfiles-append   patch-src_plugins_bearer_corewlan_qcorewlanengine.mm.diff
159
160# (17) Use the "target.path" for libdir for core libraries instead of
161# the standard QT_INSTALL_LIBS; allows us to set for library or
162# framework elsewhere and have the install still work here.
163
164patchfiles-append   patch-src_qbase.pri.diff
165
166# (18) (a) Disable explicit disabling of framework or static install;
167# i.e., install as a framework if that mode is selected, and as
168# library otherwise. (b) If installing as framework, use the new
169# QT_INSTALL_FRAMEWORKS directory; otherwise, use the old
170# QT_INSTALL_LIBS; (c) Get PKGCONFIG dependencies correct, hopefully;
171# (d) create and install .pc, .la, and .prl library description files,
172# including basic path replacement into DESTDIR; we couple this with a
173# post-patch to get the correct install location.
174
175patchfiles-append   \
176    patch-src_qt_install.pri.diff \
177    patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff \
178    patch-tools_assistant_lib_lib.pro.diff \
179    patch-tools_designer_src_components_lib_lib.pro.diff \
180    patch-tools_designer_src_lib_lib.pro.diff \
181    patch-tools_designer_src_uitools_uitools.pro.diff \
182    patch-mkspecs_features_uitools.prf.diff
183
184# (19) fix 'macdeployqt' to look for the correct plugins location by
185# default.  This is paired with a "reinplace" in post-patch
186
187patchfiles-append   \
188    patch-tools_macdeployqt_macdeployqt_main.cpp.diff
189
190# (20) Under 10.4 only: patch QMake build files using just "-lQtHelp"
191# to do "-lQtHelp -lQtCLucene -lQtNetwork -lQtWebKit" instead.  For
192# some reason 10.5+ "knows" that how to do this correctly.
193
194platform darwin 8 {
195    patchfiles-append patch-QtHelp_10.4_only.diff
196}
197
198# (21) fix the Mac timer's use of "mach_timebase_info"
199
200patchfiles-append   \
201    patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff
202
203# (22) fix WebCore to handle 32-bit compiling correctly on x86 and ppc
204
205patchfiles-append   \
206    patch-src_3rdparty_webkit_Source_WebCore_WebCore.pro.diff
207
208# Temporary patch to get ML working; some of this is already upstream
209# https://codereview.qt-project.org/#change,31759
210# See also https://trac.macports.org/ticket/35430
211platform darwin 12 {
212    patchfiles-append patch-EXPERIMENTAL-ML-fixes.diff
213}
214
215# (23) fix Framework directory in MacDeployQt tool
216
217patchfiles-append   \
218    patch-tools_macdeployqt_shared_shared.cpp.diff
219
220###############################################
221
222# disable CCACHE for now (ticket #34856)
223
224configure.ccache no
225
226# create the global for the psql version, if selected
227
228global psql_version
229set psql_version ""
230
231# find a way to specify the OS MINOR version.
232global MINOR
233set MINOR ""
234
235# hopefully the macosx_deployment_target exists and is set by now.  if
236# not, last resort (which is not desirable) is to use the os.version.
237if {${macosx_deployment_target} != ""} {
238    set MINOR [lindex [split ${macosx_deployment_target} "."] 1]
239} else {
240    set MINOR [expr [lindex [split ${os.version} "."] 0] - 4]
241}
242
243# find a way to specify the SDK to use; Qt will use the 10.4u by
244# default which won't work on 10.6 since it is not supported.  Allow
245# the user to specify the SDK if desired.
246
247global SDK
248set SDK ${configure.sdkroot}
249if {${SDK} == ""} {
250    # set SDK version depending on OS version
251    set sdk_version ""
252    if {${MINOR} == "4"} {
253        # OSX 10.4 requires an additional 'u'
254        set sdk_version "10.4u"
255    } else {
256        set sdk_version "10.${MINOR}"
257    }
258    if {[vercmp ${xcodeversion} 4.3] < 0} {
259        set SDK ${developer_dir}/SDKs/MacOSX${sdk_version}.sdk
260    } else {
261        set SDK ${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${sdk_version}.sdk
262    }
263}
264
265post-patch {
266    # set ARCHES in configure (per the third patchfile above), for
267    # building QMake.  join any 2 or more arch entries with the GCC
268    # arch flag (join does not effect a single entry).  first "-arch"
269    # is already in place in the 'configure' script (since there has
270    # to be at least 1 arch).
271    set ARCHES ""
272    if {[variant_exists universal] && [variant_isset universal]} {
273        set ARCHES [join ${universal_archs} " -arch "]
274    } else {
275        set ARCHES ${build_arch}
276    }
277    reinplace "s|@ARCHES@|${ARCHES}|g" ${worksrcpath}/configure
278
279    # set MACOSX_DEPLOYMENT_TARGET version in various places.  These
280    # were all patched in (2) above, and can be easily changed or
281    # overridden by the user in a project-local qmake .pro script.
282    set TARGET "10.${MINOR}"
283    foreach fixfile {configure mkspecs/common/g++-macx.conf \
284                     mkspecs/common/mac.conf qmake/qmake.pri \
285                     src/tools/bootstrap/bootstrap.pro } {
286        reinplace "s|@MACOSX_DEPLOYMENT_TARGET@|${TARGET}|g" \
287            ${worksrcpath}/${fixfile}
288    }
289
290    # Fix OS version on Bearer CoreWLAN QMake file
291    reinplace "s|@MACOSX_VERSION_MINOR@|${MINOR}|g" \
292        ${worksrcpath}/src/plugins/bearer/corewlan/corewlan.pro
293
294    # Ensure that correct C/C++ compilers are used.
295
296    reinplace "s| g++\$| ${configure.cxx}|" \
297        ${worksrcpath}/mkspecs/common/g++-base.conf
298    reinplace "s| gcc\$| ${configure.cc}|"  \
299        ${worksrcpath}/mkspecs/common/g++-base.conf
300
301    # fix the corewlan .pro file to use the correct developer SDK
302
303    reinplace "s,@DEVELOPER_SDK@,${SDK},g" \
304        ${worksrcpath}/src/plugins/bearer/corewlan/corewlan.pro
305
306    # fix 'macdeployqt' to look for the correct plugins location by default.
307
308    reinplace "s,@QT_PLUGINS_DIR@,${qt_plugins_dir},g" \
309        ${worksrcpath}/tools/macdeployqt/macdeployqt/main.cpp
310
311    # fix path to "pg_config", if the variant was selected
312
313    if {${psql_version} != ""} {
314        reinplace "s,@PATH_TO_PG_CONFIG@,${prefix}/lib/postgresql${psql_version}/bin/,g" ${worksrcpath}/configure
315    }
316
317    # if no debug, then do not even build debug code
318
319    if {![variant_isset debug]} {
320        foreach fixfile { src/qbase.pri \
321                          src/3rdparty/webkit/Source/WebKit.pri \
322                          src/imports/qimportbase.pri \
323                          src/plugins/qpluginbase.pri \
324                          tools/designer/src/components/lib/lib.pro \
325                          tools/designer/src/lib/lib.pro \
326                          tools/designer/src/plugins/activeqt/activeqt.pro \
327                          tools/designer/src/plugins/plugins.pri \
328                          tools/designer/src/uitools/uitools.pro \
329                          src/3rdparty/webkit/Source/WebKit/qt/declarative/declarative.pro } {
330            reinplace "/+=/s@debug_and_release@@g" \
331                ${worksrcpath}/${fixfile}
332        }
333    }
334}
335
336# The build process uses -fconstant-cfstrings.
337# configure.compiler should therefore not be one of the MacPorts compilers.
338
339# does not work with clang, see #30271 and #31638 .
340if {${configure.compiler} == "clang"} {
341    configure.compiler llvm-gcc-4.2
342}
343
344# --prefix is not recognized.
345configure.pre_args-delete       --prefix=${prefix}
346
347# --disable-dependency-tracking is not recognized.
348configure.universal_args-delete --disable-dependency-tracking
349
350################################################################################
351# We do not want flags of any kind -- QT is smart enough to set up its own.    #
352################################################################################
353
354configure.cflags
355configure.cppflags
356configure.cxxflags
357configure.ldflags
358
359configure.universal_cflags
360configure.universal_cppflags
361configure.universal_cxxflags
362configure.universal_ldflags
363
364configure.cc_archflags
365configure.cxx_archflags
366configure.ld_archflags
367
368#  use compiler.cpath and compiler.library_path, as per
369#  http://trac.macports.org/ticket/25321 for all -I and -L entries,
370#  so-as to avoid conflicts with already-installed headers and
371#  libraries (giving preference to internal-to-this-port first)
372#
373#  CPATH is used instead of -I to avoid conflicts with other ports.
374#  See http://trac.macports.org/ticket/15219 and
375#  http://trac.macports.org/ticket/18723.
376#
377#  set the default paths to include those for SQLITE3 and DBUS-1
378
379set header_path [ list ${prefix}/include/dbus-1.0 \
380                       ${prefix}/lib/dbus-1.0/include \
381                       ${prefix}/include ]
382
383set library_path [ list ${prefix}/lib ]
384
385# -system-sqlite ensures the use SQLite provided by MacPorts instead of Qt.
386#
387# -dbus-linked prevends qt4 from trying to dynamically load libdbus-1,
388#     which it is not able to find in ${prefix}.
389#
390# -openssl-linked ensures that the MacPorts openssl is used.
391#
392# -no-framework ensures that this port is installed as separate
393#     libraries and headers, with guaranteed locations and names.
394#
395# -no-phonon ensures that Qt does not install the 3rd-parth Phonon
396#     port or its backend to QuickTime 7; Phonon is now installed via
397#     the 'phonon' port, which is more up to date than that provided
398#     by Qt.
399
400configure.args                                            \
401    -v                                                    \
402    -confirm-license                                      \
403    -opensource                                           \
404    -prefix          ${qt_dir}                            \
405    -bindir          ${qt_bins_dir}                       \
406    -libdir          ${qt_libs_dir}                       \
407    -docdir          ${qt_docs_dir}                       \
408    -headerdir       ${qt_includes_dir}                   \
409    -plugindir       ${qt_plugins_dir}                    \
410    -importdir       ${qt_imports_dir}                    \
411    -datadir         ${qt_data_dir}                       \
412    -translationdir  ${qt_translations_dir}               \
413    -sysconfdir      ${qt_sysconf_dir}                    \
414    -examplesdir     ${qt_examples_dir}                   \
415    -demosdir        ${qt_demos_dir}                      \
416    -system-sqlite                                        \
417    -openssl-linked                                       \
418    -dbus-linked                                          \
419    -fast                                                 \
420    -optimized-qmake                                      \
421    -no-framework                                         \
422    -no-phonon                                            \
423    -no-phonon-backend
424
425# Stop configure script from searching for SQL Drivers
426#    not available from MacPorts.
427foreach driver {db2 ibase oci tds} {
428    configure.args-append -no-sql-${driver}
429}
430
431# By default, disable most SQL Drivers.
432# There must be at least one enabled (http://trac.macports.org/ticket/15627).
433# SQLite is chosen to be always enabled because a copy of it is distributed
434#    with Qt, so it is reasonable for the user to expect it.
435foreach driver {mysql odbc psql sqlite2} {
436    configure.args-append -no-sql-${driver}
437}
438
439pre-configure {
440    # use the corrected CPATH and LIBRARY_PATH for build
441    compiler.cpath [join ${header_path} :]
442    compiler.library_path [join ${library_path} :]
443
444    # for 10.4 or 10.5 32-bit PPC, build as Carbon only, not Cocoa
445
446    if {${MINOR} == "4"} {
447
448        configure.args-append -carbon
449
450        # required linking flags?
451
452        configure.ldflags-append -lcrypto -ldbus-1 -ljpeg -llcms \
453            -lsqlite3 -lssl -lz
454
455    } elseif {${MINOR} == "5" &&
456              [llength ${qt_arch_types}] == 1 &&
457              [lsearch -exact ${qt_arch_types} ppc] == 0} {
458
459        configure.args-append -carbon
460
461    }
462
463    # set the arch type(s) to use, in Qt-speak
464
465    configure.args-append -arch \"${qt_arch_types}\"
466
467    # cannot use pre-compiled headers when compiling with more than 1
468    # arch type (typically +universal) or for X11
469
470    #if {[llength ${qt_arch_types}] != 1 || [variant_isset x11]}
471
472    if {[llength ${qt_arch_types}] != 1} {
473        configure.args-append -no-pch
474    } else {
475        configure.args-append -pch
476    }
477
478    # check to see if not compiling for the native machine hardware
479    # (e.g., compiling for just i386 but CPU is x86_64); optimization
480    # of QMake does not work in this circumstance.
481
482    if {[lsearch -exact ${qt_arch_types} ${os.arch}] == -1} {
483
484        # not building for native arch: disable optimizing qmake
485        configure.args-delete -optimized-qmake
486
487    } elseif {${MINOR} == "6" &&
488              [llength ${qt_arch_types}] == 1 &&
489              [lsearch -exact ${qt_arch_types} x86] == 0} {
490
491        # disable qmake optimization on 10.6 32-bit
492        configure.args-delete -optimized-qmake
493
494    }
495
496    # set the SDK, if it was found and exists
497
498    if {[file exists ${SDK}]} {
499        configure.args-append -sdk ${SDK}
500    }
501}
502
503post-configure {
504
505    # Remove any '-I' and '-L' string from the *FLAGS for SQLITE,
506    # DBUS, ODBC, and OPENSSL, so that what remains are just non-I/L
507    # flags; these paths are in compiler.cpath and
508    # compiler.library_path.  The header and library paths for all the
509    # other variants are not used by 'configure', and are already
510    # included in the compiler.cpath and compiler.library_path
511    # . during the 'build' stage, 'make' will rebuild the Makefiles
512    # that depend on any of these changed files.  These patches are
513    # sufficient to make sure local (to this build) paths are searched
514    # first, and then system paths last (via the compiler.X settings).
515    # Ideally, 'qmake' -- either via its mkspecs files or the
516    # project's build files -- would distinguish between "local" and
517    # "system" includes & libraries.
518
519    # SQLITE
520    reinplace "/SQLITE/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
521        ${worksrcpath}/.qmake.cache
522    reinplace "/SQLITE/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
523        ${worksrcpath}/.qmake.cache
524    # DBUS
525    reinplace "/DBUS/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
526        ${worksrcpath}/.qmake.cache
527    reinplace "/DBUS/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
528        ${worksrcpath}/.qmake.cache
529    # OPENSSL
530    reinplace "/OPENSSL/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
531        ${worksrcpath}/.qmake.cache
532    reinplace "/OPENSSL/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
533        ${worksrcpath}/.qmake.cache
534    # ODBC
535    reinplace "/ODBC/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \
536        ${worksrcpath}/.qmake.cache
537    reinplace "/ODBC/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \
538        ${worksrcpath}/.qmake.cache
539}
540
541pre-build {
542    # use the corrected CPATH and LIBRARY_PATH for build
543    compiler.cpath [join ${header_path} :]
544    compiler.library_path [join ${library_path} :]
545}
546
547build.target all
548
549post-destroot {
550    set destroot_qt ${destroot}${qt_dir}
551
552    # Fix .pc and .prl files by changing ${worksrcpath}\${prefix} to
553    # ${qt_dir}\${prefix} ("\" means 'take away').  Cannot use
554    # "find -E" since it is not necessarily portable.
555    regsub ${prefix} ${worksrcpath} "" from_dir
556    regsub ${prefix} ${qt_dir} "" to_dir
557    foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
558        reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
559    }
560    foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
561        reinplace "s|${from_dir}|${to_dir}|g" ${fixfile}
562    }
563
564    # remove Libs.private from all pc files
565    foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
566        reinplace "/Libs\.private/d" ${fixfile}
567    }
568
569    # Fix .pc files to use ${prefix} correctly
570    foreach fixfile [exec find ${destroot_qt} -name "*.pc"] {
571        reinplace "s|${prefix}/|\${prefix}/|g" ${fixfile}
572    }
573
574    if {![variant_isset framework]} {
575
576        # if not doing framework install: install qt_menu.nib, used by
577        # any applications making use of Qt's application class
578
579        xinstall -m 755 -d ${destroot_qt}/lib/Resources
580        copy ${worksrcpath}/src/gui/mac/qt_menu.nib \
581            ${destroot_qt}/lib/Resources
582
583    } else {
584
585        # remove -L entries from .prl, and .la files; this is a
586        # framework install, not a library install
587
588        foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
589            reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile}
590        }
591        foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
592            reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile}
593        }
594
595        # remove redundant -F${prefix}/Library/Frameworks entries
596
597        foreach fixfile [exec find ${destroot_qt} -name "*.prl"] {
598            reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \
599                ${fixfile}
600            reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*||g" ${fixfile}
601            reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
602                ${fixfile}
603        }
604        foreach fixfile [exec find ${destroot_qt} -name "*.la"] {
605            reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \
606                ${fixfile}
607            reinplace "/dependency_libs/s|-F\[^ \]*||g" ${fixfile}
608            reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \
609                ${fixfile}
610        }
611
612        # move .pc files from ${qt_frameworks_dir}/pkgconfig to
613        # ${qt_pkg_config_dir}
614
615        file delete -force ${destroot}${qt_pkg_config_dir}
616        xinstall -m 755 -d ${destroot}${qt_libs_dir}
617        move ${destroot}${qt_frameworks_dir}/pkgconfig \
618            ${destroot}${qt_libs_dir}
619
620        # link headers into ${qt_includes_dir}, removing directories
621        # if they are already there first
622
623        foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
624                             -name "*.framework" | \
625                             sed -e "s@${destroot}@@g"] {
626            set tf_full [strsed ${fixfile} {s@\\.framework@@}]
627            set tf [strsed ${tf_full} {g@.*\/@@}]
628            set inc_file ${destroot}${qt_includes_dir}/${tf}
629            if {[file exists ${inc_file}]} {
630                file delete -force ${inc_file}
631            }
632            ln -s ${tf_full}.framework/Headers ${inc_file}
633        }
634    }
635
636    # Install documentation.
637    xinstall -m 755 -d ${worksrcpath}/${qt_docs_dir}
638    xinstall -m 644 -W ${worksrcpath} \
639        INSTALL LGPL_EXCEPTION.txt LICENSE.FDL \
640        LICENSE.GPL3 LICENSE.LGPL README \
641        ${destroot}${qt_docs_dir}
642
643    # Move .apps into the applications_dir
644    xinstall -m 755 -d ${destroot}${qt_apps_dir}
645    foreach app [glob ${destroot}/${qt_bins_dir}/*.app] {
646        move ${app} ${destroot}${qt_apps_dir}
647    }
648
649    # remove 'tests' directory
650
651    file delete -force ${destroot}${prefix}/tests
652}
653
654pre-activate {
655    # make sure 'none' is selected by qt4_select, so that there is no
656    # conflict between it and this port.
657    if {[file exists ${prefix}/bin/qt4_select]} {
658        if {[exec ${prefix}/bin/qt4_select -s] != "none"} {
659            ui_msg "Disabling 'qt4_select' selection."
660            system "exec ${prefix}/bin/qt4_select none"
661        }
662    }
663}
664
665variant framework description {Build as Frameworks} {
666    configure.args-delete -no-framework
667    configure.args-append -framework
668}
669
670variant mysql description {MySQL Qt4 Plugin Legacy Compatibility Variant} {
671    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."
672    return -code error "Variant disabled"
673}
674
675variant odbc description {Enable iODBC SQL Driver} {
676    depends_lib-append port:libiodbc
677    configure.args-delete -no-sql-odbc
678    configure.args-append -plugin-sql-odbc
679}
680
681variant psql83 conflicts psql84 psql90 psql91 \
682description {PostgreSQL 8.3 Qt4 Plugin Legacy Compatibility Variant} {}
683
684variant psql84 conflicts psql83 psql90 psql91 \
685description {PostgreSQL 8.4 Qt4 Plugin Legacy Compatibility Variant} {}
686
687variant psql90 conflicts psql83 psql84 psql91 \
688description {PostgreSQL 9.0 Qt4 Plugin Legacy Compatibility Variant} {}
689
690variant psql91 conflicts psql83 psql84 psql90 \
691description {PostgreSQL 9.1 Qt4 Plugin Legacy Compatibility Variant} {}
692
693if {[variant_isset psql83]} {
694    set psql_version "83"
695} elseif {[variant_isset psql84]} {
696    set psql_version "84"
697} elseif {[variant_isset psql90]} {
698    set psql_version "90"
699} elseif {[variant_isset psql91]} {
700    set psql_version "91"
701}
702
703if {${psql_version} != ""} {
704    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."
705    return -code error "Variant disabled"
706}
707
708variant sqlite2 description {Enable SQLite version 2 SQL Driver} {
709    depends_lib-append port:sqlite2
710    configure.args-delete -no-sql-sqlite2
711    configure.args-append -plugin-sql-sqlite2
712}
713
714variant raster description {Use raster graphics system by default} {
715    configure.args-append -graphicssystem raster
716}
717
718variant demos description {Build demos} {}
719
720if {![variant_isset demos]} {
721   configure.args-append -nomake demos
722}
723
724variant examples description {Build examples} {}
725
726if {![variant_isset examples]} {
727   configure.args-append -nomake examples
728}
729
730variant debug description {Build both release and debug library} {}
731
732if {[variant_isset debug]} {
733    configure.args-append -debug-and-release -declarative-debug
734} else {
735    configure.args-append -release -no-declarative-debug
736}
737
738#variant quartz conflicts x11
739variant quartz \
740description {Build for Native OSX Quartz GUI, not X11 (default)} {}
741
742#variant x11 conflicts quartz \
743#description {Build for X11 GUI, not Native OSX Quartz} {}
744
745# if neither +x11 or +quartz were specified, default to the latter
746#if {![variant_isset quartz] && ![variant_isset x11]} {
747    default_variants +quartz
748#}
749
750# check to see if user specified just "-quartz", which can't work.
751#if {![variant_isset quartz] && ![variant_isset x11]} {
752#    return -code error \
753#"\n\nThe variant -quartz will not work alone.
754#Please select one of +quartz or +x11 as a variant.\n"
755#}
756
757#if {[variant_isset x11]} {
758#    return -code error "\n\nVariant +x11 is not yet functional; \
759#please use +quartz for now.\n"
760#}
761
762livecheck.type      regex
763livecheck.url       http://get.qt.nokia.com/qt/source/
764livecheck.regex     "qt-everywhere-opensource-src-(\[0-9a-z.-\]+)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.