feat: build CouchOS Melee appliance
Some checks failed
ci / verify (push) Has been cancelled

This commit is contained in:
jackmhny
2026-08-03 02:52:28 +02:00
commit 04ef2a0d74
42 changed files with 3671 additions and 0 deletions

77
scripts/install_slippi.sh Executable file
View File

@@ -0,0 +1,77 @@
#!/usr/bin/env bash
set -Eeuo pipefail
API_URL="${SLIPPI_RELEASE_API_URL:-https://api.github.com/repos/project-slippi/slippi-launcher/releases/latest}"
INSTALL_DIR="${SLIPPI_INSTALL_DIR:-/home/couch/Applications}"
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "${TMP_DIR}"' EXIT
log() {
printf '[install_slippi] %s\n' "$*"
}
require_cmd() {
command -v "$1" >/dev/null 2>&1 || {
printf 'missing required command: %s\n' "$1" >&2
exit 1
}
}
require_cmd curl
require_cmd jq
require_cmd install
mkdir -p "${INSTALL_DIR}"
validate_asset_url() {
local url="$1"
local expected_name_regex="$2"
if [[ ! "${url}" =~ ^https://github\.com/project-slippi/slippi-launcher/releases/download/ ]]; then
printf 'unexpected asset host or path: %s\n' "${url}" >&2
exit 1
fi
local name
name="$(basename "${url}")"
if [[ ! "${name}" =~ ${expected_name_regex} ]]; then
printf 'unexpected asset name: %s\n' "${name}" >&2
exit 1
fi
}
release_json="${TMP_DIR}/release.json"
curl -fsSL "${API_URL}" -o "${release_json}"
appimage_url="$(jq -r '[.assets[] | select(.name | test("^Slippi-Launcher-.*x86_64\\.AppImage$")) | .browser_download_url] | first // empty' "${release_json}")"
checksum_url="$(jq -r '[.assets[] | select(.name | test("(sha256|checksums?)(\\.txt)?$"; "i")) | .browser_download_url] | first // empty' "${release_json}")"
if [[ -z "${appimage_url}" ]]; then
printf 'could not find official Slippi Launcher AppImage asset\n' >&2
exit 1
fi
validate_asset_url "${appimage_url}" '^Slippi-Launcher-.*x86_64\.AppImage$'
appimage_name="$(basename "${appimage_url}")"
appimage_path="${TMP_DIR}/${appimage_name}"
curl -fsSL "${appimage_url}" -o "${appimage_path}"
if [[ -n "${checksum_url}" ]]; then
validate_asset_url "${checksum_url}" '^(sha256|checksums?)(\.[A-Za-z0-9]+)?$'
checksum_path="${TMP_DIR}/checksums.txt"
curl -fsSL "${checksum_url}" -o "${checksum_path}"
if grep -F "${appimage_name}" "${checksum_path}" >/dev/null 2>&1; then
(
cd "${TMP_DIR}"
grep -F "${appimage_name}" "${checksum_path}" | sha256sum --check --status
)
log "checksum verified for ${appimage_name}"
else
printf 'checksum asset present but does not include %s\n' "${appimage_name}" >&2
exit 1
fi
else
log "no upstream checksum asset published for this release; upstream verification unavailable"
fi
install -m 0755 "${appimage_path}" "${INSTALL_DIR}/${appimage_name}"
ln -sfn "${INSTALL_DIR}/${appimage_name}" "${INSTALL_DIR}/SlippiLauncher.AppImage"
log "installed ${INSTALL_DIR}/${appimage_name}"