192.1. wayland-1.26.0
Core Wayland protocol library (libwayland-server / libwayland-client)
| Version | 1.26.0, release 1 |
| Shelf | wl — Wayland libraries and protocols, and Wayland-only desktop utilities |
| Phase | 42_graphics (Graphics Stack), 5 of 189 in build order |
| Licence | MIT |
| Homepage | https://wayland.freedesktop.org/ |
| Build time | 0.1 SBU |
| Installed size | 938.7 KiB in 36 files |
| Recipe | ports/core/wl/wayland/kpkgbuild |
About
Wayland is the display protocol of the KDOS desktop, and this port is its reference implementation: libwayland-client and libwayland-server, the two halves every program on either end of a Wayland socket links, libwayland-cursor and libwayland-egl, and wayland-scanner, the code generator that turns a protocol’s XML description into C stubs at another port’s build time. The compositor, KWin, is the server; the Plasma shell, the lock screen and every application are clients, and so is every toolkit’s Wayland backend (GTK 3 and 4, Qt 5 and 6, SDL 3, GLFW), Mesa’s Wayland platform and Xwayland. How the desktop is put together on top of it is in The session.
The build is upstream’s meson build with the documentation and the test suite left out, and with the scanner’s DTD check kept.
Why it is in KDOS
The comment above wayland and wayland-protocols in script/phases/42_graphics/packages.d/wl.txt:
The desktop itself — KWin and the Plasma shell — is 50_desktop.
Sources
wayland-1.26.0.tar.xz(598.0 KiB)
sha25664176eaa46e4969903e286f8e5ef8331affc17fdf03ac9b58381d2b23162b7a3
upstream: https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.26.0/downloads/wayland-1.26.0.tar.xz
archive copy: sources-4/wl--wayland-1.26.0.tar.xz
Dependencies
Depends on: libffi, libxml2, expat, meson.
Required by (81): amiberry, appstream, blender, chromium, fastfetch, fcitx5, firefox-esr, fltk, freerdp, glfw, glmark2, gst-plugins-bad, gst-plugins-base, gtk3, gtk4, gwenview, imv, inlyne, kclock, kdeconnect, kdos-boxsock, kguiaddons, kicad, kidletime, kodi, krdc, krfb, krita, kwayland, kwin, kwindowsystem, layer-shell-qt, libdecor, libkscreen, libplasma, librewolf, libva, libva-intel-driver, libva-utils, libxkbcommon, mesa, mesa-demos, mpv, obs-studio, octave, orcaslicer, plasma-desktop, plasma-integration, plasma-keyboard, plasma-workspace, powerdevil, ppsspp, prusaslicer, qt5-qtwayland, qt6-qtbase, qt6-qtwayland, retroarch, sdl3, selenium-webdriver-at-spi, sniffnet, spectacle, spice-gtk, surfer, swayimg, thunderbird, vlc, vulkan-loader, vulkan-tools, wayland-protocols, wayland-utils, waylandpp, webkitgtk, webkitgtk6, wev, wine, wl-clipboard, wlvncc, wxwidgets, xdg-desktop-portal-kde, xwayland, yakuake.
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/42_graphics/phase.env && kpkg install wayland'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/wl/wayland.
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/wl/wayland
echo '64176eaa46e4969903e286f8e5ef8331affc17fdf03ac9b58381d2b23162b7a3 wayland-1.26.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/wayland
SRC=$SRC_ROOT/wayland-1.26.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf wayland-1.26.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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
meson setup build --buildtype=release \
--prefix=/usr --sysconfdir=/etc --libdir=lib \
-Ddocumentation=false \
-Ddtd_validation=true \
-Dtests=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
The switches, and why each is set:
-Ddocumentation=false— Builds neither the HTML protocol book nor the generatedman3pages for the library functions. The documentation build looks fordoxygen,dot,xsltproc,xmltoandmdbookand stops configure when any is missing; no port providesmdbook, anddotcomes from graphviz, which43_toolkitsbuilds after this port’s phase.-Ddtd_validation=true— Compiles libxml2 intowayland-scanner, which then checks each protocol file it reads against the Wayland DTD it carries inside it. A file that fails prints a warning, and stops the scanner only when it is run with--strict. This is upstream’s default; it is the reason the port depends on libxml2.-Dtests=false— Builds no test programs; the suite is not run in the build.
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/wayland, 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 wayland-1.26.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/wayland, and runs the triggers its paths call for.
Contents
Installed programs: wayland-scanner.
Installed libraries: libwayland-client.so, libwayland-cursor.so, libwayland-egl.so, libwayland-server.so.
Installed directories: /usr/share/licenses/wayland, /usr/share/wayland.
Short descriptions
wayland-client.pc |
Wayland client side library |
wayland-cursor.pc |
Wayland cursor helper library |
wayland-egl.pc |
Frontend wayland-egl library |
wayland-egl-backend.pc |
Backend wayland-egl interface |
wayland-scanner.pc |
Wayland scanner |
wayland-server.pc |
Server side implementation of the Wayland protocol |
Notes
The scanner is a build tool as much as a library: every port that speaks a protocol beyond the core one, from wayland-protocols to the KDOS programs of src/desktop, runs wayland-scanner during its own build to produce that protocol’s C code, so it has to be installed before any of them is configured.