Fetching contributors…
Cannot retrieve contributors at this time
116 lines (97 sloc) 5.24 KB
# -*- 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
PortSystem 1.0
PortGroup active_variants 1.1
PortGroup python 1.0
PortGroup wxWidgets 1.0
name py-wxpython-2.8
set branch [join [lrange [split ${version} .] 0 1] .]
categories-append graphics devel
license wxwidgets-3.1
platforms darwin
maintainers {mojca @mojca} openmaintainer
description Python interface to the wxWidgets ${branch} cross platform GUI
long_description wxPython is a GUI toolkit for the Python programming \
language. It allows Python programmers to create \
programs with a robust, highly functional graphical \
user interface, simply and easily. It is implemented \
as a Python extension module (native code) that wraps \
the wxWidgets cross platform GUI library, written in C++. \
Version 2.8 is provided for compatibility reasons only. \
See description of wxWidgets-2.8 for further details.
master_sites sourceforge:wxpython
distname wxPython
use_bzip2 yes
checksums rmd160 94eae06087bdd930e21bf90cc6672f93a1f5a17a \
sha256 1f3f153d9f1504c6ce2d2c4b23e940b8f58b81f4cba35cda1a5bb31142243cd0
python.versions 26 27
python.default_version 27
distfiles ${distname}-src-${version}${extract.suffix}
dist_subdir ${distname}/${version}
worksrcdir ${distname}-src-${version}/wxPython
# extract just the docs and wxPython subdir
extract.post_args "| tar -xf - ${worksrcdir} ${distname}-src-${version}/docs"
if {${name} ne ${subport}} {
conflicts py${python.version}-wxpython-3.0
depends_lib-append port:py${python.version}-numeric
variant carbon conflicts gtk description {use 32-bit carbon-based wxWidgets} {
wxWidgets.use wxWidgets-2.8
depends_run-append port:${wxWidgets.port}
# TODO: the following line would end up with --no-user-cfg
#build.args WX_CONFIG="${wxWidgets.wxconfig}"
build.cmd ${python.bin} WXPORT="mac" WX_CONFIG="${wxWidgets.wxconfig}"
destroot.cmd ${python.bin} WXPORT="mac" WX_CONFIG="${wxWidgets.wxconfig}"
# TODO: test if this works on 10.7
post-patch {
reinplace "s|# @@FLAGS1@@|cflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/
reinplace "s|# @@FLAGS2@@|lflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/
if {${wxWidgets.sdk} ne ""} {
reinplace "s|# @@FLAGS3@@|cflags.extend(\[\"-isysroot\", \"${wxWidgets.sdk}\"\])|" ${worksrcpath}/
post-destroot {
delete ${destroot}${wxWidgets.prefix}
variant gtk conflicts carbon description {use wxGTK} {
wxWidgets.use wxGTK-2.8
# not sure if/what other dependencies should be listed here
depends_build port:pkgconfig
depends_lib-append path:lib/pkgconfig/cairo.pc:cairo \
port:gtk2 \
require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11
require_active_variants gtk2 x11
build.cmd ${python.bin} WXPORT="gtk2" WX_CONFIG="${wxWidgets.wxconfig}"
destroot.cmd ${python.bin} WXPORT="gtk2" WX_CONFIG="${wxWidgets.wxconfig}"
post-patch {
reinplace "s|# @@FLAGS1@@|cflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/
reinplace "s|# @@FLAGS2@@|lflags.extend(\[\"-arch\", \"[join [get_canonical_archs] {\", \"-arch\", \"}]\"\])|" ${worksrcpath}/
post-destroot {
delete ${destroot}${wxWidgets.prefix}
if {![variant_isset carbon] && ![variant_isset gtk]} {
# gtk will be the default variant
# using +carbon is possible on <= 10.6 (or 10.7 with an old Xcode version)
default_variants-append +gtk
livecheck.type none
} else {
# Once upon a time this would install the documentation,
# however the python PortGroup disables all steps including fetching & extracting
# which makes it a bit inconvenient to do things like this.
# If anyone is missing the docs badly enough, you are welcome to fix this
# in both py-wxpython-2.8 and py-wxpython-3.0.
# post-destroot {
# xinstall -d -m 755 ${destroot}${prefix}/share/doc/
# file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${name}
# file copy ${worksrcpath}/samples ${destroot}${prefix}/share/doc/${name}/examples
# }
livecheck.regex tarball/wxPy-(2\\.8\\.\[^"\]+)