192.2. wayland-protocols-1.49
Wayland protocol XML definitions (xdg-shell, layer-shell, etc.)
| Version | 1.49, release 1 |
| Shelf | wl — Wayland libraries and protocols, and Wayland-only desktop utilities |
| Phase | 42_graphics (Graphics Stack), 6 of 189 in build order |
| Licence | MIT |
| Homepage | https://gitlab.freedesktop.org/wayland/wayland-protocols |
| Build time | 0.1 SBU |
| Installed size | 1008.2 KiB in 124 files |
| Recipe | ports/core/wl/wayland-protocols/kpkgbuild |
About
wayland-protocols is the set of Wayland protocol extensions maintained beside the core protocol: xdg-shell, which every desktop window is, and the rest of the stable, staging and unstable extensions (text-input, linux-dmabuf, presentation-time, fractional-scale, tablet and many more). The package is mostly the protocols’ XML, under /usr/share/wayland-protocols, with a pkg-config file, wayland-protocols.pc, whose pkgdatadir tells a consumer where that is. A consumer runs wayland’s wayland-scanner over the files it needs during its own build. The one thing this port generates itself is a header of enumerations per protocol, /usr/include/wayland-protocols/<protocol>-enum.h, which it makes with wayland-scanner --strict whenever the scanner is installed, and in KDOS it always is.
In KDOS it is a build dependency of most programs that speak an extension: KWin on the server side, the Wayland backends of GTK 3, GTK 4 and SDL 3, Mesa, and Xwayland. Qt’s Wayland platform and GLFW carry their own copies of the XML they use and do not depend on it.
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-protocols-1.49.tar.xz(147.1 KiB)
sha256ec4c8f74942d6dff7ace8b4ce4764f0ef9ff618a935d974ea77edee2ad240b14
upstream: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.49/downloads/wayland-protocols-1.49.tar.xz
archive copy: sources-4/wl--wayland-protocols-1.49.tar.xz
Dependencies
Required by (47): amiberry, blender, fcitx5, fltk, freerdp, glmark2, gst-plugins-bad, gst-plugins-base, gtk3, gtk4, gwenview, imv, kclock, kdeconnect, kdos-boxsock, kguiaddons, kidletime, kodi, kscreen, kwayland, kwin, kwindowsystem, layer-shell-qt, libdecor, libplasma, libxkbcommon, mesa, mesa-demos, mpv, plasma-desktop, plasma-keyboard, retroarch, sdl3, spice-gtk, swayimg, vlc, vulkan-tools, wayland-utils, waylandpp, webkitgtk, webkitgtk6, wev, wine, wl-clipboard, wlvncc, xdg-desktop-portal-kde, xwayland.
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-protocols'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/wl/wayland-protocols.
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-protocols
echo 'ec4c8f74942d6dff7ace8b4ce4764f0ef9ff618a935d974ea77edee2ad240b14 wayland-protocols-1.49.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-protocols
SRC=$SRC_ROOT/wayland-protocols-1.49
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf wayland-protocols-1.49.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 \
-Dtests=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
The switches, and why each is set:
-Dtests=false— Builds none of upstream’s checks, which compile the scanner’s output for every protocol. With tests on, configure requireswayland-scanner; with them off, it uses the scanner when it finds one, for the enumeration headers, and carries on without it otherwise.
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-protocols, 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-protocols-1.49-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-protocols, and runs the triggers its paths call for.
Contents
Installed directories: /usr/include/wayland-protocols, /usr/share/licenses/wayland-protocols, /usr/share/wayland-protocols.
Short descriptions
wayland-protocols.pc |
Wayland protocol files |
Notes
The --strict run makes a protocol file that fails the DTD check stop this build, rather than warn, so a broken XML file in a new release shows up here and not in the first consumer.
A program built against an older copy of these files does not see a protocol added later, and a newer protocol version in the XML does nothing until the compositor implements it. The version that matters at run time is the one KWin advertises, not the one installed here.