Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

209.10. sdl3-mixer-3.2.4

Play music and sound effects from SDL3 programs: Ogg, Opus, FLAC, MP3, WavPack, MOD, MIDI and chiptunes

Version 3.2.4, release 1
Shelf game-libs — Game engines and game-development libraries, SDL in all versions, and shared game libraries
Phase 42_graphics (Graphics Stack), 100 of 189 in build order
Licence Zlib
Homepage https://github.com/libsdl-org/SDL_mixer
Build time 0.1 SBU
Installed size 668.1 KiB in 134 files
Recipe ports/core/game-libs/sdl3-mixer/kpkgbuild

About

SDL3_mixer plays sound effects and music for SDL 3 programs, mixing any number of tracks into one sdl3 audio stream: WAV, AIFF, AU, VOC, FLAC, Ogg Vorbis, Opus, MP3 and WavPack files, tracker modules, MIDI scores and the console chiptune formats. As in sdl2-mixer, its SDL 2 counterpart, every compressed format is decoded by the library port that owns it, linked rather than loaded at run time, and the single-file decoders upstream compiles in (dr_flac, dr_mp3, stb_vorbis) are left out.

Why it is in KDOS

The comment above the 9 ports from sdl2-image to sdl3-ttf in script/phases/42_graphics/packages.d/game-libs.txt:

The SDL satellites for SDL 2 and SDL 3. There is no sdl2-config: a build that asks for it is given pkg-config sdl2, and an SDL 2 program runs on SDL 3 through sdl2-compat.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, perl, sdl3, flac, libogg, libvorbis, opus, opusfile, mpg123, wavpack, libxmp, libgme, fluidsynth.

Required by: no port names it.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install sdl3-mixer'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/game-libs/sdl3-mixer.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/game-libs/sdl3-mixer
echo '182a07c745375e113dc740d43964ff21b0be29f29f59876c4dbc4db3d32f6901  sdl3-mixer-3.2.4.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/sdl3-mixer
SRC=$SRC_ROOT/sdl3-mixer-3.2.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf sdl3-mixer-3.2.4.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

mkdir -p build && cd build
cmake .. -G Ninja \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DBUILD_SHARED_LIBS=ON \
	-DSDLMIXER_VENDORED=OFF \
	-DSDLMIXER_STRICT=ON \
	-DSDLMIXER_DEPS_SHARED=OFF \
	-DSDLMIXER_TESTS=OFF \
	-DSDLMIXER_EXAMPLES=OFF \
	-DSDLMIXER_INSTALL_MAN=ON \
	-DSDLMIXER_FLAC=ON \
	-DSDLMIXER_FLAC_LIBFLAC=ON \
	-DSDLMIXER_FLAC_DRFLAC=OFF \
	-DSDLMIXER_GME=ON \
	-DSDLMIXER_MOD=ON \
	-DSDLMIXER_MOD_XMP=ON \
	-DSDLMIXER_MOD_XMP_LITE=OFF \
	-DSDLMIXER_MP3=ON \
	-DSDLMIXER_MP3_MPG123=ON \
	-DSDLMIXER_MP3_DRMP3=OFF \
	-DSDLMIXER_MIDI=ON \
	-DSDLMIXER_MIDI_FLUIDSYNTH=ON \
	-DSDLMIXER_MIDI_TIMIDITY=ON \
	-DSDLMIXER_OPUS=ON \
	-DSDLMIXER_VORBIS_VORBISFILE=ON \
	-DSDLMIXER_VORBIS_STB=OFF \
	-DSDLMIXER_VORBIS_TREMOR=OFF \
	-DSDLMIXER_WAVPACK=ON
ninja
DESTDIR=$PKG ninja install

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/sdl3-mixer, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf sdl3-mixer-3.2.4-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/sdl3-mixer, and runs the triggers its paths call for.

Contents

Installed libraries: libSDL3_mixer.so.

Installed directories: /usr/include/SDL3_mixer, /usr/lib/cmake/SDL3_mixer, /usr/share/licenses/SDL3_mixer, /usr/share/licenses/sdl3-mixer.

Short descriptions

sdl3-mixer.pc mixer library for Simple DirectMedia Layer