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

253.1. gtk3-3.24.52

GTK 3 widget toolkit, with the Wayland and X11 backends

Version 3.24.52, 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), 3 of 344 in build order
Licence LGPL-2.0-or-later
Homepage https://www.gtk.org/
Build time 2.5 SBU
Installed size 29.2 MiB in 483 files
Recipe ports/core/gtk/gtk3/kpkgbuild

About

GTK 3 is the widget toolkit that many of the tree’s GTK applications are written for, among them gimp, inkscape, firefox-esr, libreoffice and virt-manager. It installs beside gtk4; each has its own library, its own series and its own bindings. 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, libepoxy, at-spi2-core, libxkbcommon, wayland, wayland-protocols, libX11, libXext, libXrender, libXi, libXrandr, libXcursor, libXdamage, libXfixes, libXcomposite, libXinerama, fontconfig, freetype2, cups, iso-codes, shared-mime-info, hicolor-icon-theme, libxslt, docbook-xml, docbook-xsl.

Required by (81): abiword, adwaita-icon-theme, adwaita-icon-theme-legacy, aisleriot, ayatana-ido, brasero, chromium, cubicsdr, darktable, dasher, deluge, exo, fcitx5-gtk, filezilla, firefox-esr, fontforge, freedv-gui, geany, gimp, glabels, gnome-disk-utility, gnucash, gnumeric, gnuradio, goffice, goocanvas, gparted, gpredict, gramps, gspell, gst-plugins-good, gtk-vnc, gtkmm3, gtksourceview4, hatari, homebank, horizon-eda, inkscape, kde-gtk-config, kicad, libayatana-appindicator, libayatana-indicator, libcanberra, libdbusmenu, libhandy, libpeas, libportal, libreoffice, librewolf, libxfce4ui, linuxcnc, netsurf, opencpn, orca, orcaslicer, osm-gps-map, prusaslicer, python3-wxpython, qemu, rawtherapee, remmina, rhythmbox, selenium-webdriver-at-spi, spice-gtk, stlink-gui, suil, system-config-printer, tenacity, thunderbird, tryton, veracrypt, viking, virt-manager, vte3, webkitgtk, wxwidgets, xdg-desktop-portal-gtk, xfburn, xnec2c, zenmap, zim.

Patches

build.sh applies these; kpkg applies nothing by itself.

The patch is KDOS’s own; GTK 3.24.52 does not have it.

settings-portal-gtk-modules.patch — Makes GDK’s Wayland backend open the org.gtk.Settings service even when it uses the Settings portal. On Wayland GDK reads gtk-modules and gtk-fontconfig-timestamp only from the org.gtk.Settings service that kde-gtk-config’s kded module serves, and the Settings portal carries neither. Unpatched, init_settings() opens that service only when it does not use the Settings portal, and it uses the portal whenever GTK_USE_PORTAL is 1, which every KDOS login exports, or the program runs in a sandbox, and the portal returns any org.gnome.* key, which xdg-desktop-portal-gtk does. A GTK 3 program would then load no colorreload-gtk-module and keep its colours through every colour-scheme change. The patch opens the service first, whichever source then serves the other settings.

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

What kpkg does

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

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/gtk3
echo '80931fa472a77b9a164f6740e3c0b444fac6770054632d35a7ff9d679e5e7b9f  gtk3-3.24.52.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/gtk3
SRC=$SRC_ROOT/gtk3-3.24.52
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gtk3-3.24.52.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 series and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/settings-portal-gtk-modules.patch"

export XML_CATALOG_FILES=/etc/xml/catalog

meson setup build \
	--prefix=/usr --sysconfdir=/etc --libdir=lib \
	--buildtype=release \
	-Dwayland_backend=true \
	-Dx11_backend=true \
	-Dbroadway_backend=false \
	-Dxinerama=yes \
	-Dcloudproviders=false \
	-Dprofiler=false \
	-Dtracker3=false \
	-Dprint_backends=file,cups \
	-Dcolord=no \
	-Dintrospection=true \
	-Dbuiltin_immodules=all \
	-Dgtk_doc=false \
	-Dman=true \
	-Ddemos=false \
	-Dexamples=false \
	-Dtests=false \
	-Dinstalled_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/gtk3, 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 gtk3-3.24.52-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/gtk3, and runs the triggers its paths call for.

Contents

Installed programs: gtk-builder-tool, gtk-encode-symbolic-svg, gtk-launch, gtk-query-immodules-3.0, gtk-query-settings, gtk-update-icon-cache.

Installed libraries: libgailutil-3.so, libgdk-3.so, libgtk-3.so.

Installed directories: /etc/gtk-3.0, /usr/include/gail-3.0, /usr/include/gtk-3.0, /usr/lib/gtk-3.0/3.0.0/printbackends, /usr/share/gtk-3.0, /usr/share/licenses/gtk3, /usr/share/themes/Default, /usr/share/themes/Emacs.

Short descriptions

gtk-builder-tool GtkBuilder file utility
gtk-encode-symbolic-svg Symbolic icon conversion utility
gtk-launch Launch an application
gtk-query-immodules-3.0 Input method module registration utility
gtk-query-settings Utility to print name and value of all GtkSettings properties
gtk-update-icon-cache Icon theme caching utility
gail-3.0.pc GNOME Accessibility Implementation Library
gdk-3.0.pc GTK+ Drawing Kit
gdk-wayland-3.0.pc GTK+ Drawing Kit
gdk-x11-3.0.pc GTK+ Drawing Kit
gtk+-3.0.pc GTK+ Graphical UI Library
gtk+-unix-print-3.0.pc GTK+ Unix print support
gtk+-wayland-3.0.pc GTK+ Graphical UI Library
gtk+-x11-3.0.pc GTK+ Graphical UI Library