source: trunk/dports/python/py26-pyqt4/Portfile @ 84511

Last change on this file since 84511 was 84511, checked in by snc@…, 8 years ago

modelines

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
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 84511 2011-09-27 13:59:56Z snc@macports.org $
3
4PortSystem      1.0
5PortGroup   qt4 1.0
6
7name            py26-pyqt4
8version         4.8.4
9categories      python devel
10platforms       macosx
11maintainers     michaelld openmaintainer
12description     PyQt4 is a set of Python bindings for the Qt4 toolkit
13long_description \
14                PyQt4 is a set of Python bindings for the Qt4 toolkit. The \
15                bindings are implemented as a set of Python modules: qt, \
16                qtcanvas, qtgl, qtnetwork, qtsql, qttable, qtui and qtxml, \
17                and contains 300 classes and over 5,750 functions and methods.
18homepage        http://www.riverbankcomputing.co.uk/software/pyqt/intro
19master_sites    http://www.riverbankcomputing.com/static/Downloads/PyQt4/ \
20                http://pyqwt.sourceforge.net/support/
21distname        PyQt-mac-gpl-${version}
22dist_subdir         python
23
24checksums           md5     c9114258f494cafa87fc2740364fa7f4 \
25                    sha1    7fbd01603cb1b203abad6331594d1c4b7a395920 \
26                    rmd160  96d7076162ae6b4b0518f91108572558268e529c
27
28set pyversion 2.6
29set pyversion_join [join [split ${pyversion} "."] ""]
30
31depends_lib-append port:py${pyversion_join}-sip
32
33# The patch file alters configure.py so that the qtdesigner plugin can link.
34# - it ensures that both LFLAGS are included and that the relevant version framework is linked
35patchfiles      patch-configure.py
36post-patch {
37    reinplace "s|@@MACPORTS_PYTHON_FRAMEWORK@@|${frameworks_dir}/Python.framework/Versions/${pyversion}/Python|" ${worksrcpath}/configure.py
38}
39
40pre-configure {
41    # allow ccache, if specified by the user
42    if {[tbool configure.ccache]} {
43        configure.env-append "CCACHE=ccache"
44    }
45}
46
47configure.cmd   "${prefix}/bin/python${pyversion} configure.py \
48                -q ${qt_qmake_cmd} --verbose --confirm-license"
49configure.pre_args
50configure.post_args     LFLAGS="-F${frameworks_dir} -L${prefix}/lib"
51
52variant universal {
53        configure.universal_args
54        configure.post_args     LFLAGS="-F${frameworks_dir} -L${prefix}/lib \
55                                                                ${configure.universal_ldflags}"
56        configure.post_args-append      CFLAGS="${configure.universal_cflags}"
57        configure.post_args-append      CXXFLAGS="${configure.universal_cxxflags}"
58}
59
60post-configure {
61        if {[variant_isset universal]} {
62                set conflags ""
63                foreach arch ${configure.universal_archs} {
64                        if {${arch} == "i386"} {append conflags "x86 "} else {
65                                if {${arch} == "ppc64"} {append conflags "ppc_64 "} else {
66                                        append conflags ${arch} " "
67                                }
68                        }
69                }
70
71                set profiles [exec find ${worksrcpath} -name "*.pro"]
72                foreach profile ${profiles} {
73                        reinplace -E "s|^(CONFIG\[ \\t].*)|\\1 ${conflags}|" ${profile}
74               
75                # Cures an isolated case
76                system "cd ${worksrcpath}/designer && \
77                        ${qt_qmake_cmd} -spec ${qt_mkspecs_dir}/macx-g++ -macx \
78                                -o Makefile python.pro"
79                }
80        }
81}
82
83# allow ccache, if specified by the user
84pre-build {
85    if {[tbool configure.ccache]} {
86        build.post_args "CCACHE=ccache"
87    }
88}
89
90build.target    all
91use_parallel_build yes
92
93test.run        yes
94test.cmd        cd qt && ${prefix}/bin/python${pyversion} -c 'import PyQt4'
95
96post-destroot {
97    ln -s ${frameworks_dir}/Python.framework/Versions/${pyversion}/bin/pyrcc4 ${destroot}${prefix}/bin/pyrcc4-${pyversion}
98    ln -s ${frameworks_dir}/Python.framework/Versions/${pyversion}/bin/pyuic4 ${destroot}${prefix}/bin/pyuic4-${pyversion}
99
100        xinstall -m 755 -d ${destroot}${prefix}/share/doc
101        file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
102        file copy ${worksrcpath}/examples \
103                ${destroot}${prefix}/share/doc/${name}
104        xinstall -m 644 -W ${worksrcpath} \
105                GPL_EXCEPTION.TXT GPL_EXCEPTION_ADDENDUM.TXT \
106                LICENSE-MERGED-GPL2-GPL3 LICENSE.GPL2 LICENSE.GPL3 OPENSOURCE-NOTICE.TXT NEWS README \
107                THANKS \
108                ${destroot}${prefix}/share/doc/${name}
109
110    # rename Qt4 specific files
111    # (a) designer plugin
112    set old_name libpythonplugin.dylib
113    set new_name libpython${pyversion_join}plugin.dylib
114
115    move ${destroot}${qt_plugins_dir}/designer/${old_name} \
116        ${destroot}${qt_plugins_dir}/designer/${new_name}
117    system "install_name_tool -id ${new_name} \
118        ${destroot}${qt_plugins_dir}/designer/${new_name}"
119
120    # (b) Qsci API file, if it exists (if Qsci is installed at build time)
121    if {[file exists ${destroot}${qt_data_dir}/qsci/api/python/PyQt4.api]} {
122        move ${destroot}${qt_data_dir}/qsci/api/python/PyQt4.api \
123            ${destroot}${qt_data_dir}/qsci/api/python/PyQt4-Python${pyversion}.api
124    }
125}
126
127variant debug description "Build debug libraries" {
128    configure.cmd-append --debug
129}
130
131livecheck.type   regex
132livecheck.url    http://www.riverbankcomputing.co.uk/software/pyqt/download
133livecheck.regex  "PyQt-mac-gpl-(\[0-9.\]\\.\[0-9.\]\\.\[0-9.\]).tar.gz"
Note: See TracBrowser for help on using the repository browser.