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 givenpkg-config sdl2, and an SDL 2 program runs on SDL 3 through sdl2-compat.
Sources
sdl3-mixer-3.2.4.tar.gz(4.9 MiB)
sha256182a07c745375e113dc740d43964ff21b0be29f29f59876c4dbc4db3d32f6901
upstream: https://github.com/libsdl-org/SDL_mixer/releases/download/release-3.2.4/SDL3_mixer-3.2.4.tar.gz
archive copy: sources-2/game-libs--sdl3-mixer-3.2.4.tar.gz
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:
-DSDLMIXER_VENDORED=OFF— Builds against the root’s codec libraries rather than upstream’s own copies, which are git submodules thatexternal/download.shfetches and the release tarball does not contain. This is upstream’s default everywhere but MSVC and Android, named here.-DSDLMIXER_STRICT=ON— Stops configure when a library a named format needs is missing. Upstream’s default is off, and a missing library then builds the library without that format.-DSDLMIXER_DEPS_SHARED=OFF— Links each codec library. Upstream’s default loads each one withdlopenat run time instead; a dlopened library is a dependency the package solver cannot see, and a missing one is a format that silently stops playing.-DSDLMIXER_TESTS=OFF,-DSDLMIXER_EXAMPLES=OFF— Builds neither the unit tests nor the example programs, which upstream builds by default when SDL3_mixer is the top-level project.-DSDLMIXER_INSTALL_MAN=ON— Generates and installs a manual page for every public function. Upstream’s default is off. The pages are written from the headers bybuild-scripts/wikiheaders.pl, which is why perl is independs.-DSDLMIXER_FLAC_LIBFLAC=ON,-DSDLMIXER_FLAC_DRFLAC=OFF— FLAC through flac’s libFLAC alone; upstream also builds the dr_flac copy by default.-DSDLMIXER_MP3_MPG123=ON,-DSDLMIXER_MP3_DRMP3=OFF— MP3 through mpg123 alone; upstream also builds the dr_mp3 copy by default.-DSDLMIXER_VORBIS_VORBISFILE=ON,-DSDLMIXER_VORBIS_STB=OFF,-DSDLMIXER_VORBIS_TREMOR=OFF— Ogg Vorbis through libvorbis’s vorbisfile alone, without the stb_vorbis copy upstream builds by default and without Tremor, the integer-only decoder, which is not a port.-DSDLMIXER_MOD_XMP=ON,-DSDLMIXER_MOD_XMP_LITE=OFF— Tracker modules through the full libxmp, not libxmp-lite, which plays fewer formats.-DSDLMIXER_MIDI_FLUIDSYNTH=ON— MIDI through fluidsynth, tried before the built-in Timidity. With no SoundFont given by the program, it opens the first of three distribution paths that exists;/usr/share/soundfonts/default.sf2, which fluidr3-gm-sf3 installs, is one of them. With none of the three present, FluidSynth still accepts the score and plays it silent; it does not pass it on to Timidity.-DSDLMIXER_MIDI_TIMIDITY=ON— SDL3_mixer’s own copy of Timidity, which plays a score only when FluidSynth refuses it. It needs atimidity.cfgand a patch set, named byTIMIDITY_CFGor found at one of three paths under/etcor astimidity.cfgin the working directory, and no port installs one.-DSDLMIXER_FLAC=ON,-DSDLMIXER_GME=ON,-DSDLMIXER_MOD=ON,-DSDLMIXER_MP3=ON,-DSDLMIXER_MIDI=ON,-DSDLMIXER_OPUS=ON,-DSDLMIXER_WAVPACK=ON— Upstream’s defaults, named in the recipe. The chiptune formats go through libgme, Opus through opusfile, WavPack through wavpack.
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 |