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

322.5. handbrake-1.11.2

HandBrake video transcoder: the GTK 4 application and HandBrakeCLI

Version 1.11.2, release 1
Shelf video-tools — Video editing, transcoding, muxing, recording, streaming and webcam apps
Phase 44_apps (Applications), 413 of 422 in build order
Licence GPL-2.0-only
Homepage https://handbrake.fr/
Build time 17.6 SBU
Installed size 110.0 MiB in 10 files
Recipe ports/core/video-tools/handbrake/kpkgbuild

About

HandBrake converts video files and unencrypted DVDs and Blu-rays to MP4, MKV and WebM, with presets for devices. The port installs both programs: ghb, the GTK 4 application, and HandBrakeCLI. Both are built on libhb, HandBrake’s library, which this build links statically with the copies of FFmpeg, x265 (8, 10 and 12 bit), SVT-AV1, dav1d, zimg, libdvdread, libdvdnav and libbluray that HandBrake pins.

Sources

Dependencies

Depends on: python3, meson, ninja, cmake, nasm, autoconf, automake, libtool, m4, patch, pkgconf, gettext, glib, gtk4, libxml2, libass, harfbuzz, fribidi, freetype2, fontconfig, jansson, libjpeg-turbo, libogg, libvorbis, libtheora, x264, lame, opus, speex, libvpx, numactl, libdovi, bzip2, xz, zlib.

Required by: no port names it.

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.

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

What kpkg does

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

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/handbrake
echo '12b046350f2422dc28783ff94229aff4ba5fe5e683431e057355d36163b2593a  handbrake-1.11.2.tar.bz2' | sha256sum -c -
echo '2a8b8840c0bc78f5ed1576f98eba7df00c05f87fd6d07fad16efcd9333016edf  ffmpeg-8.0.2.tar.bz2' | sha256sum -c -
echo 'a0882bb90826da62a96676c1a7cb7a7beb7f1db901f2775299cbeed03c3eb2a2  x265-snapshot-20260216-13309.tar.gz' | sha256sum -c -
echo '6c4c0c44ff0ba3d136d6f57f3a707f9de8e9c866f50f809c1d22a43f0d8c9583  SVT-AV1-v4.1.0.tar.gz' | sha256sum -c -
echo 'e099f53253f6c247580c554d53a13f1040638f2066edc3c740e4c2f15174ce22  dav1d-1.5.3.tar.bz2' | sha256sum -c -
echo '19a96cdc266466be58be86a9271bedb1f080bf4cc14f5ed58ac39dc5b970fd17  zimg-snapshot-20250624.tar.gz' | sha256sum -c -
echo 'b69f74d9ceea1ed173b579deba99f669c2cb42f3fd06d7d23b33ff222aa63763  libdvdread-7.0.1.tar.bz2' | sha256sum -c -
echo '1363cdfaf6e92c0b574579299b5480f5867fb32989451468a28f3f402ec48787  libdvdnav-7.0.0.tar.bz2' | sha256sum -c -
echo '77937baf07eadda4b2b311cf3af4c50269d2ea3165041f5843d96476c4c92777  libbluray-1.4.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/handbrake
SRC=$SRC_ROOT/handbrake-1.11.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf handbrake-1.11.2.tar.bz2 -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf ffmpeg-8.0.2.tar.bz2 -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf x265-snapshot-20260216-13309.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf SVT-AV1-v4.1.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf dav1d-1.5.3.tar.bz2 -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf zimg-snapshot-20250624.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf libdvdread-7.0.1.tar.bz2 -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf libdvdnav-7.0.0.tar.bz2 -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf libbluray-1.4.0.tar.xz -C "$SRC_ROOT"

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 recipe’s helpers _hbc and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/system-libdovi.patch"
install -d download
for f in ffmpeg-8.0.2.tar.bz2 x265-snapshot-20260216-13309.tar.gz \
	SVT-AV1-v4.1.0.tar.gz dav1d-1.5.3.tar.bz2 zimg-snapshot-20250624.tar.gz \
	libdvdread-7.0.1.tar.bz2 libdvdnav-7.0.0.tar.bz2 libbluray-1.4.0.tar.xz; do
	cp "$PORT_SRC/$f" download/
done

export CFLAGS="${CFLAGS/-std=gnu11/}"
./configure --prefix=/usr \
	--disable-df-fetch \
	--enable-gtk \
	--enable-x265 \
	--enable-numa \
	--disable-fdk-aac \
	--disable-nvenc \
	--disable-nvdec \
	--disable-qsv \
	--disable-vce \
	--enable-libdovi
make -C build
make -C build -j1 DESTDIR=$PKG install

for s in 32x32 128x128 256x256; do
	install -Dm644 "gtk/icons/$s/apps/fr.handbrake.ghb.png" \
		"$PKG/usr/share/icons/hicolor/$s/apps/fr.handbrake.ghb.png"
done

cat > "$PKG/usr/share/applications/fr.handbrake.ghb.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=HandBrake
GenericName=Video Transcoder
Comment=Convert video files and discs to MP4, MKV and WebM
Exec=ghb %f
Icon=fr.handbrake.ghb
Terminal=false
StartupNotify=true
StartupWMClass=fr.handbrake.ghb
Categories=AudioVideo;Video;
Keywords=transcode;convert;encode;video;dvd;bluray;handbrake;
DESKTOP
chmod 644 "$PKG/usr/share/applications/fr.handbrake.ghb.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/handbrake, 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 handbrake-1.11.2-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/handbrake, and runs the triggers its paths call for.

Contents

Installed programs: HandBrakeCLI, ghb.

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

Notes