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

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 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, libXi and 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++ binding waylandpp, and Wayland utilities that need no particular compositor: wl-clipboard, waypipe, wev and wayland-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 chafa and 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
input holds libxkbcommon, whose closure reaches Wayland, and libei. base holds kbd, the console key tables and utilities. xdg holds xdg-desktop-portal. lang holds OpenJDK, Tk with BWidget, and R. The remaining subject shelves, from 3d to virt, 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, the kdos command and the console login prompt kdos-getty. It is built here because two of its dependencies reach the graphics stack: kbd, which provides the loadkeys the getty runs and depends on libxkbcommon, and wl-clipboard. kdos-boxsock sits beside it. It provides the Wayland socket through which each box’s applications connect, tagged with the box through the Wayland security-context-v1 protocol that KWin serves, and it is built here because it depends on wayland.

Which ports have full pages

The book gives each port one of three treatments (see The three tiers):

See also