# -*- 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           cmake 1.1

name                libzita-resampler
version             1.11.2
revision            1

categories          audio
license             GPL-3+
maintainers         {@aeiouaeiouaeiouaeiouaeiouaeiou outlook.com:aeioudev} openmaintainer

description         Libzita-resampler is a C++ library for resampling audio \
                    signals.
long_description    {*}${description} It is designed to be used within a \
                    real-time processing context, to be fast, and to provide \
                    high-quality sample rate conversion.\
                    The library operates on signals represented in \
                    single-precision floating point format. For multichannel \
                    operation both the input and output signals are assumed to \
                    be stored as interleaved samples.\
                    The API allows a trade-off between quality and CPU load. \
                    For the latter a range of approximately 1:6 is available. \
                    Even at the highest quality setting libzita-resampler will \
                    be faster than most similar libraries, e.g. libsamplerate.

homepage            https://kokkinizita.linuxaudio.org/linuxaudio/
master_sites        ${homepage}downloads/

checksums           rmd160  85abd3195913a0896e8a8053270185814eaa0ac0 \
                    sha256  aa5c54e696069af26f3f1fed4a963113cc1237cddfd57ae5842abcb1acd5492c \
                    size    123452

use_xz              yes

distname            zita-resampler-${version}

# Makefiles are such a mess, so use the CMake patch from FreeBSD ports
patchfiles          use-cmake.diff

if {![variant_isset universal]} {
     if {${configure.build_arch} in {i386 x86_64}} {
          configure.cxxflags-append -DENABLE_SSE2
     } elseif {${configure.build_arch} eq "arm64"} {
          configure.cxxflags-append -DENABLE_NEON
     }
}

livecheck.url       ${master_sites}
livecheck.regex     {zita-resampler-(\d+(?:\.\d+)*)}
