sector-f-linux

Sector F Linux
git clone https://git.sectorflabs.com/sector-f-linux.git
Log | Files | Refs | README | LICENSE

commit cc8390bbebd95067ef1adb1efafb7a9e9aa3dbb4
parent ef6f087d5f1b1f4cb44a1fb2c69446d49f233198
Author: Divan Visagie <me@divanv.com>
Date:   Fri, 16 Oct 2026 13:02:48 +0200

Build the launcher from its own repository, now public

patina-launcher left patina-desktop (its ADR-0037). The image's desktop
build stages and builds it beside patina-desktop and Files; the FreeBSD
VM builds it beside the compositor. With every dependency public, the
FreeBSD staging no longer vendors crates; the image build still does,
so its container builds offline. Built both ways.

Diffstat:
Mfreebsd/README.md | 2+-
Mfreebsd/bsdt.toml | 9++++++---
Mfreebsd/stage.sh | 48++++++++++++++++++++++++------------------------
Mlinux/desktop/build.sh | 24+++++++++++++-----------
4 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/freebsd/README.md b/freebsd/README.md @@ -18,7 +18,7 @@ headless sway over VNC, not as a session on real graphics (drm-kmod on hardware) ## Running it ``` -freebsd/stage.sh copy patina-desktop's last commit into freebsd/src/ for the VM to build +freebsd/stage.sh copy patina-desktop's and patina-launcher's last commits into freebsd/src/ cd freebsd && bsdt up boot it (the first time: FreeBSD's ZFS image, packages, the build) bsdt ssh a shell in it bsdt key super+shift+3 a screenshot, with Patina's own key, into the VM's ~/Pictures/Screenshots diff --git a/freebsd/bsdt.toml b/freebsd/bsdt.toml @@ -2,7 +2,7 @@ # base than Ubuntu with bootc (README.md). FreeBSD 15.1 on a ZFS root, so boot # environments (bectl) and /home as a dataset come with the system. # -# freebsd/stage.sh copy patina-desktop's last commit into src/ (run first) +# freebsd/stage.sh copy patina-desktop's and patina-launcher's last commits into src/ # bsdt up from freebsd/: boot it, build the desktop on first boot # # QEMU's graphics have no FreeBSD driver, so the desktop runs nested: the @@ -24,10 +24,13 @@ install = ["rust", "git", "pkgconf", "libxkbcommon", "pixman", "libudev-devd", " "seatd", "mesa-libs", "libdrm", "wayland"] [sync] -exclude = ["src/patina-desktop/target"] +exclude = ["src/patina-desktop/target", "src/patina-launcher/target"] [provision] -run = ["cd src/patina-desktop && cargo build --release"] +# The launcher goes beside the compositor, which puts its own folder first +# on its clients' PATH. +run = ["cd src/patina-desktop && cargo build --release", + "cd src/patina-launcher && cargo build --release && cp target/release/patina-launcher ../patina-desktop/target/release/"] [gui] desktop = "sway" diff --git a/freebsd/stage.sh b/freebsd/stage.sh @@ -1,29 +1,29 @@ #!/usr/bin/env bash -# Copies patina-desktop's last commit into freebsd/src/patina-desktop, which -# bsdt syncs into the VM (it syncs only this folder). PATINA_DESKTOP is the -# checkout (default: patina-desktop beside patina-os); PATINA_DESKTOP_WORKTREE=1 -# copies its working tree instead, uncommitted changes and all. +# Copies the last commits of patina-desktop and patina-launcher into +# freebsd/src/, which bsdt syncs into the VM (it syncs only this folder); the +# VM builds both (bsdt.toml's provision). PATINA_DESKTOP and PATINA_LAUNCHER +# are the checkouts (default: beside patina-os); PATINA_DESKTOP_WORKTREE=1 +# copies their working trees instead, uncommitted changes and all. set -euo pipefail HERE=$(cd "$(dirname "$0")" && pwd) -SRC=${PATINA_DESKTOP:-$HERE/../../patina-desktop} -DEST="$HERE/src/patina-desktop" -[[ -d "$SRC/.git" ]] || { echo "error: no patina-desktop checkout at $SRC" >&2; exit 1; } -# Keep cargo's target folder, if the VM's build left one, so rebuilds are quick. -mkdir -p "$DEST" -find "$DEST" -mindepth 1 -maxdepth 1 ! -name target -exec rm -rf {} + -if [[ -n "${PATINA_DESKTOP_WORKTREE:-}" ]]; then - git -C "$SRC" ls-files -z --cached --others --exclude-standard | - tar -c -C "$SRC" --null -T - | tar -x -C "$DEST" - echo "==> staged patina-desktop's working tree (on $(git -C "$SRC" rev-parse --short HEAD))" -else - git -C "$SRC" archive HEAD | tar -x -C "$DEST" - echo "==> staged patina-desktop $(git -C "$SRC" rev-parse --short HEAD)" -fi -# patina-apps is a private git dependency the VM can't fetch; vendor every -# crate here, where ssh reaches it, and point cargo at the copy. -(cd "$DEST" && cargo vendor --locked vendor > .cargo/config.toml.vendor 2> .cargo/vendor.log) || - { cat "$DEST/.cargo/vendor.log" >&2; exit 1; } -mv "$DEST/.cargo/config.toml.vendor" "$DEST/.cargo/config.toml" -echo "==> vendored its crates" +# Copies checkout $1 into src/$2, keeping cargo's target folder, if the VM's +# build left one, so rebuilds are quick. +stage() { + local src=$1 dest="$HERE/src/$2" + [[ -d "$src/.git" ]] || { echo "error: no checkout at $src" >&2; exit 1; } + mkdir -p "$dest" + find "$dest" -mindepth 1 -maxdepth 1 ! -name target -exec rm -rf {} + + if [[ -n "${PATINA_DESKTOP_WORKTREE:-}" ]]; then + git -C "$src" ls-files -z --cached --others --exclude-standard | + tar -c -C "$src" --null -T - | tar -x -C "$dest" + echo "==> staged $2's working tree (on $(git -C "$src" rev-parse --short HEAD))" + else + git -C "$src" archive HEAD | tar -x -C "$dest" + echo "==> staged $2 $(git -C "$src" rev-parse --short HEAD)" + fi +} + +stage "${PATINA_DESKTOP:-$HERE/../../patina-desktop}" patina-desktop +stage "${PATINA_LAUNCHER:-$HERE/../../patina-launcher}" patina-launcher diff --git a/linux/desktop/build.sh b/linux/desktop/build.sh @@ -1,26 +1,27 @@ #!/usr/bin/env bash # Builds the Patina desktop for the image, from the last commits of -# patina-desktop and Files (not their working trees, so stray changes don't +# patina-desktop, patina-launcher and Files (not their working trees, so stray changes don't # ship), and lays out what the image adds in build/desktop/, as it goes # under /: # -# usr/bin/patina-* the desktop's binaries +# usr/bin/patina-* the desktop's binaries and the launcher # usr/share/wayland-sessions/patina.desktop "Patina" at the login screen # etc/pam.d/patina-lock the lock screen's PAM service # usr/bin/files, usr/share/applications/... Files, the file manager # usr/share/dbus-1/services/...portal.desktop.patina.service, # usr/share/xdg-desktop-portal/... Files as the session's file chooser # etc/xdg/patina-mimeapps.list folders open in Files, in Patina -# usr/lib/patina-os/{desktop,files} which commits they were built from +# usr/lib/patina-os/{desktop,launcher,files} which commits they were built from # -# PATINA_DESKTOP and PATINA_FILES are the checkouts (default: beside -# patina-os). PATINA_DESKTOP_WORKTREE=1 builds their working trees instead, +# PATINA_DESKTOP, PATINA_LAUNCHER and PATINA_FILES are the checkouts +# (default: beside patina-os). PATINA_DESKTOP_WORKTREE=1 builds their working trees instead, # uncommitted changes and all, to try them in the VM; the image then says # "+dirty". set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) SRC=${PATINA_DESKTOP:-$ROOT/../../patina-desktop} +LAUNCHER=${PATINA_LAUNCHER:-$ROOT/../../patina-launcher} FILES=${PATINA_FILES:-$ROOT/../../files} BUILD="$ROOT/build" STAGE="$BUILD/desktop" @@ -30,9 +31,8 @@ say() { printf '==> %s\n' "$*"; } worktree=${PATINA_DESKTOP_WORKTREE:-} -# Copies checkout $1 into $2, vendors its crates (patina-apps is a private -# git dependency the container can't fetch; ssh reaches it here), and prints -# the commit it came from. +# Copies checkout $1 into $2, vendors its crates (so the container builds +# offline, git dependencies included), and prints the commit it came from. stage() { local src=$1 dest=$2 commit dirty [[ -d "$src/.git" ]] || { echo "error: no checkout at $src" >&2; exit 1; } @@ -60,10 +60,11 @@ docker build -q -f "$ROOT/desktop/builder.Containerfile" -t "$BUILDER" "$ROOT/de mkdir -p "$BUILD/target" commit=$(stage "$SRC" "$BUILD/src") +launcher_commit=$(stage "$LAUNCHER" "$BUILD/launcher-src") files_commit=$(stage "$FILES" "$BUILD/files-src") # Cargo's downloads are kept in a volume, and its target folder in build/, so # rebuilds are incremental. As the user, so build/ stays theirs. -for project in src files-src; do +for project in src launcher-src files-src; do say "building $project" docker run --rm --user "$(id -u):$(id -g)" \ -e CARGO_HOME=/cargo -e HOME=/tmp \ @@ -75,8 +76,8 @@ done say "laying out build/desktop" rm -rf "$STAGE" -binaries=(patina-bar patina-compositor patina-launcher patina-lock patina-menu - patina-volume patina-wallpaper patina-wifi) +binaries=(patina-bar patina-compositor patina-lock patina-menu + patina-volume patina-wallpaper patina-wifi patina-launcher) install -d "$STAGE/usr/bin" for b in "${binaries[@]}"; do install -m 755 "$BUILD/target/release/$b" "$STAGE/usr/bin/" @@ -103,3 +104,4 @@ install -D -m 644 "$F/packaging/portal/patina-portals.conf" "$STAGE/usr/share/xd install -d "$STAGE/etc/xdg" printf '[Default Applications]\ninode/directory=com.sectorflabs.Files.desktop\n' > "$STAGE/etc/xdg/patina-mimeapps.list" echo "$files_commit" > "$STAGE/usr/lib/patina-os/files" +echo "$launcher_commit" > "$STAGE/usr/lib/patina-os/launcher"