Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

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

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.

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:

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.