# $Id: Portfile 99858 2012-11-19 15:15:00Z jwa@macports.org $

PortSystem 1.0
PortGroup	python 1.0

name		py-wxpython30
version		2.9.4.0

categories	python graphics
platforms	darwin
license         wxwidgets-3.1

maintainers	jwa
description	Python interface to the wxWindows 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 popular wxWindows cross platform GUI library, \
    which is written in C++.

homepage	http://www.wxpython.org/
master_sites	sourceforge:wxpython

python.versions 27

distname	wxPython-src-${version}
use_bzip2	yes
checksums           rmd160  35e823d9161dc99083f3025383567000680e012f \
                    sha256  78c35c19e85a17cb9c730b86b49d6a479198d76d19e0b13e86db0b55707004be

worksrcdir	${distname}/wxPython

extract.post_args	"| tar -xf - ${worksrcdir} ${distname}/docs"

universal_variant	no

build.env	UNICODE="1" WXPORT="osx_cocoa" PATH="${prefix}/lib/wx/config:$env(PATH)"

destroot.env	UNICODE="1" WXPORT="osx_cocoa" PATH="${prefix}/lib/wx/config:$env(PATH)"

if {$subport != $name} {
    depends_lib-append  port:wxWidgets30

    if {${os.platform} == "darwin" && ${os.major} >= 10} {
        patchfiles    patch-config.py.diff
    }

    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
    }
}

if {$subport == $name} {
    livecheck.type	regex
    livecheck.url	${homepage}
    livecheck.regex	wxPython(?: | \\(classic\\) )(2\\.\[0-9\]+\\.\[0-9\]+\\.\[0-9\]+)
} else {
    livecheck.type      none
}
