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
gtk3-3.24.52.tar.xz(12.9 MiB)
sha25680931fa472a77b9a164f6740e3c0b444fac6770054632d35a7ff9d679e5e7b9f
upstream: https://download.gnome.org/sources/gtk/3.24/gtk-3.24.52.tar.xz
archive copy: sources-2/gtk--gtk3-3.24.52.tar.xz
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.
settings-portal-gtk-modules.patch— gdk/wayland: open org.gtk.Settings when the Settings portal is usedWith GTK_USE_PORTAL=1, or inside a sandbox, init_settings() returned after reading the Settings portal and never opened the org.gtk.Settings proxy, so gtk-modules and gtk-fontconfig-timestamp stayed unset. Open the proxy before choosing the source of 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:
XML_CATALOG_FILES=/etc/xml/catalog— Names the XML catalogue libxml2 reads. With-Dman=truethe build runsxsltproc --nonetover the tools’ DocBook pages with the manual-page stylesheet athttp://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl, and the catalogue maps that address onto the installed docbook-xsl; without a mapping,--nonetrefuses the download and the pages fail. The file named is the one libxml2 reads when the variable is unset, and the export makes it the one read whatever the build environment carries.-Dwayland_backend=true,-Dx11_backend=true— Build both GDK backends, upstream’s defaults on Linux.GDK_BACKENDis left unset in the session, so an application tries Wayland first and the X11 backend serves the ones that force it, under Xwayland (see A graphical application). GTK 3’s AT-SPI accessibility bridge is compiled only beside its X11 backend, so turning X11 off would also take away accessibility from every GTK 3 program.-Dbroadway_backend=false— Build no Broadway backend, which draws a GTK program into a web browser over HTML5. It is upstream’s default.-Dxinerama=yes— Make the Xinerama extension a requirement of the X11 backend, through libXinerama. Upstream’sautouses it only if found.-Dcloudproviders=false,-Dtracker3=false,-Dprofiler=false— No cloud-provider entries in the file chooser’s sidebar (libcloudproviders), no Tracker search in the file chooser, and no sysprof profiler hooks. None of libcloudproviders, Tracker or sysprof is a port; all three are upstream’s defaults.-Dprint_backends=file,cups— Build the “Print to File” backend and the cups one, and fail if CUPS cannot be found. Upstream’sautoalso builds thelprbackend, and builds without the CUPS one when its library is missing.-Dcolord=no— No colord colour-management support in the CUPS backend. colord is not a port; upstream’sautowould use it if found.-Dbuiltin_immodules=all— Compile every input method module (the Wayland text-input module, XIM, multipress, and the simple Amharic, Cedilla, Cyrillic, Inuktitut, IPA, Thai, Tigrigna and Vietnamese ones) intolibgtk-3instead of installing each as a loadable module under/usr/lib/gtk-3.0/3.0.0/immodules. GTK 3 finds a loadable module only through theimmodules.cachethatgtk-query-immodules-3.0writes, and upstream’s install step skips writing it underDESTDIR; built in, the modules need no cache. The one loadable module in the tree, fcitx5-gtk’s, writes the cache itself.-Dinstalled_tests=false,-Ddemos=false,-Dexamples=false— Install no test programs and build neithergtk3-demo,gtk3-widget-factorynor the examples; the demos and examples are on by default upstream.
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 |