PortSystem          1.0
PortGroup           python 1.0

name                py-SDL2
version             0.9.7
categories-append   devel multimedia
license             public-domain
platforms           darwin
supported_archs     noarch
maintainers         {jmr @jmroot} 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.

python.rootname     PySDL2
homepage            https://pypi.org/project/${python.rootname}

checksums           md5 e77e9c15589e15b6c877555f34a429ab \
                    rmd160 e42e56957064a05ccfbbc133dc6615aae05e97bd \
                    sha256 e4fcc8aa1108e4917cb56794575ee08c2a3d9c2c52620474e3ecc8538dadf209

python.versions     27 34 35 36 37 38 39

if {$subport ne $name} {
    # setuptools dep added after 0.9.7 tagged; possible mistake?
    depends_build       port:py${python.version}-setuptools
    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
}
