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

319.1. rmpc-0.11.0

An MPD client drawn in ratatui, with album art in the terminal

Version 0.11.0, release 2
Shelf music-players — Music players, library managers and taggers
Phase 44_apps (Applications), 299 of 422 in build order
Licence BSD-3-Clause
Homepage https://github.com/mierak/rmpc
Build time 5.0 SBU
Installed size 17.0 MiB in 6 files
Recipe ports/core/music-players/rmpc/kpkgbuild

About

rmpc is a terminal client for mpd, the music player daemon, drawn with the ratatui library and able to show album art in the terminal. It speaks mpd’s protocol, so it attaches to a daemon that is already playing rather than starting one; mpd is in depends because the desktop entry plays the library mpd serves.

Why it is in KDOS

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

The client half: rmpc speaks mpd's line protocol, so it attaches to a daemon that is already playing rather than starting one.

Sources

Dependencies

Depends on: rust, mpd.

Required by: no port names it.

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

What kpkg does

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

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/rmpc
echo '930019066228d18e9530a8c0d77f10e231ab5efbbbca73b331efcd6fbb47557d  rmpc-0.11.0.tar.gz' | sha256sum -c -
echo '06c23114a1bd8d587cbe68782050700168d1124e123ad7bdcbdf18c56b6476cd  rmpc-vendor-0.11.0.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/rmpc
SRC=$SRC_ROOT/rmpc-0.11.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf rmpc-0.11.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:

tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export CARGO_HOME="$SRC_ROOT/.cargo"
export RUSTFLAGS="-C target-feature=-crt-static"
export CARGO_NET_OFFLINE=true
export VERGEN_GIT_DESCRIBE="v$version"
export VERGEN_GIT_SHA="v$version"

cargo build --release --frozen --offline

install -Dm755 target/release/rmpc $PKG/usr/bin/rmpc

install -Dm644 target/man/rmpc.1 $PKG/usr/share/man/man1/rmpc.1
for f in target/completions/*; do
	[ -e "$f" ] || continue
	case "$f" in
	*.bash|*rmpc.bash)
		install -Dm644 "$f" \
			$PKG/usr/share/bash-completion/completions/rmpc ;;
	*.fish)
		install -Dm644 "$f" \
			$PKG/usr/share/fish/vendor_completions.d/rmpc.fish ;;
	_rmpc|*.zsh)
		install -Dm644 "$f" $PKG/usr/share/zsh/site-functions/_rmpc ;;
	esac
done

install -d "$PKG/usr/share/applications"
cat > "$PKG/usr/share/applications/rmpc.desktop" <<'DESK'
[Desktop Entry]
Type=Application
Name=Music Player
GenericName=MPD Client
Comment=Play the music library mpd is serving
Exec=rmpc
Icon=folder-music
Terminal=true
NoDisplay=true
Categories=AudioVideo;Player;
Keywords=music;audio;player;mpd;rmpc;
DESK
chmod 644 "$PKG/usr/share/applications/rmpc.desktop"

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

Contents

Installed programs: rmpc.

Installed directories: /usr/share/licenses/rmpc.

Notes

The vendor bundle, rmpc-vendor-<version>.tar.xz, is cargo vendor run by ports/fetch (vendoring = rust) and held to its own sha256 = line; see Vendoring.

The manual page and the bash, fish and zsh completions are not in the tarball: build.rs generates them into target/man and target/completions during the build, and build.sh installs them from there.

The desktop entry is KDOS’s own. It is NoDisplay=true: rmpc exits at once when no mpd is running, and the session starts mpd only once an mpd.conf exists, which the image does not ship, so Start does not list it. The entry sets Terminal=true, so it opens in the session’s terminal, Konsole, which draws the album art with the kitty graphics protocol.

Meta+Shift+U does not use this entry: the KDOS run-or-raise shortcuts (kwin-script-kdos-runraise) raise a running rmpc, or start one through their own launcher, konsole --hold -p tabtitle=rmpc -e rmpc.

rmpc reaches mpd through MPD_HOST, which /etc/profile.d/45-mpd.sh sets to the socket the mpd user service serves, $XDG_RUNTIME_DIR/mpd/socket, so it needs no configuration file of its own.

rmpc’s visualiser pane runs cava, which is not a port, so that pane draws nothing (see Features whose library has no port).