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

208.1. mpv-0.41.0

Command-line media player for Wayland, with no toolkit

Version 0.41.0, release 2
Shelf video-players — Video players and media centres, and their front-end add-ons
Phase 42_graphics (Graphics Stack), 171 of 189 in build order
Licence GPL-2.0-or-later
Homepage https://mpv.io/
Build time 0.9 SBU
Installed size 7.0 MiB in 31 files
Recipe ports/core/video-players/mpv/kpkgbuild

About

mpv is a media player with no toolkit: it draws video with its own GPU renderer straight onto a Wayland surface, and its controls, statistics overlay and console are Lua scripts built into the binary. The port also builds libmpv, the playback engine that front ends such as haruna draw their windows around (smplayer runs the mpv program itself inside its window instead), and loads C plugins such as mpv-mpris, which puts mpv on the session bus for the media keys and the panel.

Nearly every optional part is named on or off. A meson feature left at auto is built when its library happens to be in the build root, so naming each one keeps the player 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/video-players.txt:

A media player that needs NO toolkit — it draws with its own renderer straight onto a Wayland surface, so it plays on the lightest machine, and libmpv is the engine toolkit front ends draw over.

Sources

Dependencies

Depends on: meson, ninja, pkgconf, python3, ffmpeg, wayland, wayland-protocols, libxkbcommon, mesa, alsa-lib, pipewire, libass, lcms2, libdrm, libplacebo, libdisplay-info, libsixel, libarchive, python3-docutils, libva, vulkan-loader, vulkan-headers, luajit, rubberband, zimg, libjpeg-turbo, zlib, uchardet, libbluray, libdvdnav, libcdio, libcdio-paranoia, libX11, libXext, libXfixes, libXpresent, libXrandr, libXScrnSaver, yt-dlp.

Required by (8): celluloid, haruna, kalarm, mpv-mpris, mpvqt, plasmatube, smplayer, uosc.

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

What kpkg does

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

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/video-players/mpv
echo 'ee21092a5ee427353392360929dc64645c54479aefdb5babc5cfbb5fad626209  mpv-0.41.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/mpv
SRC=$SRC_ROOT/mpv-0.41.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf mpv-0.41.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:

meson setup build \
	--prefix=/usr \
	--libdir=lib \
	--buildtype=release \
	-Dlibmpv=true \
	-Dcplayer=true \
	-Dbuild-date=false \
	-Dcplugins=enabled \
	-Dx11=enabled \
	-Degl-x11=enabled \
	-Dgl-x11=disabled \
	-Dvaapi-x11=disabled \
	-Dvdpau=disabled \
	-Dvdpau-gl-x11=disabled \
	-Dxv=disabled \
	-Dx11-clipboard=enabled \
	-Dwayland=enabled \
	-Dgl=enabled \
	-Degl=enabled \
	-Degl-wayland=enabled \
	-Degl-drm=enabled \
	-Dgbm=enabled \
	-Ddmabuf-wayland=enabled \
	-Ddrm=enabled \
	-Dvulkan=enabled \
	-Dshaderc=disabled \
	-Dspirv-cross=disabled \
	-Dvaapi=enabled \
	-Dvaapi-drm=enabled \
	-Dvaapi-wayland=enabled \
	-Dcuda-hwaccel=disabled \
	-Dcuda-interop=disabled \
	-Dcaca=disabled \
	-Dsixel=enabled \
	-Dalsa=enabled \
	-Dpipewire=enabled \
	-Dpulse=disabled \
	-Djack=enabled \
	-Dopenal=disabled \
	-Dsndio=disabled \
	-Doss-audio=disabled \
	-Dsdl2-audio=disabled \
	-Dsdl2-video=disabled \
	-Dsdl2-gamepad=disabled \
	-Dlua=luajit \
	-Djavascript=disabled \
	-Drubberband=enabled \
	-Dzimg=enabled \
	-Djpeg=enabled \
	-Dzlib=enabled \
	-Diconv=enabled \
	-Duchardet=enabled \
	-Dlibavdevice=enabled \
	-Dlibarchive=enabled \
	-Dlcms2=enabled \
	-Dlibbluray=enabled \
	-Ddvdnav=enabled \
	-Dcdda=enabled \
	-Ddvbin=enabled \
	-Dvapoursynth=disabled \
	-Dmanpage-build=enabled
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

install -d "$PKG/etc/mpv"
cat > "$PKG/etc/mpv/mpv.conf" <<'CONF'
gpu-sw=yes
CONF
chmod 644 "$PKG/etc/mpv/mpv.conf"

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

Contents

Installed programs: mpv.

Installed libraries: libmpv.so.

Installed directories: /usr/include/mpv, /usr/share/doc/mpv, /usr/share/licenses/mpv.

Short descriptions

mpv a media player
mpv.pc mpv media player client library

Notes

yt-dlp is in depends but not used by the build: mpv’s built-in ytdl_hook script runs it at play time when given a web address.

build.sh installs /etc/mpv/mpv.conf, the system configuration that the program reads before ~/.config/mpv/mpv.conf, with one line, gpu-sw=yes. Without it mpv refuses every rendering context it suspects is software, the Wayland one on llvmpipe among them, and falls through to its X11 EGL context, which on a session with no X display stops on the assertion !vo->x11; in a virtual machine or on a machine with no GPU driver the player never opens. The option does nothing on a hardware context, and libmpv front ends read no configuration file unless they ask.