compositor/kms: libseat (device access, VT switching), DRM dumb buffers with page flips and a hardware cursor, libinput keyboard/pointer, xkbcommon keymap and modifiers. --drm runs the compositor on the real display at the monitor's native mode. session/ holds the display-manager entry, launcher script and installer (just install-session). Untested on hardware: refuses to start inside another session. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
82 lines
2.9 KiB
Makefile
82 lines
2.9 KiB
Makefile
# moon-plasma tasks. `just` lists them.
|
|
set shell := ["bash", "-euo", "pipefail", "-c"]
|
|
|
|
export PATH := env_var('HOME') + "/.moon/bin:" + env_var('PATH')
|
|
|
|
socket := env_var_or_default('XDG_RUNTIME_DIR', '/tmp') + "/wayland-moon-0"
|
|
theme := "config/themes/moon-night.json"
|
|
exe := "_build/native/debug/build/compositor/bin/bin.exe"
|
|
release_exe := "_build/native/release/build/compositor/bin/bin.exe"
|
|
tcc := justfile_directory() + "/scripts/tcc/tcc"
|
|
|
|
default:
|
|
@just --list
|
|
|
|
# Build the vendored tinycc (third_party/tinycc) into _build/tcc, once.
|
|
tcc-build:
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
[ -x _build/tcc/bin/tcc ] && exit 0
|
|
root="$PWD"
|
|
rm -rf _build/tcc-src
|
|
mkdir -p _build
|
|
cp -r third_party/tinycc _build/tcc-src
|
|
cd _build/tcc-src
|
|
./configure --prefix="$root/_build/tcc" >/dev/null
|
|
make -j"$(nproc)" >/dev/null
|
|
make install >/dev/null
|
|
|
|
# Debug build of the native compositor, compiled and linked with the vendored tcc.
|
|
build: tcc-build
|
|
MOON_CC={{tcc}} MOON_STUB_CC={{tcc}} moon build --target native --warn-list -a compositor/bin
|
|
|
|
# Optimised build with the system C compiler (slower to build, faster to run).
|
|
build-release:
|
|
moon build --target native --release --warn-list -a compositor/bin
|
|
|
|
# Run the compositor in a window on your current Wayland session (close the window or Ctrl-C to stop). Connect clients via `just client`.
|
|
run: build
|
|
rm -f {{socket}}
|
|
{{exe}} --window --socket {{socket}} --theme {{theme}}
|
|
|
|
# Run the compositor with no window (clients only; no output).
|
|
run-headless: build
|
|
rm -f {{socket}}
|
|
{{exe}} --socket {{socket}} --theme {{theme}}
|
|
|
|
# Run the compositor on the real display (DRM/KMS + libinput). Run from a login VT (Ctrl+Alt+F3), not inside another session. Ctrl+Alt+Backspace quits, Ctrl+Alt+F<n> switches VT.
|
|
run-drm: build-release
|
|
rm -f {{socket}}
|
|
{{release_exe}} --drm --socket {{socket}} --theme {{theme}}
|
|
|
|
# Install the Moon Plasma login session (display-manager entry); asks for root once.
|
|
install-session: build-release
|
|
run0 python3 session/install.py
|
|
|
|
# Remove the login session again.
|
|
uninstall-session:
|
|
run0 python3 session/install.py --remove
|
|
|
|
# Start a Wayland client inside the running compositor (default: foot).
|
|
client *cmd="foot":
|
|
WAYLAND_DISPLAY={{socket}} {{cmd}}
|
|
|
|
# Compositor + wasm component + lib tests.
|
|
test:
|
|
moon test --target native --warn-list -a compositor/renderer compositor/host
|
|
moon test --target wasm --warn-list -a lib/shell lib/panel lib/clock lib/launcher lib/wm
|
|
|
|
# Render one composed frame to _build/e2e_frame.png (via the e2e test).
|
|
frame:
|
|
moon test --target native --warn-list -a compositor/host
|
|
@echo "wrote _build/e2e_frame.png"
|
|
|
|
# Everything CI runs.
|
|
ci:
|
|
scripts/test.sh
|
|
|
|
# Render one frame of the desktop to _build/desktop.png and open it.
|
|
view: build
|
|
{{exe}} --socket {{socket}}-snap --theme {{theme}} --gfx-out _build/desktop.png
|
|
xdg-open _build/desktop.png
|