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

name                bzflag
version             2.4.30
revision            0
categories          games
maintainers         {allejo.io:me @allejo} openmaintainer
license             {LGPL-2.1 MPL-2}

description         3D tank game, multiplayer and internet gaming available
long_description    BZFlag is a free multiplayer multiplatform 3D tank \
                    battle game. The name stands for Battle Zone capture Flag.

homepage            https://www.bzflag.org/
master_sites        https://download.bzflag.org/bzflag/source/${version}/
use_bzip2           yes

checksums           rmd160  74e2cc066be9e3e7fd3b00395809986263a615ae \
                    sha256  bb78b750e7bce7aa7c11bd35906bb08a49acc7c50bf29629af380eecd153894d \
                    size    14131760

depends_build       port:pkgconfig
depends_lib         port:c-ares \
                    port:curl \
                    port:glew \
                    port:libsdl2 \
                    port:ncurses \
                    port:zlib

compiler.cxx_standard 2011

post-extract {
    set configure_file [file join ${worksrcpath} configure]
    set f [open $configure_file r]
    set contents [read $f]
    close $f
    # Remove ccache from CC and CXX assignments
    set contents [string map {{CC="ccache } {CC="} {CXX="ccache } {CXX="}} $contents]
    set f [open $configure_file w]
    puts -nonewline $f $contents
    close $f
}

configure.args      --libdir=${prefix}/lib/${name} \
                    --disable-sdltest

app.name            BZFlag
app.icon            data/bzflag-256x256.png

livecheck.url       https://download.bzflag.org/bzflag/source/
livecheck.regex     {(\d+(?:\.(?:\d|\w)+)*)/}
