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

319.2. cmus-2.12.0

Console music player with a library view

Version 2.12.0, release 1
Shelf music-players — Music players, library managers and taggers
Phase 44_apps (Applications), 300 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://cmus.github.io/
Build time 0.5 SBU
Installed size 920.7 KiB in 38 files
Recipe ports/core/music-players/cmus/kpkgbuild

About

cmus is a music player for the terminal, with a library view, playlists and a play queue, driven entirely from the keyboard. It decodes through one input plugin per format and plays through one output plugin, all chosen when it is configured.

Sources

Dependencies

Depends on: ncurses, alsa-lib, flac, libvorbis, opusfile, libmad, faad2, wavpack, libmikmod, basu, ffmpeg, libcdio, libcdio-paranoia.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

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/44_apps/phase.env && kpkg install cmus'

What kpkg does

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

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/cmus
echo '44b96cd5f84b0d84c33097c48454232d5e6a19cd33b9b6503ba9c13b6686bfc7  cmus-2.12.0.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/cmus
SRC=$SRC_ROOT/cmus-2.12.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf cmus-2.12.0.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:

patch -p1 -i "$PORT_SRC/ffmpeg8.patch"
patch -p1 -i "$PORT_SRC/mpris-basu.patch"
./configure \
	prefix=/usr \
	mandir=/usr/share/man \
	docdir=/usr/share/doc/cmus \
	CONFIG_ALSA=y \
	CONFIG_FLAC=y \
	CONFIG_VORBIS=y \
	CONFIG_OPUS=y \
	CONFIG_MAD=y \
	CONFIG_WAV=y \
	CONFIG_CUE=y \
	CONFIG_AAC=y \
	CONFIG_WAVPACK=y \
	CONFIG_MIKMOD=y \
	CONFIG_MPRIS=y \
	CONFIG_FFMPEG=y \
	CONFIG_CDIO=y \
	CONFIG_PULSE=n CONFIG_JACK=n CONFIG_AO=n CONFIG_ARTS=n CONFIG_ROAR=n \
	CONFIG_SNDIO=n CONFIG_SUN=n CONFIG_OSS=n CONFIG_COREAUDIO=n \
	CONFIG_AAUDIO=n CONFIG_WAVEOUT=n CONFIG_SAMPLERATE=n \
	CONFIG_MP4=n CONFIG_MPC=n CONFIG_MODPLUG=n \
	CONFIG_BASS=n CONFIG_VTX=n CONFIG_TREMOR=n \
	CONFIG_CDDB=n CONFIG_DISCID=n
make
make DESTDIR=$PKG install

install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/cmus.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Music (cmus)
GenericName=Music Player
Comment=Browse and play a music library
Exec=cmus
Icon=folder-music
Terminal=true
Categories=AudioVideo;Player;
Keywords=music;audio;player;library;playlist;cmus;
DESKTOP
chmod 644 "$PKG/usr/share/applications/cmus.desktop"

The switches, and why each is set:

cmus’s configure takes CONFIG_<NAME>=y or =n for every plugin. Most of them default to auto, built whenever the library happens to be found; with y, a library that is not found stops the configure. The recipe names every one, so a missing codec port stops the build instead of leaving that format out.

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/cmus, 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 cmus-2.12.0-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/cmus, and runs the triggers its paths call for.

Contents

Installed programs: cmus, cmus-remote.

Installed directories: /usr/lib/cmus, /usr/share/cmus, /usr/share/doc/cmus, /usr/share/licenses/cmus.

Short descriptions

cmus C* Music Player
cmus-remote control cmus

Notes

The desktop entry is KDOS’s own, with Terminal=true; upstream ships none.