# -*- 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
PortGroup           ffmpeg 1.0
PortGroup           github 1.0
PortGroup           legacysupport 1.1

# Only wrapper
legacysupport.newest_darwin_requires_legacy 0
legacysupport.redirect_bins fpcalc

# Don't forget to revbump gstreamer1-gst-plugins-bad if
# update of chromaprint results in an ABI break
github.setup        acoustid chromaprint 1.6.1 v
revision            0
categories          audio
description         Chromaprint is an audio fingerprint library
long_description    Chromaprint is the core component of the AcoustID \
                    project. It's a client-side library that implements \
                    a custom algorithm for extracting fingerprints from \
                    any audio source.

maintainers         {khindenburg @kurthindenburg} openmaintainer

homepage            https://acoustid.org/${name}
license             LGPL-2.1+

checksums           rmd160  b283fd30dc65fbc2bb2bdae4e87b5711ce2de4ed \
                    sha256  7065ec9db48ac1fa929ec6c42afcd966605b1bfe48b6d5e64c25378a05f4fb02 \
                    size    1581744
github.tarball_from archive

compiler.cxx_standard \
                    2014

# Does not build with ffmpeg4 anymore, also rather match it to gstreamer1-gst-libav:
ffmpeg.version      8

depends_build-append \
                    port:gmake
depends_lib-append  port:zlib

# Darwin defaults to Accelerate.
if {${os.platform} ne "darwin"} {
    depends_lib-append      port:fftw-3
}

configure.args-append       -DBUILD_SHARED_LIBS=ON \
                            -DBUILD_TESTS=OFF \
                            -DBUILD_TOOLS=ON \
                            -DCMAKE_BUILD_TYPE=Release \
                            -DFFMPEG_ROOT=${ffmpeg.prefix}

variant tests description "Enable tests" {
    depends_build-append    port:gtest

    configure.args-replace  -DBUILD_TESTS=OFF -DBUILD_TESTS=ON
    configure.args-append   -DGTEST_ROOT=${prefix}/src/googletest

    test.run                yes
    test.cmd                env DYLD_LIBRARY_PATH=${cmake.build_dir}/src ${cmake.build_dir}/tests/all_tests
    test.target
}

github.livecheck.regex      (\[0-9.\]+)
