# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake 1.0

name                libtuxcap
version             1.4.0
revision            8
checksums           rmd160  43d236b65fd6bb28b3ceaa6ba3193ecbcc5e6675 \
                    sha256  dae27bad276bffce6eba8114cd0e3edc0db710306f627b984464c4f0ec1fab2f \
                    size    4622159

categories          devel games
maintainers         {ryandesign @ryandesign} openmaintainer
license             PopCap

description         framework for 2-D game development

long_description    TuxCap is a port of the PopCap games framework used for \
                    2-D game development. It comes with PyCap Python \
                    bindings, a fast 2-D physics engine, a particle engine, \
                    widgets and many documented examples.

homepage            https://sourceforge.net/projects/tuxcap/
master_sites        sourceforge:project/tuxcap/tuxcap/libtuxcap-${version}

# Upstream distfiles disappeared years ago.
# https://sourceforge.net/p/tuxcap/bugs/4/
master_sites        macports_distfiles
livecheck.type      none

depends_lib         port:ImageMagick \
                    port:libsdl \
                    port:libsdl_mixer \
                    port:python27

depends_run         port:glxinfo

patchfiles          patch-tuxcap-CMakeModules-FindImageMagickLib.cmake.diff \
                    patch-tuxcap-include-Physics.h.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/tuxcap/CMakeModules/FindImageMagickLib.cmake
}

configure.dir       ${worksrcpath}/tuxcap-build
build.dir           ${configure.dir}

configure.args-append \
                    -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/include/python2.7 \
                    -DPYTHON_LIBRARY=${prefix}/lib/libpython2.7.dylib \
                    ..

livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}
