191.25. xwayland-24.1.14
Rootless X server that runs X11 clients on a Wayland compositor
| Version | 24.1.14, release 1 |
| Shelf | x11 — X11 protocol, client libraries and data, plus Xwayland, the one X server |
| Phase | 42_graphics (Graphics Stack), 187 of 189 in build order |
| Licence | X11 AND MIT-open-group AND HPND AND BSD-3-Clause |
| Homepage | https://gitlab.freedesktop.org/xorg/xserver |
| Build time | 0.6 SBU |
| Installed size | 2.8 MiB in 7 files |
| Recipe | ports/core/x11/xwayland/kpkgbuild |
About
Xwayland is an X server that runs as a client of a Wayland compositor, drawing each X11 window as a Wayland surface of its own. In KDOS it is the one X server on the system: there is no Xorg server and nothing X on the login path (the SDDM greeter runs on kwin_wayland), and every program that has no Wayland path (Motif, Tk and Swing programs, VLC 3, an X11-only application inside a box) runs on it. The compositor, KWin, starts it rootless when the first X11 client connects, and is the only port that depends on this one: KWin’s Xwayland support is optional at configure time, so the dependency is what keeps it built in. What the carve-out allows and what it keeps out is in Principles.
The source is the X.Org server tree cut down to its Xwayland part, so the switches below are the X server’s own. The build turns off every other server and every feature that needs something KDOS does not carry, forces on the GPU paths an X11 client needs to get OpenGL, and points the keymap and font paths at the directories the KDOS ports install.
Why it is in KDOS
The comment above it in script/phases/42_graphics/packages.d/x11.txt:
A program with no Wayland path — Xastir, VLC 3, a Motif, Tk or Swing program, native or boxed — runs on Xwayland, the one X server. KWin starts it rootless when the first X11 client connects. The client libraries those programs link are on the x11 shelf.
Sources
xwayland-24.1.14.tar.xz(1.2 MiB)
sha2564eb6b98d678299a4b96138d886345b294130695760345ef84596225a8224078a
upstream: https://www.x.org/releases/individual/xserver/xwayland-24.1.14.tar.xz
archive copy: sources-4/x11--xwayland-24.1.14.tar.xz
Dependencies
Depends on: meson, wayland, wayland-protocols, libdrm, mesa, libglvnd, pixman, libxcvt, libxkbcommon, xorgproto, xtrans, libXau, libXfont2, libxshmfence, libepoxy, xkbcomp, xkeyboard-config, libX11, libxkbfile, libXdmcp, openssl, libbsd.
Required by (1): kwin.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-Dlibdecor=false, line 18: libdecor (explained with the switches below)
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 xwayland'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/x11/xwayland.
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/x11/xwayland
echo '4eb6b98d678299a4b96138d886345b294130695760345ef84596225a8224078a xwayland-24.1.14.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/xwayland
SRC=$SRC_ROOT/xwayland-24.1.14
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf xwayland-24.1.14.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 \
--prefix=/usr --sysconfdir=/etc --libdir=lib \
--buildtype=release \
-Dxvfb=false \
-Dsecure-rpc=false \
-Dxwayland_ei=false \
-Dlibdecor=false \
-Dsystemd_notify=false \
-Dxselinux=false \
-Dglamor=true \
-Ddri3=true \
-Dglx=true \
-Dsha1=libcrypto \
-Dxkb_dir=/usr/share/X11/xkb \
-Dxkb_output_dir=/var/lib/xkb \
-Dxkb_bin_dir=/usr/bin \
-Ddefault_font_path=/usr/share/fonts/misc/,/usr/share/fonts/75dpi/ \
-Ddocs=false \
-Ddevel-docs=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
install -dm755 $PKG/var/lib/xkb
The switches, and why each is set:
-Dxvfb=false— Does not buildXvfb, the virtual-framebuffer X server the tree would otherwise install besideXwayland. Xwayland is the only X server KDOS ships.-Dsecure-rpc=false— Leaves out theSUN-DES-1authorisation scheme, which needs Sun RPC from libtirpc or the C library. musl has no RPC, and the port does not depend on libtirpc; with the option on, configure would stop or link libtirpc depending on whether it happened to be installed.-Dxwayland_ei=false— Builds no emulated-input support. With it, Xwayland passes the XTEST requests of X clients (xdotooland the like) to the compositor through libei, directly or through the remote-desktop portal; without it they reach only other X clients. The default,auto, turns it on whenever libei is installed, and libei is built in the same phase;falsetakes the answer out of build order.-Dlibdecor=false— Draws no window decorations with libdecor when Xwayland runs rootful, as a single window holding a whole X desktop. The compositor runs it rootless only, where each X11 window is decorated by the compositor; as with libei,autowould follow whether libdecor happened to be built first.-Dsystemd_notify=false— Builds nosd_notifyreadiness call. KDOS has no systemd (see No systemd).-Dxselinux=false— Builds no SELinux extension. No libselinux port exists.-Dglamor=true— Renders the X server’s drawing with OpenGL through EGL and GBM from mesa. This is upstream’s default. It makes libxshmfence, libdrm and libepoxy required at configure time, but GBM is only looked for: Xwayland’s GBM backend, which is also where its DRI3 buffer sharing lives, is compiled only when glamor is on and Mesa’sgbmis found, and withoutgbmconfigure carries on and leaves that backend out.-Ddri3=true— Builds the DRI3 extension, through which an X client’s OpenGL or Vulkan driver shares buffers with the server instead of copying pixels.truemakes a missing libxshmfence, libdrm oreventfdstop configure, whereautowould quietly build without it.-Dglx=true— Builds GLX, the server side of OpenGL for X11, which is upstream’s default. Without it the server offers no GLX extension and an X11 client that asks for OpenGL through GLX gets none. It is half of a pair; Mesa, built with-D glx=dribehind libglvnd, is the other, and with GLX on configure requires thedriandglpkg-config files those two install.-Dsha1=libcrypto— Takes the SHA-1 the server uses to identify glyphs in the RENDER extension’s glyph cache from OpenSSL’s libcrypto (openssl is a dependency). Left onauto, the probe tries the C library, libmd, libsha1, nettle and libgcrypt before libcrypto and takes the first it finds, and libmd is a dependency of libbsd, so the result would depend on what else was in the root.-Dxkb_dir=/usr/share/X11/xkb— Where the server reads the XKB keymap sources, the directory xkeyboard-config installs.-Dxkb_output_dir=/var/lib/xkb— Where the server writes the keymaps xkbcomp compiles for it at run time. Upstream’s default iscompiled/insidexkb_dir, under/usr; this keeps the server’s own writes in/var, and the recipe’sinstall -dm755creates the directory in the package.-Dxkb_bin_dir=/usr/bin— Where the server findsxkbcomp, which it runs for every keymap.-Ddefault_font_path— The core-font path compiled into the server:/usr/share/fonts/misc/and/usr/share/fonts/75dpi/, the two directories font-misc-misc, font-cursor-misc and font-adobe-75dpi install into. Upstream’s default listsmisc,TTF,OTF,Type1,100dpiand75dpiunder the font-util root, most of which nothing in KDOS fills. A Motif or Xt program asks this server for-misc-fixedor-adobe-helvetica, and a font directory inside a box is invisible to a server running outside it, so these host fonts are the only core fonts any X client has.-Ddocs=false,-Ddevel-docs=false— Builds none of the DocBook protocol and developer manuals. They need xorg-sgml-doctools, which is not a port. TheXwayland(1)andXserver(1)manual pages are built either way.
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/xwayland, 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 xwayland-24.1.14-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/xwayland, and runs the triggers its paths call for.
Contents
Installed programs: Xwayland.
Installed directories: /usr/lib/xorg, /usr/share/licenses/xwayland, /var/lib/xkb.
Short descriptions
Xwayland |
an X server for running X clients under Wayland. |
xwayland.pc |
X Server for Wayland |
Notes
GLX for X clients takes both sides: turn GLX off here (-Dglx=false), or drop the GLX build of mesa, and every X11 program that asks for OpenGL through GLX stops at start-up, while every Wayland program carries on working. An X11 client inside a box draws with its box’s own Mesa over this server’s DRI3, so for boxed programs -Ddri3=true is the half that matters.
X11 programs under Xwayland have no input method. Xwayland carries no text input for its X clients, and fcitx5 is built without its XIM frontend; see Input methods.