# -*- 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.0
PortGroup       github 1.0

name            SDL3_mixer
github.setup    libsdl-org SDL_mixer 3.2.0 release-
categories      audio devel
platforms       {darwin >= 20}
license         zlib
maintainers     {jmr @jmroot} openmaintainer
description     Audio mixer library for SDL3

long_description \
    A library to manage audio in SDL3-based games. It offers audio \
    file decoding for several popular formats, such as WAV, MP3, and \
    Ogg Vorbis, and provides sample-perfect mixing of multiple \
    sources of audio, with various effects, and other advanced \
    features.

github.tarball_from releases
distname        ${name}-${version}

checksums       rmd160 f92c85a288fd86693808ec360d3561520dbf49a4 \
                sha256 1f86fae7226d58f2ad210ca4d9e06488db722230032803423d83bad6d35fc395

depends_build-append   path:bin/pkg-config:pkgconfig
depends_lib     port:SDL3 \
                port:flac \
                port:game-music-emu \
                port:libvorbis \
                port:libxmp \
                port:mpg123 \
                port:opusfile \
                port:wavpack

cmake.out_of_source yes

configure.args-append   -DSDLMIXER_STRICT=ON \
                        -DSDLMIXER_INSTALL_MAN=ON \
                        -DSDLMIXER_TESTS_INSTALL=OFF \
                        -DSDLMIXER_EXAMPLES_INSTALL=OFF \
                        -DSDLMIXER_MIDI_FLUIDSYNTH=OFF \
                        -DSDLMIXER_DEPS_SHARED=OFF

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} CHANGES.txt README.md \
        ${destroot}${docdir}
}
