Files
FWS-Kitty/packaging/install-ci-deps.sh
T
BlackAngelTV 86428e1863
CI / check (push) Failing after 6s
ci: install the Arch build dependencies on the runner
The self-hosted runner is a bare Arch host, so ruff and the compilation
libraries were missing and the first pipeline run stopped at the lint step.
The installer only calls pacman for what is absent, so later runs stay
unprivileged.
2026-11-25 10:17:18 +01:00

45 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
# Install on the Arch CI runner everything the linter, ./dev.sh build and
# makepkg need. Idempotent: nothing is handed to pacman when it is already
# installed, and sudo is only used when something is actually missing.
#
# The runner user needs passwordless sudo for pacman the first time; once the
# packages are there, the script is a no-op and no privilege is required.
set -eu
packages="git go python pkgconf ncurses rsync which file jq curl nodejs ruff \
harfbuzz zlib libpng lcms2 xxhash openssl shader-slang pixman cairo freetype2 \
fontconfig libcanberra systemd-libs simde libx11 libxcb libxrandr libxinerama \
libxcursor libxi libxrender xorgproto libxkbcommon libxkbcommon-x11 mesa dbus \
wayland wayland-protocols wayland-utils tar xz kitty-shell-integration \
kitty-terminfo"
missing=""
for package in $packages; do
if ! pacman -Q "$package" > /dev/null 2>&1; then
missing="$missing $package"
fi
done
# base-devel is a group, so verbose queries do not report it as a package.
for tool in gcc make fakeroot; do
if ! command -v "$tool" > /dev/null 2>&1; then
missing="$missing base-devel"
break
fi
done
if [ -z "$missing" ]; then
echo 'All the build dependencies are already installed.'
exit 0
fi
echo "Installing:$missing"
# pacman refuses to run without a terminal prompt for the password when the
# runner user has no NOPASSWD rule; fail with the list instead of hanging.
if ! sudo -n pacman -S --needed --noconfirm $missing; then
echo "::error::could not install:$missing"
echo '::error::give the runner user passwordless sudo for pacman or preinstall these packages.'
exit 1
fi