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

205.1. mpd-0.24.15

Music Player Daemon — plays music for separate client programs

Version 0.24.15, release 2
Shelf music-players — Music players, library managers and taggers
Phase 42_graphics (Graphics Stack), 145 of 189 in build order
Licence GPL-2.0-or-later
Homepage https://www.musicpd.org/
Build time 2.2 SBU
Installed size 2.3 MiB in 13 files
Recipe ports/core/music-players/mpd/kpkgbuild

About

mpd, the Music Player Daemon, is the playing half of a music player: it holds the library and the queue and drives the sound card, and separate client programs such as rmpc attach to its socket to control it. The port ships no configuration file. The per-user service /etc/kdos/user-services/25_mpd.sh starts mpd from a user’s first login to the last logout, and only when a configuration exists in one of the places mpd itself reads. Plasma’s media controls and the media keys reach it over MPRIS through kdos-mpctl mpris, described in kdos-mpctl.

Every feature option is named on or off. A meson feature option left at its default is auto, which builds the plugin when its library happens to be in the build root, so naming each one keeps the plugin set the same on every build and turns a missing library into a failed configure.

Why it is in KDOS

The comment above it in script/phases/42_graphics/packages.d/music-players.txt:

The player and the playback are separate processes: the music survives the terminal closing, the session locking and the client dying, and a client can attach from anywhere that reaches the socket — including over ssh from another machine on the LAN. mpd is the daemon half and ships no configuration, so it has a library only once somebody writes one — and the session starts it, and the panel's now-playing watcher, only then.

Sources

Dependencies

Depends on: meson, ninja, pkgconf, ffmpeg, alsa-lib, pipewire, libsndfile, flac, libvorbis, opus, sqlite, icu, fmt, curl, python3-sphinx, zlib, pcre2, expat, libid3tag, libsamplerate, soxr, fluidsynth, libmikmod, mpg123, lame, liburing, libcdio, libcdio-paranoia, twolame, chromaprint, fluidr3-gm-sf3.

Required by (1): rmpc.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

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 mpd'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/music-players/mpd.

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/music-players/mpd
echo '524c70bce3fcd268016156bdc97abcf5be1904f0c6fd622688999123e3c4c457  mpd-0.24.15.tar.xz' | 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/mpd
SRC=$SRC_ROOT/mpd-0.24.15
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf mpd-0.24.15.tar.xz -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:

meson setup build \
	--prefix=/usr \
	--sysconfdir=/etc \
	--libdir=lib \
	--buildtype=release \
	--wrap-mode=nofallback \
	-Dalsa=enabled \
	-Dpipewire=enabled \
	-Dpulse=disabled \
	-Djack=enabled \
	-Dsndio=disabled \
	-Dao=disabled \
	-Dopenal=disabled \
	-Doss=disabled \
	-Dshout=disabled \
	-Dsolaris_output=disabled \
	-Dhttpd=false \
	-Dsnapcast=false \
	-Dnlohmann_json=disabled \
	-Dffmpeg=enabled \
	-Dflac=enabled \
	-Dvorbis=enabled \
	-Dopus=enabled \
	-Dsndfile=enabled \
	-Dmpg123=enabled \
	-Did3tag=enabled \
	-Dmikmod=enabled \
	-Dfluidsynth=enabled \
	-Dmad=disabled \
	-Dfaad=disabled \
	-Dwavpack=disabled \
	-Dadplug=disabled \
	-Daudiofile=disabled \
	-Dgme=disabled \
	-Dmodplug=disabled \
	-Dopenmpt=disabled \
	-Dmpcdec=disabled \
	-Dsidplay=disabled \
	-Dtremor=disabled \
	-Dwildmidi=disabled \
	-Dchromaprint=enabled \
	-Dlame=enabled \
	-Dvorbisenc=enabled \
	-Dtwolame=enabled \
	-Dshine=disabled \
	-Dsoxr=enabled \
	-Dlibsamplerate=enabled \
	-Dsqlite=enabled \
	-Dicu=enabled \
	-Diconv=disabled \
	-Dpcre=enabled \
	-Dexpat=enabled \
	-Dzlib=enabled \
	-Dbzip2=disabled \
	-Dzzip=disabled \
	-Diso9660=enabled \
	-Dcdio_paranoia=enabled \
	-Dcurl=enabled \
	-Dmms=disabled \
	-Dnfs=disabled \
	-Dsmbclient=disabled \
	-Dwebdav=disabled \
	-Dqobuz=disabled \
	-Dupnp=disabled \
	-Dlibmpdclient=disabled \
	-Dudisks=disabled \
	-Ddbus=disabled \
	-Dzeroconf=disabled \
	-Dio_uring=enabled \
	-Dsyslog=enabled \
	-Dipv6=enabled \
	-Dsystemd=disabled \
	-Ddocumentation=enabled \
	-Dhtml_manual=false \
	-Dmanpages=true
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

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/mpd, 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 mpd-0.24.15-2.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/mpd, and runs the triggers its paths call for.

Contents

Installed programs: mpd.

Installed directories: /usr/share/doc/mpd, /usr/share/licenses/mpd.

Short descriptions

mpd MPD documentation