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

set modname         ayfly
name                lib${modname}
github.setup        l29ah ${modname} c1ff6d559edc24ec43c7df0bf23a4531b976133d
version             20201225
revision            0
categories          audio
# https://github.com/l29ah/ayfly/issues/7
license             GPL-2
maintainers         nomaintainer
description         Cross-platform AY-3-8910 music player library
long_description    {*}${description}
checksums           rmd160  706389b266d27a1042576623cd2bec6d489995e3 \
                    sha256  2f1a82e1b649dcc96f3eda47e3edfcec9afbea096bfc73918b0b6c4336a319fd \
                    size    190297
github.tarball_from archive

use_autoreconf      yes
autoreconf.cmd      ./autogen.sh
autoreconf.args

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool

compiler.cxx_standard   2011

configure.args-append \
                    --without-audio \
                    --without-gui

post-destroot {
    xinstall -d ${destroot}${prefix}/include/${name}
    foreach h {AbstractAudio.h ay.h ayfly.h ayflyString.h Filter3.h} {
        copy ${worksrcpath}/src/${name}/${h} ${destroot}${prefix}/include/${name}/
    }
    copy ${worksrcpath}/src/${name}/${name}.a ${destroot}${prefix}/lib
    copy ${worksrcpath}/src/${name}/z80ex/include/z80ex.h ${destroot}${prefix}/include/${name}/
    copy ${worksrcpath}/src/${name}/z80ex/include/z80ex_common.h ${destroot}${prefix}/include/${name}/
    copy ${worksrcpath}/src/${name}/z80ex/libz80ex.a ${destroot}${prefix}/lib
}
