# -*- 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           active_variants 1.1
PortGroup           github 1.0

github.setup        XQF xqf 1.0.6.2 xqf-
revision            2
categories          games
platforms           darwin
maintainers         nomaintainer
license             GPL-2+

homepage            https://xqf.github.io/
description         GTK+ Front-end to Qstat

long_description    XQF is a game server browser and launcher for \
                    Unix/X11 for many popular games such as the \
                    Quake series, Unreal Tournament series, Half-Life \
                    etc.

checksums           rmd160  bdeeebe3439038cc1c3afda2aed65efff3dabeb6 \
                    sha256  25a47bae28ae22acce9839bacd39cf0b2e1b00feb1a9be9eab65740f2ad8ecfb

depends_build       port:pkgconfig \
                    port:autoconf \
                    port:automake \
                    port:intltool

depends_lib         port:desktop-file-utils \
                    port:bzip2 \
                    port:gdk-pixbuf2 \
                    port:gtk2 \
                    port:libgeoip \
                    port:readline \
                    port:qstat

patchfiles          patch-Makefile.am.diff
                    
# requires gdk-pixbuf2 +x11
# requires gtk2 +x11
require_active_variants gdk-pixbuf2 x11
require_active_variants gtk2 x11

configure.cmd       ./autogen.sh && ./configure

configure.args      --mandir=${prefix}/share/man \
                    --with-qstat=${prefix}/bin/qstat \
                    --enable-bzip2 \
                    --enable-externalrcon

# Undefined symbols: "_get_debug_level"
configure.cflags-append -std=gnu89

post-destroot {
    file mkdir ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -v -W ${worksrcpath} \
    AUTHORS BUGS COPYING NEWS README TODO \
        ${destroot}${prefix}/share/doc/${name}
    file copy ${worksrcpath}/docs/xqfdocs.html \
        ${destroot}${prefix}/share/doc/${name}
}

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
}
