# -*- 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
# $Id: Portfile 67314 2010-05-05 10:45:29Z jmr@macports.org $

PortSystem 1.0
PortGroup python25 1.0

name            py25-game
version         1.9.1
revision        3
categories      python devel multimedia graphics
platforms       darwin
maintainers     jmr openmaintainer
description     pygame, python modules for writing games
long_description    Pygame is a set of Python modules designed for \
            writing games. It is written on top of the excellent \
            SDL library. This allows you to create fully featured \
            games and multimedia programs in the python language. \
            Pygame is highly portable and runs on nearly every \
            platform and operating system.
homepage        http://www.pygame.org/

master_sites    ${homepage}ftp/
distname        pygame-${version}release
checksums       md5 1c4cdc708d17c8250a2d78ef997222fc \
                sha1 a45aeb0623e36ae7a1707b5f41ee6274f72ca4fa \
                rmd160 352d74d6cb025e7489e1123a7a25d1695beabafb

patchfiles      patch-config_darwin.py.diff \
                patch-disable_portmidi.diff

depends_lib-append     path:lib/pkgconfig/sdl.pc:libsdl \
                port:libsdl_mixer \
                port:libsdl_image \
                port:libsdl_ttf \
                port:smpeg \
                port:py25-numpy

use_configure   yes
configure.env-append LOCALBASE=${prefix}
configure.cmd   ${python.bin} config.py

post-destroot   {
    delete ${destroot}${prefix}/share/doc/${name}/examples
    eval copy [glob ${worksrcpath}/docs/*] ${destroot}${prefix}/share/doc/${name}
    copy ${worksrcpath}/examples ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} install.html WHATSNEW \
        README.txt ${destroot}${prefix}/share/doc/${name}
}

variant portmidi description {Enable MIDI support using portmidi (experimental)} {
    depends_lib-append port:portmidi
    patchfiles-delete patch-disable_portmidi.diff
}

livecheck.type  regex
livecheck.url   ${homepage}download.shtml
livecheck.regex {<a href=".*/ftp/pygame\-([0-9\.]+)release\.tar\.gz">}
