greeter-build.sh (1114B)
1 #!/usr/bin/env bash 2 # Builds the Patina greeter (../greeter) for the image, in the same Fedora 45 builder as the 3 # desktop (desktop/build.sh), so it links the libraries the image has. It lands in 4 # build/greeter/ as it goes under /, and the Containerfile copies it in. The whole repository is 5 # mounted because the greeter embeds the logo from linux/system/. 6 set -euo pipefail 7 8 ROOT=$(cd "$(dirname "$0")/.." && pwd) # the repository 9 BUILDER=patina-os-desktop-builder 10 STAGE="$ROOT/linux/build/greeter" 11 12 docker build -q -f "$ROOT/linux/desktop/builder.Containerfile" -t "$BUILDER" "$ROOT/linux/desktop" >/dev/null 13 printf '==> building patina-greeter\n' 14 docker run --rm --user "$(id -u):$(id -g)" -e CARGO_HOME=/cargo -e HOME=/tmp \ 15 -v patina-os-cargo:/cargo -v "$ROOT:/repo" -w /repo/greeter "$BUILDER" \ 16 cargo build --release --locked --target-dir /repo/greeter/target-fedora 17 18 rm -rf "$STAGE" && mkdir -p "$STAGE/usr/libexec" 19 install -m 755 "$ROOT/greeter/target-fedora/release/patina-greeter" "$STAGE/usr/libexec/patina-greeter" 20 printf '==> build/greeter/ (%s)\n' "$(git -C "$ROOT" rev-parse --short HEAD)"