Part X. The graphics stack
This part covers 42_graphics, the phase that builds everything that draws a picture or plays a sound without a GUI toolkit. Read it to find where a graphics or media library is built, or to decide which phase a new port of that kind belongs to.
The phase builds:
- the Wayland libraries and protocols;
- the X11 client libraries and Xwayland;
- the GPU stack around Mesa;
- the 2D rendering and text-layout libraries;
- PipeWire, FFmpeg and GStreamer, and SDL;
- every other library or tool whose dependency closure (the port’s dependencies, their dependencies, and so on) reaches one of those without reaching a toolkit.
The sections below give the rule that fills the phase, the shelves (port categories) that carry it, why two programs of KDOS’s own are built here, and which ports have a full page. The package pages follow in chapters by shelf, in the shelves’ own order; within a shelf they are in the order kpkgdepends builds them.
What belongs here
Every file of the phase’s list opens with the rule:
# Ports whose dependency closure reaches wayland, libX11, mesa, libdrm, cairo,
# pango, gstreamer, ffmpeg or pipewire but no toolkit, and that are not leaf
# applications.
script/phases/42_graphics/packages.d/3d.txt, lines 16–18
“Leaf applications” is meant narrowly. A port that nothing else depends on goes to Part XII only when it sits on one of the application shelves, such as graphics, browsers or video-players. On any other shelf it stays here: KOReader on documents and nvtop on sysmon are two examples. An application that other ports depend on also stays here even on an application shelf, as mpv on video-players does, because frontends such as Haruna and Celluloid link it. The application shelves are listed under Which phase lists a port. A port whose closure reaches GTK, Qt, wxWidgets, FLTK or Motif is never here; it belongs to Part XI or Part XII.
The Wayland base is built in this phase, not in Part XIII with the desktop, because it is useful without a compositor: wl-clipboard, waypipe and wev work under any Wayland compositor, and Xwayland is started by whichever compositor runs it. The 50_desktop list, by the rule in its header, holds what the desktop session is and nothing an application needs at build time.
The list, by shelf
The list is the directory script/phases/42_graphics/packages.d/, one file per shelf. The files are read in byte order as one list, and there is no separate order file. These are the chapters that carry the phase:
x11-
Xlib and the X extension libraries (
libXext,libXrandr,libXiand the rest),xkbcomp,xauth, and Xwayland, the one X server KDOS has (see No Xorg server). The protocol headers and the XCB libraries under them are built in Part IX. wl-
wayland and wayland-protocols,
libdecor, the C++ bindingwaylandpp, and Wayland utilities that need no particular compositor:wl-clipboard,waypipe,wevandwayland-utils. gpu-
libdrm,libglvnd, Mesa, the Vulkan loader and tools, VA-API (the Video Acceleration API) with the Intel media drivers, and the GL helper libraries GLU, GLEW, GLFW and freeglut. graphics-libs,image-libs-
cairo, HarfBuzz, Pango and librsvg with their C++ bindings, and the image libraries whose closure reaches the graphics stack, such as
chafaand OpenImageIO. audio-io,media-frameworks- PipeWire and WirePlumber, OpenAL and PortAudio; FFmpeg, GStreamer and its plugin sets, and libcamera. PipeWire is here because its closure reaches FFmpeg and GStreamer.
game-libs-
SDL 3;
sdl2-compat, which answers SDL 2 calls through SDL 3;sdl12-compat, which answers SDL 1.2 calls through SDL 2; their image, font, sound and network libraries; and the LÖVE game framework. - Smaller chapters
-
inputholds libxkbcommon, whose closure reaches Wayland, andlibei.baseholdskbd, the console key tables and utilities.xdgholdsxdg-desktop-portal.langholds OpenJDK, Tk with BWidget, and R. The remaining subject shelves, from3dtovirt, hold the libraries and tools of their fields that draw without a toolkit, such as VTK, MuPDF and KOReader. src-system-
kdos-tools is one binary installed under many names, among them the service supervisor
ksvc, thekdoscommand and the console login promptkdos-getty. It is built here because two of its dependencies reach the graphics stack:kbd, which provides theloadkeysthe getty runs and depends on libxkbcommon, andwl-clipboard. kdos-boxsock sits beside it. It provides the Wayland socket through which each box’s applications connect, tagged with the box through the Waylandsecurity-context-v1protocol that KWin serves, and it is built here because it depends onwayland.
Which ports have full pages
The book gives each port one of three treatments (see The three tiers):
- Tier A: a full page with a hand-written note beside the recipe. In this phase these are the display and audio spine: wayland and wayland-protocols, libxkbcommon, Mesa, Xwayland, PipeWire and WirePlumber, and
kdos-toolsandkdos-boxsock. - Tier B: a full page for a port with something unusual about it, whose note says what that is. A port is Tier B when it carries a patch, vendors its dependencies, has a
build.shover 30 lines, or is a dependency of 20 or more ports. Many of this phase’s Tier B pages are libraries much of the tree links:libdrm,libX11,libglvnd, the Vulkan loader, cairo, HarfBuzz, Pango, librsvg, FFmpeg and GStreamer among them. - Tier C: every other port, shown as a short card.
See also
- The userland:
40_langto44_apps: the phase among the five userland phases - Audio: what PipeWire and WirePlumber do in the session
- Xwayland: how KWin runs the X server built here
- Reading a package page: how the pages below are laid out
- Part XI: the next phase