source: trunk/dports/python/py-wxpython-2.8/Portfile

Last change on this file was 130638, checked in by larryv@…, 3 years ago

py{24,25}-wxpython-2.8: Replace with py27

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.2 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=2:ts=2:sts=2
2# $Id: Portfile 130638 2015-01-02 04:50:18Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6PortGroup           python          1.0
7PortGroup           wxWidgets       1.0
8
9name                py-wxpython-2.8
10version             2.8.12.1
11set branch          [join [lrange [split ${version} .] 0 1] .]
12categories-append   graphics devel
13license             wxwidgets-3.1
14platforms           darwin
15maintainers         jwa mojca
16
17description         Python interface to the wxWidgets ${branch} cross platform GUI
18long_description    wxPython is a GUI toolkit for the Python programming \
19                    language. It allows Python programmers to create \
20                    programs with a robust, highly functional graphical \
21                    user interface, simply and easily. It is implemented \
22                    as a Python extension module (native code) that wraps \
23                    the wxWidgets cross platform GUI library, written in C++. \
24                    Version 2.8 is provided for compatibility reasons only. \
25                    See description of wxWidgets-2.8 for further details.
26
27homepage            http://www.wxpython.org/
28master_sites        sourceforge:wxpython
29
30distname            wxPython
31use_bzip2           yes
32
33checksums           rmd160  94eae06087bdd930e21bf90cc6672f93a1f5a17a \
34                    sha256  1f3f153d9f1504c6ce2d2c4b23e940b8f58b81f4cba35cda1a5bb31142243cd0
35
36python.versions     26 27
37python.default_version 27
38
39distfiles           ${distname}-src-${version}${extract.suffix}
40dist_subdir         ${distname}/${version}
41worksrcdir          ${distname}-src-${version}/wxPython
42
43# extract just the docs and wxPython subdir
44extract.post_args   "| tar -xf - ${worksrcdir} ${distname}-src-${version}/docs"
45
46if {${name} ne ${subport}} {
47    conflicts               py${python.version}-wxpython-3.0
48    depends_lib-append      port:py${python.version}-numeric
49    patchfiles              patch-config.py.diff
50
51    variant carbon conflicts gtk description {use 32-bit carbon-based wxWidgets} {
52        wxWidgets.use       wxWidgets-2.8
53        depends_run-append  port:${wxWidgets.port}
54        # TODO: the following line would end up with --no-user-cfg
55        #build.args         WX_CONFIG="${wxWidgets.wxconfig}"
56        build.cmd           ${python.bin} setup.py WXPORT="mac" WX_CONFIG="${wxWidgets.wxconfig}"
57        destroot.cmd        ${python.bin} setup.py WXPORT="mac" WX_CONFIG="${wxWidgets.wxconfig}"
58
59        # TODO: test if this works on 10.7
60        post-patch {
61            reinplace       "s|# @@FLAGS1@@|cflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
62            reinplace       "s|# @@FLAGS2@@|lflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
63            if {${wxWidgets.sdk} ne ""} {
64                reinplace   "s|# @@FLAGS3@@|cflags.extend(\[\"-isysroot\", \"${wxWidgets.sdk}\"\])|" ${worksrcpath}/config.py
65            }
66        }
67        post-destroot {
68            delete          ${destroot}${wxWidgets.prefix}
69        }
70    }
71
72    variant gtk conflicts carbon description {use wxGTK} {
73        wxWidgets.use       wxGTK-2.8
74        # not sure if/what other dependencies should be listed here
75        depends_build       port:pkgconfig
76        depends_lib-append  path:lib/pkgconfig/cairo.pc:cairo \
77                            port:gtk2 \
78                            port:${wxWidgets.port}
79        require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
80        require_active_variants gtk2  x11
81
82        build.cmd           ${python.bin} setup.py WXPORT="gtk2" WX_CONFIG="${wxWidgets.wxconfig}"
83        destroot.cmd        ${python.bin} setup.py WXPORT="gtk2" WX_CONFIG="${wxWidgets.wxconfig}"
84
85        post-patch {
86            reinplace       "s|# @@FLAGS1@@|cflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
87            reinplace       "s|# @@FLAGS2@@|lflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/config.py
88        }
89        post-destroot {
90            delete          ${destroot}${wxWidgets.prefix}
91        }
92    }
93
94    if {![variant_isset carbon] && ![variant_isset gtk]} {
95        # gtk will be the default variant
96        # using +carbon is possible on <= 10.6 (or 10.7 with an old Xcode version)
97        default_variants-append +gtk
98    }
99
100    livecheck.type  none
101} else {
102    # Once upon a time this would install the documentation,
103    # however the python PortGroup disables all steps including fetching & extracting
104    # which makes it a bit inconvenient to do things like this.
105    # If anyone is missing the docs badly enough, you are welcome to fix this
106    # in both py-wxpython-2.8 and py-wxpython-3.0.
107    #
108    # post-destroot {
109    #     xinstall -d -m 755 ${destroot}${prefix}/share/doc/
110    #     file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${name}
111    #     file copy ${worksrcpath}/samples ${destroot}${prefix}/share/doc/${name}/examples
112    # }
113
114    livecheck.type  regex
115    livecheck.url   ${homepage}
116    livecheck.regex wxPython(?: | \\(classic\\) )(2\\.8\\.\[0-9\]+\\.\[0-9\]+)
117}
Note: See TracBrowser for help on using the repository browser.