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 givenpkg-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
-DSDL2MIXER_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.-DSDL2MIXER_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.-DSDL2MIXER_CMD=OFF— Builds without the external-player interface, through which a program that callsMix_SetMusicCMDhands its music files to an outside command that SDL2_mixer forks and runs.Mix_SetMusicCMDstill returns success, the command is never run, and the file is decoded in the library. Upstream’s default on Linux is on.-DSDL2MIXER_FLAC_LIBFLAC=ON,-DSDL2MIXER_FLAC_DRFLAC=OFF— FLAC through flac’s libFLAC instead of the dr_flac copy compiled into the library, which is upstream’s default. SDL2_mixer tries dr_flac first when both are built.-DSDL2MIXER_GME=ON— The console and computer chiptune formats (NSF, SPC, GBS, VGM and the rest) through libgme. Upstream’s default is off.-DSDL2MIXER_MOD_XMP=ON,-DSDL2MIXER_MOD_XMP_LITE=OFF,-DSDL2MIXER_MOD_MODPLUG=OFF— Tracker modules through the full libxmp, not libxmp-lite, which plays fewer formats. ModPlug stays off although libmodplug is a port: it and libxmp claim the same formats, and the first decoder that accepts a file plays it.-DSDL2MIXER_MP3_MPG123=ON,-DSDL2MIXER_MP3_MINIMP3=OFF— MP3 through mpg123 instead of the minimp3 copy compiled into the library, which is upstream’s default and is tried first when both are built.-DSDL2MIXER_MIDI_FLUIDSYNTH=ON— MIDI through fluidsynth, tried before the built-in Timidity. With no SoundFont set by the program or inSDL_SOUNDFONTS, the one file it looks for is/usr/share/sounds/sf2/FluidR3_GM.sf2, which fluidr3-gm-sf3 installs. Without a SoundFont the FluidSynth player does not open, and a MIDI score falls to Timidity.-DSDL2MIXER_MIDI_TIMIDITY=ON— SDL2_mixer’s own copy of Timidity, the fallback when FluidSynth cannot play. It needs atimidity.cfgand a patch set, named byTIMIDITY_CFGor by the program, or found at/etc/timidity.cfg, at/etc/timidity/freepats.cfgor astimidity.cfgin the working directory, and no port installs one, so with neither player able to open a MIDI score does not load.-DSDL2MIXER_VORBIS=VORBISFILE— Ogg Vorbis through libvorbis’s vorbisfile instead ofSTB, the stb_vorbis copy compiled into the library, which is upstream’s default.-DSDL2MIXER_SAMPLES=OFF— Builds none of the sample players, which upstream builds by default when SDL2_mixer is the top-level project.-DSDL2MIXER_FLAC=ON,-DSDL2MIXER_MOD=ON,-DSDL2MIXER_MP3=ON,-DSDL2MIXER_MIDI=ON,-DSDL2MIXER_OPUS=ON,-DSDL2MIXER_WAVE=ON,-DSDL2MIXER_WAVPACK=ON— Upstream’s defaults, named in the recipe. Opus goes through opusfile, WavPack through wavpack.
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.