# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           openssl 1.0

name                opusfile
version             0.12
revision            2
categories          audio
license             BSD
maintainers         {devans @dbevans} openmaintainer
description         Library for decoding .opus files, including seeking support
long_description    ${description}.

homepage            https://opus-codec.org
master_sites        https://ftp.osuosl.org/pub/xiph/releases/opus/

checksums           rmd160  9b51fa303625462ce3a2c1b5fc1bfc552913d466 \
                    sha256  118d8601c12dd6a44f52423e68ca9083cc9f2bfe72da7a8c1acb22a80ae3550b \
                    size    471354

# Upstream is not interested to fix their bug.
# https://github.com/xiph/opusfile/issues/10
post-patch {
    reinplace "s|<opus_multistream.h>|\"opus_multistream.h\"|" \
                    ${worksrcpath}/include/opusfile.h
}

depends_build       path:bin/pkg-config:pkgconfig

depends_lib-append  port:libogg \
                    port:libopus

configure.args      --disable-silent-rules

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
