Part XI. Toolkits
This part covers 43_toolkits, the phase that builds the widget toolkits applications are written in: GTK 3 and 4 with libadwaita, Qt 5 and Qt 6, the KDE Frameworks, wxWidgets, FLTK and Motif. With them come the web engines, desktop portals, services and libraries built on top of those toolkits. Because of where its dependencies lead, the phase also builds the container runtime that boxes run on.
Read this page if you are following the build through this phase, or adding or changing a port that links a toolkit. It explains:
- the rule that decides which ports belong to the phase;
- the shelves that carry it;
- how a toolkit built here chooses between Wayland and X11 when an application starts;
- which of its ports have a full page.
The package pages follow, in one chapter per shelf, in the shelves’ own order. Within a shelf they appear in the order kpkgdepends builds them.
What belongs here
Every file of the phase’s list opens with the rule:
# Libraries whose dependency closure reaches GTK, Qt, wxWidgets, FLTK or Motif:
# the toolkits themselves, KDE Frameworks, and what applications link over
# them.
script/phases/43_toolkits/packages.d/ai.txt, lines 16–18
An application belongs here too when another port depends on it. konsole, vlc, audacious and brasero are programs with windows, but another port names each of them in depends = (dolphin names konsole, for one), so they are built here and not in Part XII. Dolphin and KDevelop, both KDE Gear applications, are here for the same reason: dolphin-plugins depends on Dolphin, and kdev-php and kdev-python on KDevelop. See Which phase lists a port.
The same rule puts a few ports here that have nothing graphical about their purpose:
podmandepends ongpgme, which depends on GnuPG, which depends onpinentry, the passphrase prompt. This tree buildspinentrywith its Qt 6 front end, so the whole chain lands here.distroboxdepends onpodman, andkdos-appbox, the box launcher, on both.qemudepends ongtk3andvte3, which its GTK display window uses.kdos-sounds, the KDOS sound theme, depends onocean-sound-theme, which is built with Qt 6.
Their pages are in the containers, virt, src-system and src-art chapters of this part.
Qt and KDE Frameworks serve the desktop too
The applications of every later phase link the toolkits built here, and so does the desktop: KWin, plasmashell, System Settings and every KDOS settings page, widget and KWin plugin are Qt 6 and KDE Frameworks 6 programs, built in Part XIII on the libraries of this phase (see The desktop is KDE Plasma). The Plasma libraries that applications link as well, libplasma, kpipewire, plasma-activities and union among them, are therefore built here rather than there.
KDOS’s own code links only the toolkit its area of src/ allows, and testing/preflight.sh checks the rule on the built tree. When a build tree exists, it reads the NEEDED entries (the shared libraries an ELF file asks the loader for) of every ELF file that a package built from a port under src/ installs, and of each library those name, one level down. It allows:
| Code | May link |
|---|---|
A program from src/desktop |
Qt 6, KDE Frameworks 6 and the Plasma libraries; nothing else from the toolkit list, so no GTK, no Qt 5 and no Xlib named directly |
A program from src/system, src/daemons, src/art or src/devtools; any set-id file; anything under sbin; any program rcS starts |
No toolkit at all |
The second row keeps the boot and the root daemons from ever depending on a GUI stack. libxcb is allowed everywhere, because Xwayland speaks XCB.
GTK and Qt are built with both their Wayland and their X11 backends, so a program that has only an X11 path still runs, under Xwayland. SDL is built with its Wayland backend alone, and Tk and Motif have only X11. Which backend an application uses at run time is not decided by its recipe: the login profile, fs/etc/profile.d/10-wayland.sh, sets the preference.
# Toolkit back ends. GTK and Qt are built with their Wayland and X11 back ends,
# and Wayland comes first; SDL is built with Wayland alone, so its driver
# names no fallback; Tk and Motif have only X11 and run under Xwayland.
# Qt takes a list and falls back to xcb (Xwayland) only when the Wayland
# plugin cannot start, which is a Qt 5 application built without one; a name
# on its own here would leave that application not starting at all. GDK_BACKEND
# is left unset: GDK already tries Wayland first, and a value here would
# override the GDK_BACKEND=x11 an X11-only application sets for itself.
export QT_QPA_PLATFORM="wayland;xcb"
export MOZ_ENABLE_WAYLAND=1
export SDL_VIDEODRIVER=wayland
export CLUTTER_BACKEND=wayland
fs/etc/profile.d/10-wayland.sh, lines 82–93
What each line means for each toolkit is in Toolkits, Wayland and X11; how GTK and Qt applications take the desktop’s colours, through two more variables of the same file, is in Theming native applications; how the Qt 6 modules are configured to match is in How Qt 6 is built.
The list, by shelf
The list is script/phases/43_toolkits/packages.d/, one file per shelf, read in byte order as one list, with no order file (see Package lists). The chapters that carry the phase are these:
gtk-
GTK 3 and GTK 4 with their C++ bindings, libadwaita and libhandy, VTE, GtkSourceView, gvfs,
libpeas,blueprint-compiler, and the Xfce libraries. GLib, below them, is Part IX’s. qt6,qt5,qt-extra-
The Qt 6 modules from
qtbaseup to QtWebEngine, with PySide6; the subset of Qt 5 that applications build on; and third-party Qt libraries outside KDE Frameworks. kf6,kde-
KDE Frameworks 6, from
kcoreaddonsandkconfigto KIO and Kirigami, and the KDE pieces outside Frameworks that applications link: the Plasma libraries (libplasma,kpipewire,plasma-activities,union), the Plasma integration plugin, KIO workers and thumbnailers, and the KDE Wayland libraries. toolkits,web-engines-
wxWidgets, FLTK and Motif; WebKitGTK, built twice, as
webkitgtkfor GTK 3 andwebkitgtk6for GTK 4. xdg-
The GTK portal backend,
libportal,libcanberra, the application-indicator libraries andzenity. - The subject chapters
-
cryptoandsecurity(GPGME and its Qt binding, GnuPG,pinentry,libkleo),containersandvirt,printing(cups-filters, SANE and the KDE scanning libraries),disk(udisks2andlibblockdev),media-frameworks(the remaining GStreamer plugin sets and MLT), and the other shelves’ libraries over a toolkit, each in the chapter of its own shelf.
Which ports have full pages
Each port gets one of three kinds of page, explained in The three tiers. The Tier A ports of this phase, with a full hand-written page, are:
- podman, the container runtime under every box;
- libplasma, the library the Plasma shell and every Plasma widget are built on;
- kdos-appbox, the box launcher;
- kdos-sounds, the KDOS sound theme, rendered at build time by
kdos-sfxfrom kdos-tools.
Other ports have Tier B pages. qt6-qtbase, gtk3, gtk4, qt6-qtdeclarative, qt6-qtwayland and the core Frameworks, kcoreaddons, kconfig, ki18n and kio among them, are Tier B because 20 or more ports depend on each. Before you change one, read its Required by list: those are the ports a change to it can break. Other ports are Tier B because they carry a patch or a long build.sh. The rest of the phase is shown on compact cards.
See also
- The userland:
40_langto44_apps: the phase among the five userland phases - A graphical application: the recipe shape of a port that builds on these toolkits
- Writing desktop software: how KDOS’s own Plasma code is written on these toolkits
- Reading a package page: how the pages below are laid out
- Part XII: the next phase