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

322.7. mkvtoolnix-102.0

MKVToolNix: create, split, edit and inspect Matroska files, with the Qt 6 GUI

Version 102.0, release 1
Shelf video-tools — Video editing, transcoding, muxing, recording, streaming and webcam apps
Phase 44_apps (Applications), 415 of 422 in build order
Licence GPL-2.0-only
Homepage https://mkvtoolnix.download/
Build time 35.2 SBU
Installed size 32.2 MiB in 27 files
Recipe ports/core/video-tools/mkvtoolnix/kpkgbuild

About

MKVToolNix creates, splits, edits and inspects Matroska and WebM files: mkvmerge, mkvextract, mkvinfo and mkvpropedit on the command line, and mkvtoolnix-gui, the Qt 6 application that drives them. It reads and writes Matroska through libebml and libmatroska.

Sources

Dependencies

Depends on: ruby, pkgconf, boost, gmp, libebml, libmatroska, libogg, libvorbis, flac, zlib, fmt, pugixml, nlohmann-json, libdvdread, cmark, qt6-qtbase, qt6-qtsvg, qt6-qtmultimedia, qt6-qtwayland, libxslt, docbook-xsl, librsvg.

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

What kpkg does

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

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-tools/mkvtoolnix
echo '9f0a810f17c7df8adb9064a3a41d5784399be412d19704cf080745ad7d45da30  mkvtoolnix-102.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/mkvtoolnix
SRC=$SRC_ROOT/mkvtoolnix-102.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf mkvtoolnix-102.0.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:

./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
	ac_cv_path_INKSCAPE= \
	--enable-gui \
	--enable-dbus \
	--disable-update-check \
	--disable-precompiled-headers \
	--without-gettext \
	--with-flac \
	--with-dvdread
./drake V=1 -j"$KDOS_JOBS"
./drake DESTDIR=$PKG install

for s in 48 64 128 256; do
	install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
	rsvg-convert -w $s -h $s \
		-o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/mkvtoolnix-gui.png" \
		"$PKG/usr/share/icons/hicolor/scalable/apps/mkvtoolnix-gui.svg"
done

cat > "$PKG/usr/share/applications/org.bunkus.mkvtoolnix-gui.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=MKVToolNix
GenericName=Matroska Muxer
Comment=Merge, split and edit tracks of Matroska and WebM files
Exec=mkvtoolnix-gui %F
Icon=mkvtoolnix-gui
Terminal=false
StartupWMClass=org.bunkus.mkvtoolnix-gui
MimeType=application/x-mkvtoolnix-gui-settings;
Categories=AudioVideo;AudioVideoEditing;
Keywords=matroska;mkv;webm;mux;remux;subtitles;chapters;tracks;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.bunkus.mkvtoolnix-gui.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/mkvtoolnix, 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 mkvtoolnix-102.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/mkvtoolnix, and runs the triggers its paths call for.

Contents

Installed programs: mkvextract, mkvinfo, mkvmerge, mkvpropedit, mkvtoolnix-gui.

Installed directories: /usr/share/licenses/mkvtoolnix, /usr/share/mkvtoolnix.

Notes