Ticket #37331: Portfile

File Portfile, 5.3 KB (added by ChristianFrisson (Christian Frisson), 10 years ago)
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 109576 2013-08-17 18:12:27Z gmail.com:christian.frisson $
3
4PortSystem          1.0
5
6name                qt5
7conflicts           qt3 qt3-mac qt4-mac qt4-mac-devel
8version             5.2.1
9revision 1
10set branch          [join [lrange [split ${version} .] 0 1] .]
11
12categories          aqua
13platforms           macosx
14maintainers         gmail.com:christian.frisson openmaintainer
15license             {LGPL-2.1 GPL-3}
16
17homepage            http://qt-project.org
18description         Qt Tool Kit
19long_description    Qt Tool Kit: A cross-platform framework \
20                    (headers, data, and libraries) for writing \
21                    cross-platform GUI-based applications.
22
23master_sites        http://download.qt-project.org/official_releases/qt/${branch}/${version}/
24distname            qt-opensource-mac-x64-clang-${version}
25distfiles           ${distname}.dmg
26
27
28checksums           sha1    de0cd1cef9d5a6f2ad302b3776acd3b1ebdfb9cb \
29                    rmd160  e0ffe939e4fa560012f676118b42b3f0339f6f5c
30
31depends_build       port:p7zip
32
33depends_lib-append  port:zlib path:bin/dbus-daemon:dbus \
34                    port:openssl port:tiff \
35                    port:libpng port:libmng port:jpeg \
36                    port:mysql55
37
38extract {
39    # A long bash script so that the dmg is always detached
40    system "cd ${workpath}; echo attach;hdiutil attach -noverify -mountpoint dmg ${prefix}/var/macports/distfiles/${name}/${distfiles};echo dump;mkdir ${workpath}/files; ${workpath}/dmg/${distname}.app/Contents/MacOS/${distname} --dump-binary-data -i ${workpath}/dmg/${distname}.app/Contents/Resources/installer.dat -o ${workpath}/files;echo extract;7z x -o${workpath} ${workpath}/files/qt*essentials/*essentials.7z;7z x -o${workpath} ${workpath}/files/qt*addons/*addons.7z;echo detach ; hdiutil detach ${workpath}/dmg"
41}
42
43use_configure   no
44
45build {}
46
47destroot {
48
49    # Move the binaries to ${destroot}${prefix}/bin
50    eval move [glob ${workpath}/${version}/clang_64/bin/*] ${destroot}${prefix}/bin
51
52    # Move the headers to ${destroot}${prefix}/include
53    eval move [glob ${workpath}/${version}/clang_64/include/*] ${destroot}${prefix}/include/
54
55    # Move the frameworks to ${destroot}${prefix}/Library/Frameworks/
56    xinstall -d ${destroot}${prefix}/Library/Frameworks/
57    eval move [glob ${workpath}/${version}/clang_64/lib/*.framework] ${destroot}${prefix}/Library/Frameworks/
58
59    # Move the static libraries to ${destroot}${prefix}/lib
60    eval move [glob ${workpath}/${version}/clang_64/lib/*.*] ${destroot}${prefix}/lib/
61
62    # Move the documentation to ${destroot}${prefix}/share/doc/qt5
63    xinstall -d ${destroot}${prefix}/share/doc/qt5
64    eval move [glob ${workpath}/${version}/clang_64/doc/*] ${destroot}${prefix}/share/doc/qt5/
65
66    # Move other relevant folders to ${destroot}${prefix}/share/qt5
67    xinstall -d ${destroot}${prefix}/share/qt5
68    move ${workpath}/${version}/clang_64/examples ${destroot}${prefix}/share/qt5/
69    move ${workpath}/${version}/clang_64/imports ${destroot}${prefix}/share/qt5/
70    move ${workpath}/${version}/clang_64/mkspecs ${destroot}${prefix}/share/qt5/
71    move ${workpath}/${version}/clang_64/phrasebooks ${destroot}${prefix}/share/qt5/
72    move ${workpath}/${version}/clang_64/plugins ${destroot}${prefix}/share/qt5/
73    move ${workpath}/${version}/clang_64/qml ${destroot}${prefix}/share/qt5/
74    move ${workpath}/${version}/clang_64/translations ${destroot}${prefix}/share/qt5/
75    move ${workpath}/${version}/clang_64/lib/cmake ${destroot}${prefix}/lib/ 
76    eval reinplace "s|/lib/|/Library/Frameworks/|g" [glob ${destroot}/${prefix}/lib/cmake/Qt5*/Qt5*.cmake]
77    eval reinplace "s|/mkspecs|share/qt5/mkspecs|g" [glob ${destroot}/${prefix}/lib/cmake/Qt5*/Qt5*.cmake]
78    eval reinplace "s|/plugins|/share/qt5/plugins|g" [glob ${destroot}/${prefix}/lib/cmake/Qt5*/Qt5*.cmake]
79    eval move [glob ${workpath}/${version}/clang_64/lib/pkgconfig/*.pc] ${destroot}${prefix}/lib/pkgconfig
80    eval reinplace "s|______________________________PADDING______________________________|${prefix}|g" [glob ${destroot}/${prefix}/lib/pkgconfig/*.pc]
81    eval reinplace "s|/work/build/||g" [glob ${destroot}/${prefix}/lib/pkgconfig/*.pc]
82
83    # Remove the libqsqlmysql plugin since it requires /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib
84    #eval file delete [glob ${destroot}${prefix}/share/qt5/plugins/sqldrivers/libqsqlmysql*]
85
86    # Adjust the dependencies paths and ids using install_name_tool through a bash script       
87    system "${portpath}/files/install.sh ${destroot} ${prefix}"
88
89    # Move the app bundles to ${destroot}/Applications/MacPorts/
90    xinstall -d ${destroot}/Applications/MacPorts/
91    eval move [glob ${destroot}${prefix}/bin/*.app] ${destroot}/Applications/MacPorts/
92
93    # Make sure that qmake finds QT_INSTALL_LIBS
94    xinstall ${portpath}/files/qt.conf ${destroot}/${prefix}/bin/qt.conf
95    reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}/${prefix}/bin/qt.conf
96}
97
98post-activate {
99    # Dirty hack to make qmake work, couldn't be solved by adapting the qt.conf file above
100    system "ln -s ${prefix}/share/qt5/mkspecs ${prefix}/mkspecs"
101}
102
103livecheck.type      regex
104livecheck.url       http://releases.qt-project.org/qt5/source
105livecheck.regex     "qt-everywhere-opensource-src-(\[0-9a-z.-\]+)${extract.suffix}"