# -*- 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

name                    xgalaga
version                 2.1.1.0
revision                2
checksums               rmd160  b55a97187b61ffe7c072ecd784cf9a16fe568c26 \
                        sha256  adcfbfd04876f5197c60b37af0ad89a629e553d6e09314a4b3b5c70f6c634f9b \
                        size    331621

categories              games x11
license                 GPL-2
maintainers             nomaintainer
description             xgalaga is a rework of the Galaga shooting game.
long_description        ${description}

homepage                https://sourceforge.net/projects/xgalaga/
master_sites            sourceforge

patchfiles              patch-Makefile.in.diff \
                        patch-main.c.diff \
                        implicit.patch \
                        implicit-int.patch

depends_lib             port:xorg-libX11 \
                        port:xorg-libXext \
                        port:xorg-libXmu \
                        port:xorg-libXt \
                        port:xpm

# The shipped config.guess and config.sub are too old to recognize OS X.
# https://sourceforge.net/p/xgalaga/bugs/2/
pre-configure {
    xinstall -m 644 -W ${prefix}/share/libtool/build-aux config.guess config.sub ${worksrcpath}
}
use_autoconf            yes

# The configure script uses these variables incorrectly, hence the strange values.
configure.pre_args      --prefix=${prefix}/share/${name}
configure.args          --exec-prefix=${prefix}/bin \
                        --mandir=${prefix}/share/man \
                        --with-xpm-lib=${prefix}/lib

post-destroot {
    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        CHANGES \
        CREDITS \
        README \
        README.SOUND \
        ${destroot}${docdir}
}
