# -*- 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       muniversal 1.0
PortGroup       compiler_blacklist_versions 1.0

name            libopus
version         1.5.2
categories      audio
license         BSD
maintainers     {jeremyhu @jeremyhu} openmaintainer
description     The Opus Audio Codec (IETF RFC 6716), reference implementation

long_description \
    Opus is the first state-of-the-art, fully Free and Open audio codec \
    ratified by a major standards organization.  It is reportedly better than \
    all pre-existing codecs across the spectrum for voice, audio, archival, \
    and real-time uses.

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

# Checking how to get X86 CPU Info... configure: error:
# no supported Get CPU Info method, please disable intrinsics
# Also fails on powerpc with Xcode gcc.
compiler.blacklist-append \
                *gcc-4.* {clang < 500}

checksums       rmd160  2a1ce460ea52fed17b70f6daecb5daa01f830051 \
                sha256  65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1 \
                size    7839412

distname        opus-${version}

depends_build-append \
                path:bin/pkg-config:pkgconfig

configure.args  --disable-silent-rules

platform darwin 10 {
    # See: https://trac.macports.org/ticket/64611
    if {${build_arch} eq "ppc"} {
        configure.args-append   --build=powerpc-apple-darwin${os.major}
    }
}

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex opus-(\[\\d.\]+)${extract.suffix}
