项目文件夹

文件
wehub-resource-sync 91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:19 +08:00

63 行
1.8 KiB
Nix

# cua-compositor: a minimal headless wlroots compositor that cua-driver spawns
# as its nested session (CUA_WAYLAND_NEST_COMPOSITOR=cua-compositor) to perform
# focus-free keyboard injection and multi-cursor pointer injection via a unix
# control socket. Built from wlroots' own upstream tinywl example (pinned to the
# same wlroots_0_19 the patch targets) transformed by cua_compositor_patch.py —
# so it tracks the exact wlroots API in nixpkgs and needs no vendored C.
{
stdenv,
lib,
pkg-config,
python3,
wayland,
wayland-scanner,
wayland-protocols,
wlroots_0_19,
libxkbcommon,
pixman,
}:
stdenv.mkDerivation {
pname = "cua-compositor";
version = "0.1.0";
src = lib.cleanSource ./.;
nativeBuildInputs = [
pkg-config
python3
wayland-scanner
];
buildInputs = [
wayland
wayland-protocols
wlroots_0_19
libxkbcommon
pixman
];
buildPhase = ''
runHook preBuild
cp ${wlroots_0_19.src}/tinywl/tinywl.c tinywl.c
python3 cua_compositor_patch.py tinywl.c cua-compositor.c
wp=${wayland-protocols}/share/wayland-protocols
wayland-scanner server-header "$wp/stable/xdg-shell/xdg-shell.xml" xdg-shell-protocol.h
wayland-scanner private-code "$wp/stable/xdg-shell/xdg-shell.xml" xdg-shell-protocol.c
$CC -DWLR_USE_UNSTABLE -I. cua-compositor.c xdg-shell-protocol.c -o cua-compositor \
$(pkg-config --cflags --libs wlroots-0.19 wayland-server xkbcommon pixman-1)
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 cua-compositor $out/bin/cua-compositor
runHook postInstall
'';
meta = {
description = "Headless wlroots compositor with focus-free + multi-cursor input injection for cua-driver";
platforms = lib.platforms.linux;
mainProgram = "cua-compositor";
};
}