# -*- 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                fireworkx
version             2.2
categories          x11
license             GPL-2+
platforms           darwin
maintainers         nomaintainer
description         pyrotechnic simulation eye-candy for X11
long_description    ${description}

homepage            http://www.ronybc.com/fireworkx.php
master_sites        http://www.ronybc.com/download
extract.suffix      .src${extract.suffix}

checksums           rmd160  ee1a8af9148421fbe4c50cbf6ad23ecfbfec48bf \
                    sha256  fb24bd3fb103987913638fd271269e0235dc0c32e34c95652e49c0c81749a44d

depends_build-append    port:pkgconfig port:cctools
depends_lib         port:xorg-libX11

use_configure       no

post-patch {
    reinplace "s|pkg-config|${prefix}/bin/pkg-config|" ${worksrcpath}/compile_x11
    reinplace "s|strip -sv|strip |" ${worksrcpath}/compile_x11
}

destroot {
    xinstall -m 755 -s ${worksrcpath}/fireworkx-x11 ${destroot}${prefix}/bin/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} ChangeLog.txt LICENSE \
        ${destroot}${prefix}/share/doc/${name}
}

variant universal {}

build.cmd "./compile_x11 fireworkx-x11"
build.args CFLAGS="${configure.cflags} [get_canonical_archflags cc] ${configure.cppflags}" \
           LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]" \
           CC="${configure.cc}"

livecheck.type	regex
livecheck.regex	${name}-(\[0-9.\]+)${extract.suffix}