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

253.3. gtk4-4.24.0

GTK 4 widget toolkit, with the Wayland and X11 backends, Vulkan and GStreamer media

Version 4.24.0, release 1
Shelf gtk — The GLib and GTK platform and GNOME/Xfce desktop-platform libraries: widgets, settings, bindings, GIO plug-ins
Phase 43_toolkits (Toolkits), 160 of 344 in build order
Licence LGPL-2.1-or-later
Homepage https://www.gtk.org/
Build time 6.4 SBU
Installed size 49.2 MiB in 511 files
Recipe ports/core/gtk/gtk4/kpkgbuild

About

GTK 4 is the current GTK widget toolkit, and the one libadwaita is built on. It installs beside gtk3. It draws with OpenGL or Vulkan through its GSK renderers and plays video through GStreamer. It is for applications: the KDOS desktop is Qt 6 and KDE Frameworks, and no part of it links GTK (see Applications bring their own toolkit).

Why it is in KDOS

The comment above gtk3 and gtk4 in script/phases/43_toolkits/packages.d/gtk.txt:

Both GTKs are built with their Wayland and X11 backends. GDK_BACKEND is left unset, so an application tries Wayland first and the X11 backend serves the ones that force it; GTK 3's AT-SPI bridge is compiled only beside its X11 backend.

Sources

Dependencies

Depends on: meson, glib, gobject-introspection, glib-introspection, cairo, pango, harfbuzz, fribidi, gdk-pixbuf, librsvg, libpng, libtiff, libjpeg-turbo, libepoxy, graphene, libxkbcommon, wayland, wayland-protocols, libX11, libXext, libXrender, libXi, libXrandr, libXcursor, libXdamage, libXfixes, libXinerama, fontconfig, freetype2, cups, gstreamer, gst-plugins-base, gst-plugins-bad, vulkan-headers, vulkan-loader, shaderc, libdrm, iso-codes, shared-mime-info, hicolor-icon-theme, at-spi2-core, bash-completion, python3-docutils.

Required by (22): blueprint-compiler, celluloid, deja-dup, dino, fcitx5-gtk, font-manager, gnome-mahjongg, gnome-mines, gnome-sudoku, gthumb, gtkmm4, gtksourceview5, handbrake, impression, libadwaita, libportal, libspelling, lxi-tools, resources, vte3, webkitgtk6, zenity.

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/43_toolkits/phase.env && kpkg install gtk4'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/gtk/gtk4.

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/gtk/gtk4
echo '28ba4ac1c04f86eac09b79a163cb163a4c2b54442d9f7eccc04679062a581044  gtk4-4.24.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/gtk4
SRC=$SRC_ROOT/gtk4-4.24.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gtk4-4.24.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 recipe’s helpers devseries and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

meson setup build \
	--prefix=/usr --sysconfdir=/etc --libdir=lib \
	--buildtype=release \
	-Db_ndebug=if-release \
	-Dwayland-backend=true \
	-Dx11-backend=true \
	-Dbroadway-backend=false \
	-Dmedia-gstreamer=enabled \
	-Dprint-cups=enabled \
	-Dprint-cpdb=disabled \
	-Dvulkan=enabled \
	-Dcloudproviders=disabled \
	-Dsysprof=disabled \
	-Dtracker=disabled \
	-Dcolord=disabled \
	-Daccesskit=disabled \
	-Dintrospection=enabled \
	-Ddocumentation=false \
	-Dscreenshots=false \
	-Dman-pages=true \
	-Dbuild-demos=false \
	-Dbuild-testsuite=false \
	-Dbuild-examples=false \
	-Dbuild-tests=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

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

Contents

Installed programs: gtk4-builder-tool, gtk4-image-tool, gtk4-launch, gtk4-path-tool, gtk4-query-settings, gtk4-rendernode-tool, gtk4-update-icon-cache.

Installed libraries: libgtk-4.so.

Installed directories: /usr/include/gtk-4.0, /usr/share/gtk-4.0, /usr/share/licenses/gtk4.

Short descriptions

gtk4-builder-tool GtkBuilder File Utility
gtk4-image-tool Image Utility
gtk4-launch Launch an application
gtk4-path-tool GskPath Utility
gtk4-query-settings Print name and value of GTK settings
gtk4-rendernode-tool GskRenderNode Utility
gtk4-update-icon-cache Icon theme caching utility
gtk4.pc GTK Graphical UI Library
gtk4-atspi.pc GTK AT-SPI accessibility support
gtk4-unix-print.pc GTK Unix print support
gtk4-wayland.pc GTK Graphical UI Library
gtk4-x11.pc GTK Graphical UI Library