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

Last change on this file since 58230 was 58230, checked in by ryandesign@…, 11 years ago

rewrite mysql5 dependency so mysql5-devel can satisfy it

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