Ticket #23956: Portfile

File Portfile, 3.8 KB (added by dsdale24@…, 14 years ago)

py31-pyqt4 Portfile

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 69767 2010-07-15 22:46:47Z michaelld@macports.org $
3
4PortSystem      1.0
5
6name            py31-pyqt4
7version         4.7.4
8categories      python devel
9platforms       macosx
10maintainers     saispo openmaintainer
11description     PyQt4 is a set of Python bindings for the Qt4 toolkit
12long_description \
13                PyQt4 is a set of Python bindings for the Qt4 toolkit. The \
14                bindings are implemented as a set of Python modules: qt, \
15                qtcanvas, qtgl, qtnetwork, qtsql, qttable, qtui and qtxml, \
16                and contains 300 classes and over 5,750 functions and methods.
17homepage        http://www.riverbankcomputing.co.uk/software/pyqt/intro
18master_sites    http://www.riverbankcomputing.com/static/Downloads/PyQt4/ \
19                http://pyqwt.sourceforge.net/support/
20distname        PyQt-mac-gpl-${version}
21dist_subdir         python
22
23checksums           md5     18af44b8a51dc896200c8b299bee7937 \
24                    sha1    6f164b05454c7c1e3ef77adcdcf8ef50d4ef0107 \
25                    rmd160  b873f8920562caff7dc53c9722c185da2ea7aadc
26
27depends_lib     port:py31-sip port:qt4-mac
28
29set pyversion 3.1
30set qt_dir      ${prefix}/libexec/qt4-mac
31
32# The patch file alters configure.py so that the qtdesigner plugin can link.
33# - it ensures that both LFLAGS are included and that the relevant version framework is linked
34patchfiles      patch-configure.py
35post-patch {
36    reinplace "s|@@MACPORTS_PYTHON_FRAMEWORK@@|${frameworks_dir}/Python.framework/Versions/${pyversion}/Python|" ${worksrcpath}/configure.py
37}
38
39pre-configure {
40        file copy -force ${qt_dir}/mkspecs/macx-g++/qmake.conf \
41                ${worksrcpath}/qmake.conf
42
43        reinplace "s|-bundle|-bundle -flat_namespace -undefined suppress|" \
44                ${worksrcpath}/qmake.conf
45}
46
47configure.cmd   "${prefix}/bin/python${pyversion} configure.py \
48                -q ${qt_dir}/bin/qmake \
49                --confirm-license"
50configure.pre_args
51configure.post_args     LFLAGS="-F${frameworks_dir} -L${prefix}/lib"
52
53variant universal {
54        configure.universal_args
55        configure.post_args     LFLAGS="-F${frameworks_dir} -L${prefix}/lib \
56                                                                ${configure.universal_ldflags}"
57        configure.post_args-append      CFLAGS="${configure.universal_cflags}"
58        configure.post_args-append      CXXFLAGS="${configure.universal_cxxflags}"
59
60}
61
62post-configure {
63        if {[variant_isset universal]} {
64                set conflags ""
65                foreach arch ${configure.universal_archs} {
66                        if {${arch} == "i386"} {append conflags "x86 "} else {
67                                if {${arch} == "ppc64"} {append conflags "ppc_64 "} else {
68                                        append conflags ${arch} " "
69                                }
70                        }
71                }
72
73                set profiles [exec find ${worksrcpath} -name "*.pro"]
74                foreach profile ${profiles} {
75                        reinplace -E "s|^(CONFIG\[ \\t].*)|\\1 ${conflags}|" ${profile}
76               
77                # Cures an isolated case
78                system "cd ${worksrcpath}/designer && \
79                        ${qt_dir}/bin/qmake -spec ${qt_dir}/mkspecs/macx-g++ -macx \
80                                -o Makefile python.pro"
81                }
82        }
83}
84
85
86build.target    all
87use_parallel_build yes
88
89test.run        yes
90test.cmd        cd qt && ${prefix}/bin/python${pyversion} -c 'import PyQt4'
91
92post-destroot {
93    ln -s ${frameworks_dir}/Python.framework/Versions/${pyversion}/bin/pyrcc4 ${destroot}${prefix}/bin/pyrcc4-${pyversion}
94    ln -s ${frameworks_dir}/Python.framework/Versions/${pyversion}/bin/pyuic4 ${destroot}${prefix}/bin/pyuic4-${pyversion}
95
96        xinstall -m 755 -d ${destroot}${prefix}/share/doc
97        file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
98        file copy ${worksrcpath}/examples \
99                ${destroot}${prefix}/share/doc/${name}
100        xinstall -m 644 -W ${worksrcpath} \
101                GPL_EXCEPTION.TXT GPL_EXCEPTION_ADDENDUM.TXT \
102                LICENSE-MERGED-GPL2-GPL3 LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT NEWS README \
103                THANKS \
104                ${destroot}${prefix}/share/doc/${name}
105}
106
107livecheck.type   regex
108livecheck.url    http://www.riverbankcomputing.co.uk/software/pyqt/download
109livecheck.regex  "PyQt-mac-gpl-(\[0-9.\]\\.\[0-9.\]\\.\[0-9.\]).tar.gz"