Ticket #12846: Portfile

File Portfile, 5.5 KB (added by themiwi@…, 17 years ago)
Line 
1# $Id: Portfile 24714 2007-05-01 07:55:32Z jann@macports.org $
2# -*- Mode: Tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:enc=utf-8:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
3PortSystem    1.0
4
5name          qt4-mac
6version       4.3.1
7revision      0
8categories    aqua
9maintainers   dinosaur@aztecfreenet.org
10
11description   Qt Tool Kit (Native Aqua Version)
12long_description \
13              This is Qt, TrollTech's C++ toolkit for writing \
14              cross-platform GUI applications.
15homepage      http://www.trolltech.com/
16master_sites  ftp://ftp.trolltech.com/qt/source/ \
17              http://ftp.iasi.roedu.net/mirrors/ftp.trolltech.com/qt/source/ \
18              http://ftp.ntua.gr/pub/X11/Qt/qt/source/ \
19              http://wftp.tu-chemnitz.de/pub/Qt/qt/source/
20distname      qt-mac-opensource-src-${version}
21use_bzip2     no
22checksums     md5 adfb4196ee569d6ff5f7c7e539a76cd2 \
23              sha1 efdeb87a81f5e3f7303d4a92fbb0267f196419ac \
24              rmd160 b9e83a4cb42b4eec9e60da3a415499b2325f2e1a
25platforms     darwin
26
27depends_lib   lib:libz.1:zlib
28
29variant mysql {
30    depends_lib-append  lib:libmysqlclient.12:mysql4
31    configure.args-delete  -no-sql-mysql
32    configure.args-append  -qt-sql-mysql \
33                           -L${prefix}/lib/mysql \
34                           -I${prefix}/include/mysql \
35                           -plugin-sql-mysql
36}
37
38variant ipv6 {
39    configure.args-delete  -no-ipv6
40    configure.args-append  -ipv6
41}
42variant framework {
43    configure.args-delete  -no-framework
44    configure.args-append  -framework -libdir /Library/Frameworks
45}
46variant examples {
47    configure.args-delete  -nomake examples
48    configure.args-append  -make examples
49}
50variant demos {
51    configure.args-delete  -nomake demos
52    configure.args-append  -make demos
53}
54
55configure.cmd  "echo yes | ./configure"
56configure.env  QMAKESPEC='' QTDIR='' DYLD_LIBRARY_PATH=''
57configure.args  -v -prefix '${prefix}' \
58                -docdir '${prefix}/share/doc/${portname}/html' \
59                -datadir '${prefix}/share/qt4' \
60                -headerdir '${prefix}/include/qt4' \
61                -plugindir '${prefix}/lib/qt4-plugins' \
62                -translationdir '${prefix}/share/qt4/translations' \
63                -release -shared -fast -stl \
64                -qt-gif -qt-libpng -qt-libjpeg -qt-libmng -qt-libtiff \
65                -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql \
66                -no-sql-sqlite -no-nis -no-cups -nomake examples -nomake demos \
67                -system-zlib -largefile -no-framework -optimized-qmake \
68                '-I${prefix}/include' '-L${prefix}/lib'
69
70# have to build with Apple gcc because of -fconstant-cfstrings
71configure.compiler gcc-4.0
72
73build.env  QMAKESPEC='' QTDIR='' DYLD_LIBRARY_PATH="${worksrcpath}/lib"
74#build.target  symlinks src-qmake src-moc sub-src sub-tools
75build.target  first
76
77destroot.destdir  INSTALL_ROOT="${destroot}"
78
79# install the package doc and the port changelog
80post-destroot {
81    xinstall -c -m 644 ${worksrcpath}/INSTALL ${destroot}${prefix}/share/doc/qt4-mac/
82    xinstall -c -m 644 ${worksrcpath}/LICENSE.GPL ${destroot}${prefix}/share/doc/qt4-mac/
83    xinstall -c -m 644 ${worksrcpath}/OPENSOURCE-NOTICE.TXT ${destroot}${prefix}/share/doc/qt4-mac/
84    xinstall -c -m 644 ${worksrcpath}/README ${destroot}${prefix}/share/doc/qt4-mac/
85    xinstall -c -m 644 ${filespath}/ChangeLog.MacPorts ${destroot}${prefix}/share/doc/qt4-mac/
86}
87
88platform darwin  {
89  post-destroot {
90    set appPath ${destroot}/Applications/MacPorts/Qt
91    xinstall -d -m 0755 ${appPath}
92    foreach app {assistant Designer Linguist pixeltool qdbusviewer} {
93      system "mv -v ${destroot}${prefix}/bin/${app}.app \
94        ${appPath}/${app}.app"
95    }
96    if {![file exists ${destroot}${prefix}/lib/libqt.dylib]} {
97      set majorver [strsed ${version} {s/\.[0-9]*\.[0-9]*$//}]
98      set minorver [strsed ${version} {s/\.[0-9]*$//}]
99      cd ${destroot}${prefix}/lib
100      system "ln -s libqt-mt.${version}.dylib libqt.dylib"
101      system "ln -s libqt-mt.${version}.dylib libqt.${majorver}.dylib"
102      system "ln -s libqt-mt.${version}.dylib libqt.${minorver}.dylib"
103    }
104    if { [variant_isset framework] } {
105        # move the stuff that doesn't belong into /Library/Frameworks into ${prefix}/lib
106        move ${destroot}/Library/Frameworks/libQtUiTools.a ${destroot}${prefix}/lib/
107        move ${destroot}/Library/Frameworks/libQtUiTools.prl ${destroot}${prefix}/lib/
108        move ${destroot}/Library/Frameworks/libQtUiTools_debug.a ${destroot}${prefix}/lib/
109        move ${destroot}/Library/Frameworks/libQtUiTools_debug.prl ${destroot}${prefix}/lib/
110        move ${destroot}/Library/Frameworks/pkgconfig ${destroot}${prefix}/lib/
111        move ${destroot}/Library/Frameworks/Qt3Support.la ${destroot}${prefix}/lib/
112        move ${destroot}/Library/Frameworks/QtCore.la ${destroot}${prefix}/lib/
113        move ${destroot}/Library/Frameworks/QtDBus.la ${destroot}${prefix}/lib/
114        move ${destroot}/Library/Frameworks/QtGui.la ${destroot}${prefix}/lib/
115        move ${destroot}/Library/Frameworks/QtNetwork.la ${destroot}${prefix}/lib/
116        move ${destroot}/Library/Frameworks/QtOpenGL.la ${destroot}${prefix}/lib/
117        move ${destroot}/Library/Frameworks/QtScript.la ${destroot}${prefix}/lib/
118        move ${destroot}/Library/Frameworks/QtSql.la ${destroot}${prefix}/lib/
119        move ${destroot}/Library/Frameworks/QtSvg.la ${destroot}${prefix}/lib/
120        move ${destroot}/Library/Frameworks/QtTest.la ${destroot}${prefix}/lib/
121        move ${destroot}/Library/Frameworks/QtXml.la ${destroot}${prefix}/lib/
122    }
123  }
124}