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

209.9. sdl2-mixer-2.8.2

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

2.8.2-1 · Zlib · 0.1 SBU · 372.3 KiB, 12 files · 42_graphics, 99 of 189 · ports/core/game-libs/sdl2-mixer

Homepage: https://github.com/libsdl-org/SDL_mixer

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.

SDL2_mixer plays sound effects and music for SDL 2 programs: WAV, FLAC, Ogg Vorbis, Opus, MP3 and WavPack files, tracker modules, MIDI scores and the console chiptune formats. It is built against sdl2-compat, so its sound goes out through sdl3. Every compressed format is decoded by the library port that owns it, linked rather than loaded at run time, and the decoders upstream compiles in as single-file copies (dr_flac, minimp3, stb_vorbis) are left out.

Depends on: cmake, ninja, pkgconf, sdl2-compat, flac, libogg, libvorbis, opus, opusfile, mpg123, wavpack, libxmp, libgme, fluidsynth.

Required by (14): cataclysm-dda, chocolate-doom, crawl-tiles, crispy-doom, dsda-doom, fheroes2, flare-engine, freeciv, python3-kivy, sauerbraten, srb2, tuxpaint, wesnoth, widelands.

Sources: sdl2-mixer-2.8.2.tar.gz (5.7 MiB). Every step kpkg takes applies to this port.

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

build.sh:

mkdir -p build && cd build
cmake .. -G Ninja \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DBUILD_SHARED_LIBS=ON \
	-DSDL2MIXER_VENDORED=OFF \
	-DSDL2MIXER_DEPS_SHARED=OFF \
	-DSDL2MIXER_SAMPLES=OFF \
	-DSDL2MIXER_CMD=OFF \
	-DSDL2MIXER_FLAC=ON \
	-DSDL2MIXER_FLAC_LIBFLAC=ON \
	-DSDL2MIXER_FLAC_DRFLAC=OFF \
	-DSDL2MIXER_GME=ON \
	-DSDL2MIXER_MOD=ON \
	-DSDL2MIXER_MOD_XMP=ON \
	-DSDL2MIXER_MOD_XMP_LITE=OFF \
	-DSDL2MIXER_MOD_MODPLUG=OFF \
	-DSDL2MIXER_MP3=ON \
	-DSDL2MIXER_MP3_MPG123=ON \
	-DSDL2MIXER_MP3_MINIMP3=OFF \
	-DSDL2MIXER_MIDI=ON \
	-DSDL2MIXER_MIDI_FLUIDSYNTH=ON \
	-DSDL2MIXER_MIDI_TIMIDITY=ON \
	-DSDL2MIXER_OPUS=ON \
	-DSDL2MIXER_VORBIS=VORBISFILE \
	-DSDL2MIXER_WAVE=ON \
	-DSDL2MIXER_WAVPACK=ON
ninja
DESTDIR=$PKG ninja install

Libraries: libSDL2_mixer-2.0.so, libSDL2_mixer.so.

Directories: /usr/lib/cmake/SDL2_mixer, /usr/share/licenses/SDL2_mixer, /usr/share/licenses/sdl2-mixer.

sdl3-mixer is the SDL 3 counterpart, built with the same choice for every codec.