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

github.setup        joshkunz ashuffle 3.14.10 v
revision            1
categories          audio
license             MIT
maintainers         {l2dy @l2dy} \
                    openmaintainer

description         Shuffle library for mpd
long_description    ${name} is an application for automatically shuffling \
                    your MPD library in a similar way to a more standard music \
                    player's "shuffle library" feature.

checksums           rmd160  3c6460e3978143b508bdfae2925d3f3ff5fb6436 \
                    sha256  66e1f29f309567873bb6d7bbcc21c84d00c30e9d8d40989a0db74629db3b9303 \
                    size    96438
github.tarball_from archive

# getpass.cc:54:26: error: 'getline' was not declared in this scope; did you mean 'std::getline'?
legacysupport.newest_darwin_requires_legacy 10
# ashuffle(37507) malloc: *** error for object 0xa04da7c4: pointer being freed was not allocated
legacysupport.redirect_bins ${name}

# Fix compatibility with abseil 20260526:
patchfiles-append   patch-abseil.diff

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

depends_lib-append  port:abseil \
                    port:libmpdclient \
                    port:yaml-cpp

compiler.cxx_standard   2017

configure.args-append \
                    -Dunsupported_use_system_absl=true \
                    -Dunsupported_use_system_yamlcpp=true

variant cxx17 conflicts cxx20 description "Use C++17" {
    require_active_variants abseil cxx17
}

variant cxx20 conflicts cxx17 description "Use C++20" {
    require_active_variants abseil cxx20
    compiler.cxx_standard   2020
    patchfiles-append       patch-abseil-cxx20.diff
}

if ![variant_isset cxx17] {
    default_variants +cxx20
}
