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

name                wavpack
version             5.7.0
revision            0

checksums           rmd160  f907f245a6d8abe0ca4cc5efb5ba1fe8d2028fe3 \
                    sha256  8944b237968a1b3976a1eb47cd556916e041a2aa8917495db65f82c3fcc2a225 \
                    size    946431

categories          audio
license             BSD
maintainers         nomaintainer
description         Hybrid lossless audio compression
long_description    WavPack is a completely open audio compression format \
                    providing lossless, high-quality lossy, and a unique \
                    hybrid compression mode. Although the technology is \
                    loosely based on previous versions of WavPack, the new \
                    version 4 format has been designed from the ground up \
                    to offer unparalleled performance and functionality.
homepage            https://www.wavpack.com
master_sites        ${homepage}
use_bzip2           yes

depends_lib         port:libiconv

platform darwin {
    # handrolled asm has issues on older platforms.  Disable it if we don't have access to newer compilers.
    # Note that "libc++" is really a proxy here for "configuration that supports newer compilers"; the C++
    # runtime actually isn't relevant other than being a requirement of clang-3.5+.
    if {${configure.cxx_stdlib} eq "libc++"} {
        compiler.blacklist {macports-clang-3.[34]} {clang < 500} *gcc*
    } else {
        configure.args-append --disable-asm
    }
}

# unpack_armv7.S:1:1: error: unexpected token at start of statement
lappend merger_configure_args(arm64)    --disable-asm

# if host is not set in 32-bit mode, wrong assembly code is used
lappend merger_configure_args(i386)     --host=i686-apple-${os.platform}${os.version}

if {!(${universal_possible} && [variant_isset universal]) && [info exists merger_configure_args(${configure.build_arch})]} {
    configure.args-append   {*}$merger_configure_args(${configure.build_arch})
}

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