source: trunk/dports/x11/qt4-x11/Portfile

Last change on this file was 146517, checked in by raimue@…, 21 months ago

Mass rev-bump dependents of port openssl due to ABI change

Disabling SSLv2 in r146162 changed the ABI of the library, leading to loading
errors for binaries with references to SSLv2 symbols.

https://lists.macosforge.org/pipermail/macports-dev/2016-March/032531.html

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.5 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 146517 2016-03-10 17:49:28Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           select 1.0
6
7set select_group    qt4
8set select_branch   x11
9set select_port     ${select_group}_select
10set select_name     ${select_group}-${select_branch}
11select.group        ${select_group}
12select.file         ${filespath}/${select_name}
13
14name                ${select_name}
15version             4.4.3
16revision            16
17categories              x11
18license             {GPL-2 GPL-3 OpenSSLException}
19maintainers         nomaintainer
20homepage            http://qt.nokia.com/
21platforms           darwin
22description         Qt Tool Kit (X11 Version)
23long_description    \
24    Qt is a cross-platform application and UI framework for writing \
25    cross-platform GUI applications. This version uses the X11 UI. \
26    For a native Aqua version, see the port qt4-mac.
27master_sites        trolltech
28distname            qt-x11-opensource-src-${version}
29
30checksums           \
31    md5    376c003317c4417326ba2116370227d0          \
32    sha1   a883e913e69a418e3cfcfecefe4f82c4e091c4bd  \
33    rmd160 49de53663a86785f88236bdeca6db8ee96a37db8
34
35depends_build       port:pkgconfig port:${select_port}
36
37depends_lib                                \
38    port:zlib                              \
39    port:giflib          \
40    port:tiff                              \
41    port:libpng                            \
42    port:libmng                            \
43    port:jpeg                              \
44    port:libiconv                          \
45    path:lib/pkgconfig/glib-2.0.pc:glib2   \
46    path:bin/dbus-daemon:dbus                              \
47    port:unixODBC                          \
48    path:bin/mysql_config5:mysql5          \
49    port:postgresql83                      \
50    path:lib/libssl.dylib:openssl                           \
51    port:fontconfig                        \
52    port:gettext                           \
53    port:xrender                           \
54    port:xorg-libsm                        \
55    port:xorg-libXi                        \
56    port:xorg-libXrandr                    \
57    port:mesa                              \
58    port:gstreamer010                         \
59    port:gstreamer010-gst-plugins-base                  \
60    port:sqlite3
61
62patchfiles  patch-compile.test.diff
63
64# --prefix is not recognized
65configure.pre_args-delete  --prefix=${prefix}
66# -I${prefix}/include and -L${prefix}/lib must be set in ${configure.args}
67#    or else some generated Makefiles will not seem them
68configure.cppflags
69configure.ldflags
70
71configure.env-append \
72    OPENSOURCE_CXXFLAGS=-D__USE_WS_X11__
73
74set qt_dir ${prefix}/libexec/${name}
75
76# -I${prefix}/include should be set in ${configure.args}, but
77#    we instead patch -isystem ${prefix}/include into the configure
78#    script to avoid conflicts with other ports (e.g. iconv).
79# See http://trac.macports.org/ticket/16862
80#
81# -dbus-linked prevends qt4 from trying to dynamically load libdbus-1,
82#     which it is not able to find in ${prefix}
83# -openssl-linked ensures that the MacPorts openssl is used
84configure.args                                                 \
85    -v                                                         \
86    -confirm-license                                           \
87    -prefix          ${qt_dir}                                 \
88    -docdir          ${qt_dir}/share/doc/${name}               \
89    -examplesdir     ${qt_dir}/share/${name}/examples          \
90    -demosdir        ${qt_dir}/share/${name}/demos             \
91    -system-sqlite                                             \
92    -openssl-linked                                            \
93    -dbus-linked                                               \
94    -I${prefix}/include/mysql5/mysql                           \
95    -I${prefix}/include/postgresql83                           \
96    -L${prefix}/lib                                            \
97    -L${prefix}/lib/mysql5/mysql                               \
98    -L${prefix}/lib/postgresql83                               \
99    -liconv                                                    \
100    -lresolv                                                   \
101    -I${prefix}/include/gstreamer-0.10                         \
102    -I${prefix}/include/glib-2.0                               \
103    -I${prefix}/lib/glib-2.0/include                           \
104    -I${prefix}/include/libxml2
105
106# default: -no-nas-sound
107# default: -nomake demos  -nomake examples
108# default: -iconv -svg -webkit -phonon -phonon-backend -xmlpatterns
109# default: -no-assistant-webkit
110
111universal_variant   no
112
113build.target        first
114use_parallel_build  yes
115
116destroot.destdir    INSTALL_ROOT="${destroot}"
117
118post-patch {
119    reinplace -E "s|^I_FLAGS=\$|I_FLAGS=-isystem${prefix}/include|" \
120        ${worksrcpath}/configure
121
122    # macosx seems to be a special architecture to accommodate universal builds, but here is no
123    #    ${worksrcpath}/include/QtCore/qatomic_macosx.h file, which causes an error
124    reinplace "s|CFG_HOST_ARCH=macosx|CFG_HOST_ARCH=`uname -p`|g" ${worksrcpath}/configure
125
126    # Ensure the correct MacPorts X11 is used
127    reinplace "s|/usr/X11R6|${prefix}|g" ${worksrcpath}/mkspecs/darwin-g++/qmake.conf
128
129    # Avoid having to call "install_name_tool -change" after destroot.
130    reinplace \
131        "s|install_name\$\${LITERAL_WHITESPACE}|install_name\$\${LITERAL_WHITESPACE}\$\$\[QT_INSTALL_LIBS\]/|g" \
132        ${worksrcpath}/mkspecs/darwin-g++/qmake.conf
133
134    # ensure that MacPorts compilers are used
135    reinplace "s| cc\$| ${configure.cc}|"  ${worksrcpath}/mkspecs/darwin-g++/qmake.conf
136    reinplace "s| c++\$| ${configure.cxx}|" ${worksrcpath}/mkspecs/darwin-g++/qmake.conf
137
138    # Q_OS_MAC, Q_OS_MACX, and Q_OS_DARWIN is set for all Mac systems.
139    # Q_WS_MAC is NOT set for the X11 version of QT.
140    # It is not clear why so many of these had to be changed.
141    #
142    # Excluded:
143    #        ${worksrcpath}/src/corelib/global/qglobal.h
144    #        ${worksrcpath}/src/network/kernel/qhostinfo_unix.cpp
145    foreach file {
146        qmake/generators/mac/pbuilder_pbx.cpp
147        src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
148        src/corelib/global/qglobal.cpp
149        src/corelib/io/qfile.cpp
150        src/corelib/io/qfsfileengine_unix.cpp
151        src/corelib/plugin/qlibrary.cpp
152        src/corelib/thread/qthread_unix.cpp
153        src/corelib/tools/qlocale.cpp
154        src/network/ssl/qsslsocket_openssl_symbols.cpp
155        tools/porting/src/qt3headers1.resource
156        tools/qvfb/qlock.cpp
157    } {
158        reinplace -locale C "s|Q_OS_DARWIN|Q_WS_MAC|g" ${worksrcpath}/${file}
159    }
160    # Excluded:
161    #        ${worksrcpath}/src/corelib/global/qglobal.h
162    foreach file {
163        src/corelib/tools/qdumper.cpp
164        src/qt3support/other/q3accel.cpp
165        src/qt3support/other/q3process_unix.cpp
166        tools/porting/src/qt3headers1.resource
167        tools/porting/src/qt3headers3.resource
168    } {
169        reinplace -locale C "s|Q_OS_MACX|Q_WS_MAC|g" ${worksrcpath}/${file}
170    }
171    # Edited from command:
172    # grep -rl "\(Q_OS_MAC\$\|Q_OS_MAC[^X]\)" * | grep -v \.resource\$ | grep -v ^doc/ | grep -v src/corelib/global/qglobal.h
173    # Excluded:
174    #        ${worksrcpath}/src/corelib/global/qglobal.h
175    #        ${worksrcpath}/tools/assistant/lib/fulltextsearch/qclucene-config_p.h
176    #        ${worksrcpath}/src/script/qscriptengine_p.cpp
177    #        ${worksrcpath}/src/corelib/io/qprocess.cpp
178    #        ${worksrcpath}/src/corelib/io/qfilesystemwatcher.cpp
179    #        ${worksrcpath}/src/corelib/concurrent/qtconcurrentiteratekernel.cpp
180    foreach file {
181        demos/mediaplayer/mediaplayer.cpp
182        demos/qtdemo/colors.cpp
183        demos/qtdemo/menumanager.cpp
184        examples/dialogs/standarddialogs/dialog.cpp
185        examples/help/remotecontrol/remotecontrol.cpp
186        examples/help/simpletextviewer/assistant.cpp
187        examples/tools/echoplugin/echowindow/echowindow.cpp
188        examples/tools/plugandpaint/mainwindow.cpp
189        qmake/main.cpp
190        qmake/option.cpp
191        src/corelib/codecs/qiconvcodec.cpp
192        src/corelib/codecs/qiconvcodec_p.h
193        src/corelib/global/qglobal.cpp
194        src/corelib/global/qlibraryinfo.cpp
195        src/corelib/global/qnamespace.h
196        src/corelib/io/qdir.cpp
197        src/corelib/io/qfsfileengine_unix.cpp
198        src/corelib/io/qprocess_unix.cpp
199        src/corelib/io/qsettings.cpp
200        src/corelib/io/qsettings_p.h
201        src/corelib/kernel/qcoreapplication.cpp
202        src/corelib/kernel/qcoreapplication_p.h
203        src/corelib/plugin/qlibrary.cpp
204        src/corelib/plugin/qlibrary_unix.cpp
205        src/corelib/thread/qthread_unix.cpp
206        src/corelib/thread/qthread.cpp
207        src/corelib/tools/qlocale.cpp
208        src/corelib/tools/qpoint.h
209        src/corelib/tools/qrect.h
210        src/corelib/tools/qstring.cpp
211        src/corelib/xml/qxmlstream.h
212        src/gui/dialogs/qfilesystemmodel.cpp
213        src/gui/dialogs/qprintdialog.h
214        src/gui/itemviews/qdirmodel.cpp
215        src/gui/itemviews/qfileiconprovider.cpp
216        src/gui/kernel/qapplication.h
217        src/gui/kernel/qapplication_p.h
218        src/gui/text/qfont.cpp
219        src/gui/text/qfontdatabase.cpp
220        src/gui/widgets/qdockwidget.cpp
221        src/plugins/accessible/widgets/simplewidgets.cpp
222        src/qt3support/other/q3polygonscanner.cpp
223        src/qt3support/text/q3textedit.cpp
224        src/sql/drivers/odbc/qsql_odbc.h
225        src/tools/uic/cpp/cppwriteinitialization.cpp
226        src/tools/uic/cpp/cppwriteinitialization.h
227        tools/assistant/compat/lib/qassistantclient.cpp
228        tools/assistant/lib/qhelpsearchresultwidget.cpp
229        tools/assistant/tools/assistant/bookmarkmanager.cpp
230        tools/assistant/tools/assistant/centralwidget.cpp
231        tools/assistant/tools/assistant/indexwindow.cpp
232        tools/assistant/tools/assistant/mainwindow.cpp
233        tools/designer/src/designer/assistantclient.cpp
234        tools/designer/src/designer/qdesigner_actions.cpp
235        tools/designer/src/lib/uilib/abstractformbuilder.cpp
236        tools/linguist/linguist/trwindow.cpp
237        tools/linguist/shared/proparserutils.h
238        tools/shared/findwidget/findwidget.cpp
239    } {
240        reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/${file}
241    }
242}
243
244post-destroot {
245    # Fix the .pc and .prl files by removing ${destroot}
246    foreach fixfile [glob -nocomplain -directory ${destroot} ${qt_dir}/lib/pkgconfig/*.pc ${qt_dir}/lib/*.prl ${qt_dir}/share/${name}/demos/shared/*.prl] {
247        reinplace  \
248            "s|${worksrcpath}/lib|${qt_dir}/lib|g" \
249            ${fixfile}
250    }
251
252    foreach doc { GPL_EXCEPTION.TXT GPL_EXCEPTION_ADDENDUM.TXT INSTALL LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT README } {
253        xinstall -c -m 644 ${worksrcpath}/$doc \
254            ${destroot}${qt_dir}/share/doc/${name}
255    }
256}
257
258post-activate {
259    # If this is the first qt4-* installed, select it.
260    set current_select [exec ${prefix}/bin/${select_port} -s]
261    if {${current_select} == "none"} {
262        system "${prefix}/bin/${select_port} ${select_name}"
263    } else {
264        if {${current_select} != ${select_name}} {
265            # Print out the 'select' info.
266            ui_msg "\
267Port ${current_select} is already selected.\n \
268To fully complete this installation and make ${name} the default,\n \
269please run:\n \
270\tsudo ${select_port} ${select_name}"
271        }
272    }
273}
274
275variant webkit description {Use WebKit as html rendering engine in Assistant} {
276    configure.args-append   -assistant-webkit
277}
278
279livecheck.type      regex
280livecheck.url       http://get.qt.nokia.com/qt/source
281livecheck.regex     "qt-x11-opensource-src-(4(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.