PortSystem              1.0
PortGroup               app 1.0

name                    alienblaster
version                 1.1.0
revision                1
categories              games
platforms               darwin
maintainers             nomaintainer
license                 GPL-2+
installs_libs           no

description             action loaded 2D arcade shooter for up to two players
long_description        ${description}

homepage                http://www.schwardtnet.de/alienblaster/
master_sites            ${homepage}archives/
extract.suffix          .tgz

checksums               md5 27412a868f7d4ae0949036aeb29a6691

depends_lib             port:libsdl \
                        port:libsdl_mixer

worksrcdir              ${name}

post-patch {
    reinplace "s|./images|${prefix}/share/${name}/images|g" \
        ${worksrcpath}/src/global.h \
        ${worksrcpath}/src/global.cc \
        ${worksrcpath}/cfg/level1.cfg \
        ${worksrcpath}/cfg/level2.cfg \
        ${worksrcpath}/cfg/levelArcade.cfg
    reinplace "s|=images/|=${prefix}/share/${name}/images/|g" \
        ${worksrcpath}/cfg/level1.cfg \
        ${worksrcpath}/cfg/level2.cfg \
        ${worksrcpath}/cfg/levelArcade.cfg
    reinplace "s|./cfg|${prefix}/etc/${name}|g" \
        ${worksrcpath}/src/global.h \
        ${worksrcpath}/src/global.cc
    reinplace "s|./sound|${prefix}/share/${name}/sound|g" \
        ${worksrcpath}/src/global.h \
        ${worksrcpath}/src/global.cc
}

use_configure           no

variant universal {}

build.args              COMPILER="${configure.cxx} [get_canonical_archflags]"

destroot {
    xinstall -m 755 -s ${worksrcpath}/alienBlaster ${destroot}${prefix}/bin
    xinstall -m 755 -d ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/sound ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/images ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/cfg ${destroot}${prefix}/etc/${name}
}

app.name                AlienBlaster
app.executable          alienBlaster
app.icon                images/alienblastericon.bmp
