PortSystem              1.0
PortGroup               app 1.0

name                    digger
version                 20020314
revision                2
categories              games
maintainers             nomaintainer

description             the Digger game
long_description        ${description}

homepage                http://www.digger.org/
master_sites            ${homepage}
checksums               md5 a16e90a49ed8ea90099b254d3ef5edfa \
                        rmd160 ccae7b37c6d7c4bfa438776f8fcb7bfd96087f08 \
                        sha256 e45cb1c5b67fba2fa1b768d1ed75153a64f82e73544c3d98eaf2c37b1dbefdc7
patchfiles              patch-def.h.diff \
                        patch-digger.c.diff \
                        patch-input.c.diff \
                        patch-scores.c.diff \
                        patch-input.h.diff \
                        patch-main.c.diff \
                        fbsd_sup.c.diff

depends_lib             port:libsdl \
                        port:zlib

platform darwin {
    patchfiles-append   patch-Makefile.sdl.diff
}

use_configure           no

variant universal {}

build.args              -f Makefile.sdl
build.env               CC=${configure.cc} \
                        "CFLAGS=${configure.cppflags} ${configure.cflags} [get_canonical_archflags cc]" \
                        "LIBS=${configure.ldflags} [get_canonical_archflags ld]"

destroot {
    xinstall -d  ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 ${worksrcpath}/digger.txt \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -s ${worksrcpath}/digger ${destroot}${prefix}/bin
}

app.executable          ${workpath}/${name}
app.icon                ${filespath}/icon.png

platform macosx {
    post-extract {
        xinstall ${filespath}/Digger.darwin ${workpath}/${name}
    }
    post-patch {
        reinplace "s|_PREFIX_|${prefix}|g" ${workpath}/${name}
    }
}

livecheck.type          regex
livecheck.url           ${homepage}download.html
livecheck.regex         ${name}-(\[0-9.\]+)\\.tar