Skip to content

Building from Source

Bruh edited this page Nov 27, 2026 · 1 revision

Building from Source

Source: docs/BUILDING.md and the README. Commands below exist in the tree; they are not placeholders.

Environment

  • Release target: Debian 13 (trixie), x86_64, Qt 6.8, pinned wlroots compatibility layer.
  • Development environment: WSL2 Ubuntu 22.04 or a Debian/Ubuntu Linux host. The component CMake files also compile against the older Qt 6.2 / wlroots 0.15 stack on Ubuntu 22.04.
  • Toolchain: C++20 compiler, CMake 3.22+, Ninja, Qt 6, wlroots development headers, Wayland protocols, libxkbcommon, libinput, D-Bus libraries.
  • ISO extras: root, debootstrap, live-build, squashfs-tools, xorrisofs, GRUB EFI and BIOS binaries, Debian's current archive signing keys.
  • VM extras: qemu-system-x86_64 and OVMF for UEFI. KVM is optional; TCG works but is slower.

Install everything in WSL:

bash build/bootstrap-wsl.sh --all
bash build/bootstrap-runtime.sh

WSL clock drift

If APT reports Release file ... is not valid yet, or Ninja repeatedly re-runs CMake:

sudo bash build/fix-wsl-clock.sh
sudo bash build/normalize-source-times.sh

Nested virtualization (optional)

If /dev/kvm is unavailable QEMU uses TCG and is slower. Enable it in %USERPROFILE%\.wslconfig:

[wsl2]
nestedVirtualization=true

Then run wsl --shutdown from Windows and reopen WSL.

Unified build

cmake --preset dev
cmake --build --preset dev -j4
ctest --test-dir build/dev --output-on-failure

Presets:

Preset Purpose
dev Debug: shell, apps, compositor, installer, tests
rel Release with link-time optimization
nogui Only the dependency-free color engine/tools
asan AddressSanitizer/UBSan for the non-GUI subset

Build the session components

The ISO script expects these artifacts. They are separate CMake projects so development can proceed on an older host without forcing a newer Qt:

cmake -S libs/libm3 -B build/m3 -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/m3 --parallel

cmake -S compositor/matcomp -B build/matcomp -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/matcomp --parallel

cmake -S libs/libm3-qt -B build/qml -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DQT_QML_OUTPUT_DIRECTORY="$PWD/build/qml"
cmake --build build/qml --parallel

cmake -S shell/matsessiond -B build/matsessiond -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/matsessiond --parallel

cmake -S shell/matshell -B build/matshell -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build/matshell --parallel

bash build/build-core-apps.sh

build-core-apps.sh builds all nine applications and runs the calculator, text-editor, terminal-emulator and calendar unit tests.

Build an ISO

On older Ubuntu hosts, first refresh Debian's archive trust chain:

sudo bash build/refresh-debian-keyring.sh
sudo bash platform/iso/build.sh

The script:

  1. Verifies the session binaries and stages them with the QML module, wallpaper, desktop entries and session launcher.
  2. Creates a real Debian 13 live rootfs with systemd, NetworkManager, BlueZ, PipeWire, Mesa and the required Qt/wlroots libraries.
  3. Installs the live user/session configuration and GRUB UEFI/BIOS boot entries.
  4. Produces a squashfs root and a hybrid ISO at build/iso/materialized-0.2.1-amd64.iso with SHA-256 metadata.

Important: the ISO work directory is /var/tmp/materialized-iso because Windows-mounted /mnt/c cannot host Linux device nodes. Override with MAT_ISO_WORK (must be a Linux filesystem) and MAT_ISO_OUTPUT (output filename).

Smoke-test the ISO

bash tests/vm/run-qemu.sh --iso build/iso/materialized-0.2.1-amd64.iso --mode uefi
bash tests/vm/run-qemu.sh --iso build/iso/materialized-0.2.1-amd64.iso --mode bios

The harness waits for the Materialized session started serial marker from the loaded QML shell - a compositor-only process does not count as a working desktop. See Testing for the full test surface and Running the Live ISO for other hypervisors.

Live credentials

The evaluation image creates materialized with password materialized. This is intentionally a public evaluation credential, not a production account. Remove or change it before using the image outside an isolated VM.

Current limitations

The music player, software center, lock screen, full Settings coverage, graphical installer UI, XWayland and release-quality hardware/accessibility sign-off remain in the Roadmap and Status. The terminal, image viewer, screenshot tool, calendar, screencopy and Firefox ESR browser are implemented and verified.

Clone this wiki locally