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
mpd-0.24.15.tar.xz(999.3 KiB)
sha256524c70bce3fcd268016156bdc97abcf5be1904f0c6fd622688999123e3c4c457
upstream: https://www.musicpd.org/download/mpd/0.24/mpd-0.24.15.tar.xz
archive copy: sources-3/music-players--mpd-0.24.15.tar.xz
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.
-Dao=disabled, line 23: libao (explained with the switches below)-Dopenal=disabled, line 24: openal-soft-Dnlohmann_json=disabled, line 30: nlohmann-json (explained with the switches below)-Dmad=disabled, line 40: libmad (explained with the switches below)-Dwavpack=disabled, line 42: wavpack-Dadplug=disabled, line 43: adplug-Daudiofile=disabled, line 44: audiofile-Dgme=disabled, line 45: libgme-Dmodplug=disabled, line 46: libmodplug-Dopenmpt=disabled, line 47: libopenmpt-Dbzip2=disabled, line 65: bzip2 (explained with the switches below)-Dnfs=disabled, line 71: libnfs (explained with the switches below)-Dsmbclient=disabled, line 72: samba-Ddbus=disabled, line 78: dbus
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:
--wrap-mode=nofallback— never build a dependency from the wrap files insubprojects/(fmt, curl, expat, SQLite and others), which would download its source. A library missing from the build root fails the configure instead.-Dpipewire=enabled— The PipeWire output plugin, the sound server of the session.-Dalsa=enabled— The ALSA output plugin, for a configuration that writes to a card directly.-Djack=enabled— The JACK output plugin. No JACK port exists; it builds against thelibjackandjack.pcthat pipewire installs with-Dpipewire-jack=enabledand-Djack-devel=true, so its output goes to PipeWire’s JACK graph.-Dpulse=disabled— The PulseAudio output plugin. Its client library, libpulse, is a port but not independs; the PulseAudio server on KDOS is PipeWire’s, which the PipeWire plugin reaches directly.-Dsndio=disabled,-Doss=disabled,-Dsolaris_output=disabled— Output plugins for sndio, which is not a port, for OSS, and for Solaris/dev/audio.-Dao=disabled,-Dopenal=disabled— The libao and OpenAL output plugins. Both libraries are ports (libao, openal-soft) but neither is independs.-Dshout=disabled— The Icecast/Shoutcast streaming output, whose libshout is not a port.-Dhttpd=false,-Dsnapcast=false— The HTTP streaming and Snapcast outputs, two boolean options that upstream builds by default. Off, the daemon opens no streaming listener of its own.-Dnlohmann_json=disabled— The JSON library, nlohmann-json, a port but not independs; with it off the Qobuz client, which needs it, cannot be built either.-Dffmpeg=enabled— The FFmpeg decoder plugin, which plays every format FFmpeg reads, including the AAC, WavPack and Musepack files the dedicated decoders below would otherwise cover.-Dflac=enabled,-Dvorbis=enabled,-Dopus=enabled,-Dsndfile=enabled,-Dmpg123=enabled,-Did3tag=enabled,-Dmikmod=enabled— Decoders and the ID3 tag reader, each built against its port independs.-Dfluidsynth=enabled— The MIDI decoder, through fluidsynth. Its default soundfont is/usr/share/sounds/sf2/FluidR3_GM.sf2, which fluidr3-gm-sf3 provides as a link, so a MIDI file plays with nosoundfontline inmpd.conf.-Dmad=disabled,-Dfaad=disabled,-Dwavpack=disabled,-Dadplug=disabled,-Daudiofile=disabled,-Dgme=disabled,-Dmodplug=disabled,-Dopenmpt=disabled,-Dsidplay=disabled— Decoders whose libraries are ports but not independs(libmad, faad2, wavpack, adplug, audiofile, libgme, libmodplug, libopenmpt, libsidplayfp).-Dmpcdec=disabled,-Dtremor=disabled,-Dwildmidi=disabled— Decoders for Musepack, fixed-point Vorbis and WildMIDI, whose libraries are not ports.-Dchromaprint=enabled— AcoustID fingerprinting, through chromaprint.-Dlame=enabled,-Dvorbisenc=enabled,-Dtwolame=enabled— The MP3, Vorbis and MP2 encoders, which the recorder output uses to write what is playing to a file.-Dshine=disabled— The shine fixed-point MP3 encoder, which is not a port.-Dsoxr=enabled,-Dlibsamplerate=enabled— Both resamplers.-Dsqlite=enabled— The sticker database, which stores the name/value pairs clients attach to songs.-Dicu=enabled— Unicode collation, case folding and character-set conversion through icu.-Diconv=disabled— Theiconv()conversion path. mpd’s build reads this option only when ICU is absent, so with ICU enabled it has no effect.-Dpcre=enabled— Regular expressions in filter expressions, through pcre2.-Dexpat=enabled— XML parsing through expat, which the XSPF, ASX and RSS playlist plugins need.-Dzlib=enabled— Gzip compression of the database file, through zlib.-Dbzip2=disabled,-Dzzip=disabled— The bzip2 and ZIP archive plugins, which read music from inside an archive. Both libraries are ports but not independs.-Diso9660=enabled,-Dcdio_paranoia=enabled— Reading music from ISO 9660 images and audio CDs, through libcdio and libcdio-paranoia.-Dcurl=enabled— The HTTP input plugin, for internet radio and remote files.-Dmms=disabled,-Dupnp=disabled,-Dlibmpdclient=disabled— MMS streams, the UPnP database and the proxy database; libmms, pupnp, npupnp and libmpdclient are not ports.-Dnfs=disabled,-Dsmbclient=disabled,-Dwebdav=disabled— NFS, SMB and WebDAV storage. libnfs and samba are ports but not independs; upstream itself leavessmbclientoff by default and documents inmeson_options.txtthat libsmbclient crashes mpd.-Dqobuz=disabled— The Qobuz streaming client.-Dudisks=disabled,-Ddbus=disabled— Removable media through udisks2, and the D-Bus support that needs. The daemon talks to no bus.-Dzeroconf=disabled— Announcing the daemon on the network over Avahi or Bonjour.-Dio_uring=enabled— Read files through io_uring, with liburing.-Dsyslog=enabled— Logging to syslog, chosen bylog_file "syslog"inmpd.conf. A configuration with nolog_fileline does not log to syslog: mpd writes its log to standard error, and points that at/dev/nullonce it has started, unless it runs with--stderr.-Dsystemd=disabled— No systemd unit files and no socket activation; KDOS has no systemd (principles).-Ddocumentation=enabled— Build the documentation with Sphinx, from python3-sphinx independs. Asenabledrather thanauto, a missingsphinx-buildfails the configure instead of silently dropping the manual pages.-Dhtml_manual=false— Skip the HTML manual Sphinx would install under/usr/share/doc/mpd.-Dmanpages=true— Build and installmpd.1andmpd.conf.5.
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 |