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
51 lines
2.1 KiB
Bash
Executable File
51 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# cua-driver local/debug installer — Rust backend only.
|
|
#
|
|
# This script is for developers working on the checked-out tree. It builds
|
|
# cua-driver from libs/cua-driver/rust and installs the cross-platform binary.
|
|
#
|
|
# Flags (forwarded verbatim to the Rust helper):
|
|
# --release build the release configuration (default: debug)
|
|
# --autostart register an auto-start daemon (macOS: LaunchAgent;
|
|
# Linux: systemd user unit). Default off.
|
|
# --bin-dir <path> override the symlink destination (default ~/.local/bin)
|
|
# --backend=rust explicit Rust backend (no-op; Rust is the only option)
|
|
# --experimental-rust legacy alias for --backend=rust (no-op)
|
|
# --backend=swift retired Swift backend (no-op; accepted for compat)
|
|
#
|
|
# Not for end-users — see install.sh for the curl-pipe-bash one-liner that
|
|
# fetches the signed release tarball.
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
# --- Lightweight flag parsing -----------------------------------------------
|
|
# Consume backend flags (no-ops for compat) and forward the rest to the Rust helper.
|
|
FORWARDED_ARGS=()
|
|
PASSTHROUGH=0
|
|
while [[ $# -gt 0 ]]; do
|
|
if [[ "$PASSTHROUGH" == "1" ]]; then
|
|
FORWARDED_ARGS+=("$1"); shift; continue
|
|
fi
|
|
case "$1" in
|
|
--backend=rust) shift ;; # explicit Rust (no-op)
|
|
--experimental-rust) shift ;; # legacy alias (no-op)
|
|
--backend=swift) shift ;; # retired Swift (no-op)
|
|
--backend=*)
|
|
printf 'error: unknown backend %q; supported: rust\n' "${1#*=}" >&2
|
|
exit 2
|
|
;;
|
|
--) PASSTHROUGH=1; shift ;; # forward the rest verbatim
|
|
*) FORWARDED_ARGS+=("$1"); shift ;;
|
|
esac
|
|
done
|
|
|
|
HELPER="$SCRIPT_DIR/_install-local-rust.sh"
|
|
if [[ ! -f "$HELPER" ]]; then
|
|
printf 'error: backend helper not found at %s\n' "$HELPER" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# `${arr[@]+"${arr[@]}"}` guards `set -u` on the zero-arg case (macOS bash 3.2).
|
|
exec /bin/bash "$HELPER" ${FORWARDED_ARGS[@]+"${FORWARDED_ARGS[@]}"}
|