Ticket #14602: Portfile

File Portfile, 8.1 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 17 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile $
3
4PortSystem          1.0
5
6name                qt4-x11
7version             4.3.4
8categories              x11
9maintainers         nomaintainer
10
11homepage            http://www.trolltech.com/
12
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}
20checksums \
21    md5 9499101ec54eb7b0de195b3c5e3ffa93 \
22    sha1 639f6469d5aa07c51c2aa6795f8e3de3aab8cd25 \
23    rmd160 eb081e599e61bcaa126981aecbe2db480be35eca
24
25depends_lib         port:libmng port:libpng port:jpeg port:tiff port:libiconv
26
27# have to build with Apple gcc because of -fconstant-cfstrings
28configure.compiler  gcc-4.0
29configure.cmd       "echo yes | ./configure"
30configure.pre_args
31# See
32#   http://doc.trolltech.com/qtopia4.3/buildsystem/over-configure-options-qt-1.html
33# for options
34configure.args \
35    -v         \
36    -prefix         '${prefix}'                            \
37    -docdir         '${prefix}/share/doc/${portname}'      \
38    -datadir        '${prefix}/share/${portname}'          \
39    -headerdir      '${prefix}/include/${portname}'        \
40    -plugindir      '${prefix}/lib/${portname}-plugins'    \
41    -translationdir '${prefix}/share/${portname}/translations' \
42    -optimized-qmake    -release        -shared         -stl                \
43    -no-openssl         -largefile                                          \
44    -system-libpng      -system-libjpeg -system-libmng  -system-libtiff     \
45    -system-zlib        -qt-gif                                             \
46    -no-sql-ibase       -no-sql-mysql   -no-sql-odbc    -no-sql-psql        \
47    -no-sql-sqlite      -no-nis         -no-cups                            \
48    -make libs          -make tools                                         \
49    -I${worksrcpath}/include -I${prefix}/include  \
50    -L${worksrcpath}/lib -L${prefix}/lib -lresolv \
51    -no-rpath
52
53    # not made by default, anyway: -nomake demos -nomake examples
54
55build.target        first
56
57destroot.destdir    INSTALL_ROOT="${destroot}"
58
59patchfiles          Makefile.unix.diff qlibrary_unix.cpp.diff q3process_unix.cpp.diff qprocess_unix.cpp.diff qmake.conf.diff
60
61post-patch {
62    reinplace "s|ARCH=macosx|ARCH=`uname -p`|g" ${worksrcpath}/configure
63    reinplace "s|Q_OS_DARWIN|Q_WS_MAC|g" ${worksrcpath}/qmake/generators/mac/pbuilder_pbx.cpp
64    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/demos/qtdemo/colors.cpp
65    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/examples/dialogs/standarddialogs/dialog.cpp
66    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/examples/tools/plugandpaint/mainwindow.cpp
67    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/qmake/main.cpp
68    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/codecs/qiconvcodec.cpp
69    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/codecs/qiconvcodec_p.h
70    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/tools/qstring.cpp
71    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/global/qglobal.cpp
72    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/io/qfsfileengine_unix.cpp
73    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/global/qlibraryinfo.cpp
74    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/tools/qlocale.cpp
75    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/io/qsettings.cpp
76    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/qmake/option.cpp
77    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/io/qsettings_p.h
78    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/plugin/qlibrary.cpp
79    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/tools/qpoint.h
80    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/tools/qrect.h
81    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/gui/dialogs/qprintdialog.h
82    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/gui/kernel/qapplication.h
83    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/gui/kernel/qapplication_p.h
84    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/gui/widgets/qdockwidget.cpp
85    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/corelib/thread/qthread_unix.cpp
86    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/gui/text/qfont.cpp
87    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/gui/text/qfontdatabase.cpp
88    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/plugins/accessible/widgets/simplewidgets.cpp
89    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/qt3support/other/q3accel.cpp
90    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/qt3support/other/q3polygonscanner.cpp
91    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/qt3support/text/q3textedit.cpp
92    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/sql/drivers/odbc/qsql_odbc.h
93    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/tools/uic/cpp/cppwriteinitialization.cpp
94    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/tools/uic/cpp/cppwriteinitialization.h
95    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/src/tools/uic/cpp/cppwriteinitialization.h
96    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/tools/assistant/lib/qassistantclient.cpp
97    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/tools/designer/src/lib/uilib/abstractformbuilder.cpp
98    reinplace "s|Q_OS_MAC|Q_WS_MAC|g" ${worksrcpath}/tools/linguist/shared/proparserutils.h
99}
100
101post-destroot {
102    foreach doc {INSTALL LICENSE.GPL2 LICENSE.GPL3 LICENSE.QPL OPENSOURCE-NOTICE.TXT README \
103                 GPL_EXCEPTION_ADDENDUM.TXT GPL_EXCEPTION.TXT} {
104        xinstall -c -m 644 ${worksrcpath}/$doc ${destroot}${prefix}/share/doc/${portname}
105    }
106    system "cd ${destroot}/${prefix}/lib && ln -s libQtAssistantClient.dylib libQtAssistant.dylib"
107}
108
109variant dbus description "Include DBus support" {
110    depends_lib-append      port:dbus
111    configure.args-append   -qdbus
112}
113
114variant nis description "Include Network Information Service (NIS) support" {
115    configure.args-delete   -no-nis
116    configure.args-append   -nis
117}
118
119variant cups description "Include Common Unix Printing System (CUPS) support" {
120    configure.args-delete   -no-cups
121    configure.args-append   -cups
122}
123
124variant mysql conflicts mysql5 description "Include support for SQL via mysql driver" {
125    depends_lib-append      lib:libmysqlclient.12:mysql4
126    configure.args-delete   -no-sql-mysql
127    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \
128                            -I${prefix}/include/mysql -L${prefix}/lib/mysql
129}
130
131variant mysql5 conflicts mysql description "Include support for SQL via mysql5 driver" {
132    depends_lib-append      port:mysql5
133    configure.args-delete   -no-sql-mysql
134    configure.args-append   -qt-sql-mysql -plugin-sql-mysql \
135                            -I${prefix}/include/mysql5/mysql -L${prefix}/lib/mysql5/mysql
136}
137
138variant sqlite description "Include support for SQL via sqlite driver" {
139        # depends_lib-append      port:sqlite3
140        configure.args-delete   -no-sql-sqlite
141        configure.args-append   -qt-sql-sqlite -plugin-sql-sqlite
142    # -system-sqlite
143}
144
145variant ssl description "Include OpenSSL support" {
146    depends_lib             port:openssl
147    configure.args-delete   -no-openssl
148    configure.args-append   -openssl
149}
150
151variant examples description "Build Qt examples" {
152    # configure.args-delete   "-nomake examples"
153    configure.args-append   -make examples -examplesdir ${prefix}/share/${portname}/examples
154}
155
156variant demos description "Build Qt demos" {
157    # configure.args-delete   "-nomake demos"
158    configure.args-append   -make demos -demosdir ${prefix}/share/${portname}/demos
159}
160
161livecheck.check     regex
162livecheck.url       http://trolltech.com/developer/downloads/qt/x11
163livecheck.regex     "The current version of Qt/X11 Open Source Edition is (4(?:\\.\\d+)*)"