# $Id: Portfile 119085 2014-04-16 21:03:49Z jmr@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-SDL2
version             0.9.2
categories-append   devel multimedia
license             public-domain
platforms           darwin
supported_archs     noarch
maintainers         jmr openmaintainer
description         a python wrapper around the SDL2 library
long_description \
   PySDL2 is a wrapper around the SDL2 library and as such similar to the \
   discontinued PySDL project. In contrast to PySDL, it has no licensing \
   restrictions, nor does it rely on C code, but uses ctypes instead.

homepage            https://bitbucket.org/marcusva/py-sdl2
master_sites        ${homepage}/downloads/
distname            PySDL2-${version}

checksums           rmd160 5c442efe3c2c86f751fe99f13060efda3d5557b1 \
                    sha256 946ac1f3c44acdb2e8d421724e18eaeaa7cff73b56273d10677804cbbc2a1919

python.versions     27 32 33 34

if {$subport ne $name} {
    depends_lib-append  port:libsdl2 \
                        port:libsdl2_image \
                        port:libsdl2_mixer \
                        port:libsdl2_ttf

    patchfiles          dll.py.patch
    post-patch {
        reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/sdl2/dll.py
    }

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       [lindex $master_sites 0]
    livecheck.regex     PySDL2-(\[0-9.\]+)${extract.suffix}
}
