Files
ZebraticandClaude Opus 5.5 7dc52a4a2e Launcher: splash intro, new icon set, consoles, Lutris, Steam accounts, overlay
- Splash: Summit's icon rises in over an amber glow, the name follows, then it
  fades into the app (about a second, no keys taken, off when motion is off)
- install.sh: after installing icons, rebuild KDE's sycoca and send
  KIconLoader.iconChanged so a running Plasma shows the updated icon
- New app icon (SVG + rendered PNG sizes, render.sh), used by the packages and
  the engine's window
- Lutris scan, consoles (Remote Play via chiaki-ng frame tap, capture cards),
  Steam account switching, running-game tracking, window mode, artwork
- Library UI: add dialog, profile editor, accounts, "now playing" screen
- Engine: in-game overlay/HUD, overlay key, global key fixes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 01:53:49 +01:00

622 lines
23 KiB
Bash
Executable File

#!/bin/sh
# Summit installer for Linux.
#
# curl -fsSL https://git.molberg.cloud/alex/summit/raw/branch/main/install.sh | sh
#
# POSIX sh, no bashisms. Detects your distro, GPU vendor and display session,
# installs the Summit launcher (native package if one exists for a tagged
# release, otherwise builds from source with cargo) and sets up the engine's
# Python virtualenv (uv, Python 3.12, CUDA 12.8 torch only if an NVIDIA GPU
# is present).
#
# Run it again to update: it finds the existing install, says which version it has and which it gets, rebuilds
# only when the source changed, keeps the engine's venv (adding what new requirements need) and your data.
#
# Flags:
# --yes, -y don't ask before sudo steps
# --force rebuild and reinstall even when the installed version is the newest
# --dry-run print what would happen, change nothing
# --with-remote-play
# also build chiaki-ng with SmoovPlay's frame tap, for PlayStation Remote Play in Summit (with
# Enhance). Arch: makepkg (packaging/chiaki-ng/PKGBUILD, about 10 minutes); other distros: prints
# how to build it with packaging/chiaki-ng/build_linux.sh
# --uninstall remove what this installer installed
# --help, -h show this message
#
# Environment:
# SUMMIT_PREFIX where to install (default /usr/local)
# SUMMIT_SRC_DIR build this checkout as it is (no clone, no git pull)
# SUMMIT_REPO clone and update from this git URL instead (testing)
set -eu
# Files and folders it makes under the prefix must be readable by everyone, whatever umask the caller has (with
# 077, sudo made /usr/local/share/summit root-only and the engine's venv went to the wrong place).
umask 022
REPO_API="https://git.molberg.cloud/api/v1/repos/alex/summit"
REPO_GIT="${SUMMIT_REPO:-https://git.molberg.cloud/alex/summit.git}"
PREFIX="${SUMMIT_PREFIX:-/usr/local}"
SHARE_DIR="$PREFIX/share/summit"
BIN_DIR="$PREFIX/bin"
SRC_DIR="${SUMMIT_SRC_DIR:-$HOME/.cache/summit/src}"
APPS_DIR="$PREFIX/share/applications"
ICON_BASE="$PREFIX/share/icons/hicolor"
ICON_SIZES="16 24 32 48 64 128 256 512"
ASSUME_YES=0
FORCE=0
DRY_RUN=0
UNINSTALL=0
REMOTE_PLAY=0
log() { printf '%s\n' "$*"; }
step() { printf '\n==> %s\n' "$*"; }
die() { printf 'error: %s\n' "$*" >&2; exit 1; }
run() {
# Print the command, then execute it unless --dry-run.
printf ' $ %s\n' "$*"
if [ "$DRY_RUN" -eq 0 ]; then
"$@"
fi
}
# Questions are read from the terminal: under `curl ... | sh` the script itself is on stdin.
ask() {
printf '%s [y/N] ' "$1"
if [ -r /dev/tty ] && reply="$(head -n 1 < /dev/tty 2>/dev/null)"; then :; else
printf '\n'
die "no terminal to ask on: run again with --yes"
fi
case "$reply" in
y|Y|yes|YES) return 0 ;;
*) return 1 ;;
esac
}
run_sudo() {
if [ "$(id -u)" -eq 0 ]; then
run "$@"
return
fi
if [ "$ASSUME_YES" -eq 0 ] && [ "$DRY_RUN" -eq 0 ]; then
printf ' needs sudo: %s\n' "$*"
ask ' proceed?' || die "aborted before: $*"
fi
run sudo "$@"
}
# Files into the prefix: sudo only when it isn't writable (/usr/local is not; ~/.local is).
prefix_writable() { [ -w "$PREFIX" ] || { [ ! -e "$PREFIX" ] && [ -w "$(dirname "$PREFIX")" ]; }; }
run_prefix() {
if prefix_writable; then
run "$@"
else
run_sudo "$@"
fi
}
usage() {
sed -n '2,/^set -eu/p' "$0" | sed '$d' | sed 's/^# \{0,1\}//'
}
# Tools Summit calls at run time. A missing one only disables a feature, so a failure here warns instead of
# stopping the install: ffmpeg (Enhance reads the game window with it), xrandr (display profiles on X11),
# xdg-open (Heroic games, the clips folder) and zenity (Change artwork outside KDE; KDE has kdialog).
RUNTIME_TOOLS="ffmpeg xrandr xdg-open zenity"
for arg in "$@"; do
case "$arg" in
--yes|-y) ASSUME_YES=1 ;;
--force) FORCE=1 ;;
--dry-run) DRY_RUN=1 ;;
--with-remote-play) REMOTE_PLAY=1 ;;
--uninstall) UNINSTALL=1 ;;
--help|-h) usage; exit 0 ;;
*) die "unknown flag: $arg (see --help)" ;;
esac
done
# ---------------------------------------------------------------------------
# Detection
# ---------------------------------------------------------------------------
DISTRO_ID=unknown
DISTRO_FAMILY=unknown # arch, debian, fedora, opensuse
detect_distro() {
if [ -r /etc/os-release ]; then
# shellcheck disable=SC1091
. /etc/os-release
DISTRO_ID="${ID:-unknown}"
ID_LIKE_VAL="${ID_LIKE:-}"
else
DISTRO_ID=unknown
ID_LIKE_VAL=""
fi
case "$DISTRO_ID $ID_LIKE_VAL" in
*arch*|*cachyos*|*manjaro*) DISTRO_FAMILY=arch ;;
*debian*|*ubuntu*|*neon*|*linuxmint*|*mint*) DISTRO_FAMILY=debian ;;
*fedora*) DISTRO_FAMILY=fedora ;;
*opensuse*|*suse*) DISTRO_FAMILY=opensuse ;;
*)
case "$DISTRO_ID" in
arch|cachyos|manjaro) DISTRO_FAMILY=arch ;;
debian|ubuntu|neon|linuxmint) DISTRO_FAMILY=debian ;;
fedora) DISTRO_FAMILY=fedora ;;
opensuse*|sles) DISTRO_FAMILY=opensuse ;;
*) DISTRO_FAMILY=unknown ;;
esac
;;
esac
}
GPU_VENDOR=unknown # nvidia, amd, intel, none
detect_gpu() {
GPU_VENDOR=none
if ! command -v lspci >/dev/null 2>&1; then
return
fi
pci_vga="$(lspci -nn 2>/dev/null | grep -Ei 'vga|3d controller|display controller' || true)"
case "$pci_vga" in
*[Nn][Vv][Ii][Dd][Ii][Aa]*) GPU_VENDOR=nvidia ;;
*) case "$pci_vga" in
*[Aa][Mm][Dd]*|*[Aa][Tt][Ii]*|*[Rr]adeon*) GPU_VENDOR=amd ;;
*) case "$pci_vga" in
*[Ii]ntel*) GPU_VENDOR=intel ;;
*) GPU_VENDOR=none ;;
esac
;;
esac
;;
esac
}
SESSION_TYPE=unknown # wayland, x11
detect_session() {
SESSION_TYPE="${XDG_SESSION_TYPE:-}"
case "$SESSION_TYPE" in
wayland|x11) return ;;
esac
if [ -n "${WAYLAND_DISPLAY:-}" ]; then
SESSION_TYPE=wayland
elif [ -n "${DISPLAY:-}" ]; then
SESSION_TYPE=x11
else
# From a text console or ssh (XDG_SESSION_TYPE=tty): the type of this user's graphical session, if any.
SESSION_TYPE=unknown
if command -v loginctl >/dev/null 2>&1; then
for s in $(loginctl list-sessions --no-legend 2>/dev/null | awk -v u="$(id -un)" '$3 == u {print $1}'); do
t="$(loginctl show-session "$s" -p Type --value 2>/dev/null || true)"
case "$t" in wayland|x11) SESSION_TYPE="$t"; break ;; esac
done
fi
fi
}
# ---------------------------------------------------------------------------
# Package manager glue
# ---------------------------------------------------------------------------
install_dependencies() {
step "Installing build and runtime dependencies for $DISTRO_FAMILY"
case "$DISTRO_FAMILY" in
arch)
# Only what is missing (pacman -T needs no root), and no `pacman -Sy` without -u: on Arch that is a partial
# upgrade. If a package isn't in the local sync database, pacman says so: run `sudo pacman -Syu` first.
build_missing="$(pacman -T base-devel git curl pkgconf fontconfig 2>/dev/null || true)"
if [ -n "$build_missing" ]; then
# shellcheck disable=SC2086
run_sudo pacman -S --needed --noconfirm $build_missing
else
log " build tools: all there"
fi
runtime="ffmpeg xorg-xrandr xdg-utils zenity"
;;
debian)
run_sudo apt-get update
run_sudo apt-get install -y build-essential git curl pkg-config libssl-dev libfontconfig1-dev
runtime="ffmpeg x11-xserver-utils xdg-utils zenity"
;;
fedora)
run_sudo dnf install -y @development-tools git curl pkgconf-pkg-config openssl-devel fontconfig-devel
# Fedora's own ffmpeg build; RPM Fusion's "ffmpeg" has more encoders if you have that repo.
runtime="ffmpeg-free xrandr xdg-utils zenity"
;;
opensuse)
run_sudo zypper install -y -t pattern devel_basis
run_sudo zypper install -y git curl pkg-config libopenssl-devel fontconfig-devel
runtime="ffmpeg xrandr xdg-utils zenity"
;;
*)
log " unrecognized distro family ($DISTRO_ID) — skipping package manager, assuming build tools are present"
runtime=""
;;
esac
# Wayland: native Wayland games reach the engine through the ScreenCast portal and GStreamer's PipeWire plugin
# (gst-launch-1.0 pipewiresrc). Package names checked on Arch only; the others are each distro's usual names.
if [ "$SESSION_TYPE" = wayland ] && [ -n "$runtime" ]; then
case "$DISTRO_FAMILY" in
arch) runtime="$runtime gstreamer gst-plugins-base gst-plugin-pipewire" ;;
debian) runtime="$runtime gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-pipewire" ;;
fedora) runtime="$runtime gstreamer1 gstreamer1-plugins-base pipewire-gstreamer" ;;
opensuse) runtime="$runtime gstreamer-utils gstreamer-plugins-base gstreamer-plugin-pipewire" ;;
esac
fi
if [ -n "$runtime" ]; then
step "Installing the tools Summit runs (a failure here only disables a feature)"
# shellcheck disable=SC2086
case "$DISTRO_FAMILY" in
arch)
runtime="$(pacman -T $runtime 2>/dev/null || true)"
if [ -n "$runtime" ]; then
run_sudo pacman -S --needed --noconfirm $runtime || log " warning: could not install: $runtime"
else
log " all there"
fi
;;
debian) run_sudo apt-get install -y $runtime || log " warning: could not install: $runtime" ;;
fedora) run_sudo dnf install -y $runtime || log " warning: could not install: $runtime" ;;
opensuse) run_sudo zypper install -y $runtime || log " warning: could not install: $runtime" ;;
esac
fi
}
check_runtime_tools() {
missing=""
for t in $RUNTIME_TOOLS; do
command -v "$t" >/dev/null 2>&1 || missing="$missing $t"
done
if [ -n "$missing" ]; then
log " missing :$missing (see 'summit doctor' for what each one is for)"
fi
}
ensure_rust() {
if command -v cargo >/dev/null 2>&1; then
return
fi
step "Rust toolchain not found, installing with rustup"
run sh -c 'curl -fsSL https://sh.rustup.rs | sh -s -- -y'
RUSTUP_ENV="$HOME/.cargo/env"
if [ -r "$RUSTUP_ENV" ]; then
# shellcheck disable=SC1090
. "$RUSTUP_ENV"
fi
# `curl | sh` succeeds when curl fails (sh just reads nothing), so check the result instead.
if [ "$DRY_RUN" -eq 0 ] && ! command -v cargo >/dev/null 2>&1; then
die "rustup did not install cargo (no internet?). Install Rust from https://rustup.rs and run this again"
fi
}
ensure_uv() {
if command -v uv >/dev/null 2>&1; then
return
fi
step "uv (Python package manager) not found, installing"
run sh -c 'curl -fsSL https://astral.sh/uv/install.sh | sh'
if [ -r "$HOME/.local/bin/env" ]; then
# shellcheck disable=SC1090,SC1091
. "$HOME/.local/bin/env"
fi
PATH="$HOME/.local/bin:$PATH"
export PATH
if [ "$DRY_RUN" -eq 0 ] && ! command -v uv >/dev/null 2>&1; then
die "uv did not install (no internet?). Install it from https://docs.astral.sh/uv/ and run this again"
fi
}
# ---------------------------------------------------------------------------
# Install / uninstall
# ---------------------------------------------------------------------------
release_asset_url() {
# Prints a matching release asset URL for this distro family, or nothing.
if ! command -v curl >/dev/null 2>&1; then
return
fi
case "$DISTRO_FAMILY" in
arch) want="*.pkg.tar.zst" ;;
debian) want="*.deb" ;;
*) return ;;
esac
latest_json="$(curl -fsSL "$REPO_API/releases/latest" 2>/dev/null || true)"
[ -n "$latest_json" ] || return
printf '%s' "$latest_json" | grep -o '"browser_download_url":"[^"]*"' \
| sed 's/"browser_download_url":"//; s/"$//' \
| while IFS= read -r url; do
# shellcheck disable=SC2254
case "$url" in
$want) printf '%s\n' "$url"; return ;;
esac
done
}
install_native_package() {
asset_url="$1"
asset_file="/tmp/$(basename "$asset_url")"
step "Downloading release asset: $asset_url"
run curl -fsSL -o "$asset_file" "$asset_url"
case "$DISTRO_FAMILY" in
arch) run_sudo pacman -U --noconfirm "$asset_file" ;;
debian) run_sudo apt-get install -y "$asset_file" ;;
esac
}
# What is installed already: the commit it was built from (written by this script since the Wayland update; older
# installs only have the binaries), or nothing.
VERSION_FILE="$SHARE_DIR/installed-version"
installed_version() {
if [ -f "$VERSION_FILE" ]; then
head -n 1 "$VERSION_FILE"
elif [ -x "$BIN_DIR/summit" ]; then
printf 'unknown (installed before versions were recorded)\n'
fi
}
detect_existing() {
INSTALLED="$(installed_version)"
if [ -n "$INSTALLED" ]; then
log " existing : Summit in $BIN_DIR, version $INSTALLED: this run updates it"
else
log " existing : none in $BIN_DIR"
fi
other="$(command -v summit 2>/dev/null || true)"
if [ -n "$other" ] && [ "$other" != "$BIN_DIR/summit" ]; then
log " note : another summit is on PATH at $other (a different SUMMIT_PREFIX?); it is left alone"
fi
}
build_from_source() {
step "No usable release package found, building from source"
ensure_rust
if [ -n "${SUMMIT_SRC_DIR:-}" ]; then
[ -f "$SRC_DIR/Cargo.toml" ] || die "SUMMIT_SRC_DIR=$SRC_DIR is not a Summit checkout (no Cargo.toml)"
log " building the checkout in SUMMIT_SRC_DIR as it is: $SRC_DIR"
elif [ -d "$SRC_DIR/.git" ]; then
run git -C "$SRC_DIR" fetch --tags
run git -C "$SRC_DIR" checkout main
run git -C "$SRC_DIR" pull --ff-only
else
run mkdir -p "$(dirname "$SRC_DIR")"
run git clone "$REPO_GIT" "$SRC_DIR"
fi
NEW_VERSION="local checkout"
if git -C "$SRC_DIR" rev-parse --git-dir >/dev/null 2>&1; then
NEW_VERSION="$(git -C "$SRC_DIR" log -1 --format='%h (%cs)' 2>/dev/null || echo unknown)"
if [ -n "$(git -C "$SRC_DIR" status --porcelain 2>/dev/null)" ]; then NEW_VERSION="$NEW_VERSION + local changes"; fi
fi
if [ "$DRY_RUN" -eq 0 ] && [ "$FORCE" -eq 0 ] && [ "$INSTALLED" = "$NEW_VERSION" ] && [ "${NEW_VERSION#*local}" = "$NEW_VERSION" ] \
&& [ -x "$BIN_DIR/summit" ] && [ -x "$BIN_DIR/summit-gui" ] && [ -f "$SHARE_DIR/engine/run.py" ]; then
log " Summit $INSTALLED is already the newest: nothing to rebuild (--force rebuilds anyway)"
install_desktop_entry "$SRC_DIR/packaging"
return
fi
if [ -n "$INSTALLED" ]; then
log " updating $INSTALLED -> $NEW_VERSION"
fi
run cargo build --release --manifest-path "$SRC_DIR/Cargo.toml" -p summit -p summit-gui
run_prefix install -Dm755 "$SRC_DIR/target/release/summit" "$BIN_DIR/summit"
run_prefix install -Dm755 "$SRC_DIR/target/release/summit-gui" "$BIN_DIR/summit-gui"
run_prefix mkdir -p "$SHARE_DIR/engine"
# An update replaces the engine's files (so ones removed upstream go too) but keeps its venv and models.
if [ -f "$SHARE_DIR/engine/run.py" ]; then
run_prefix find "$SHARE_DIR/engine" -mindepth 1 -maxdepth 1 ! -name .venv ! -name models -exec rm -rf {} +
fi
run_prefix cp -r "$SRC_DIR/engine/." "$SHARE_DIR/engine/"
install_desktop_entry "$SRC_DIR/packaging"
# The engine's venv is made in there next, without sudo (uv and the Python it downloads live in the user's home),
# so the folder has to belong to the user who runs Summit.
if [ "$(id -u)" -ne 0 ] && ! prefix_writable; then
run_sudo chown -R "$(id -u):$(id -g)" "$SHARE_DIR/engine"
fi
version_tmp="$(mktemp)"
printf '%s\n' "$NEW_VERSION" > "$version_tmp"
run_prefix install -Dm644 "$version_tmp" "$VERSION_FILE"
rm -f "$version_tmp"
}
install_desktop_entry() {
# The app menu entry, pointing at the installed binary by its full path (a custom SUMMIT_PREFIX is often not
# on the menu's PATH).
pkg="$1"
for n in $ICON_SIZES; do
run_prefix install -Dm644 "$pkg/icons/summit-$n.png" "$ICON_BASE/${n}x$n/apps/summit.png"
done
run_prefix install -Dm644 "$pkg/icons/summit.svg" "$ICON_BASE/scalable/apps/summit.svg"
# Only refresh a cache that is already there: a new one would hide icons installed later without a refresh.
if [ -f "$ICON_BASE/icon-theme.cache" ] && command -v gtk-update-icon-cache >/dev/null 2>&1; then
run_prefix gtk-update-icon-cache -q -t -f "$ICON_BASE" || true
fi
desktop_tmp="$(mktemp)"
sed "s|^Exec=summit-gui|Exec=$BIN_DIR/summit-gui|" "$pkg/summit.desktop" > "$desktop_tmp"
run_prefix install -Dm644 "$desktop_tmp" "$APPS_DIR/summit.desktop"
rm -f "$desktop_tmp"
if command -v update-desktop-database >/dev/null 2>&1; then
run_prefix update-desktop-database "$APPS_DIR" || true
fi
refresh_desktop_caches
}
# A desktop that is already running keeps the icon it loaded before (Plasma holds it in memory until it is told),
# so an updated icon would only show after logging out. Tell it now. As the user, on their session bus; a no-op
# where there is no session (ssh, a console) or no KDE.
refresh_desktop_caches() {
[ "$DRY_RUN" -eq 0 ] || return 0
[ "$(id -u)" -ne 0 ] || return 0
run_prefix touch "$ICON_BASE" || true
for k in kbuildsycoca6 kbuildsycoca5; do
if command -v "$k" >/dev/null 2>&1; then "$k" >/dev/null 2>&1 || true; break; fi
done
if [ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v dbus-send >/dev/null 2>&1; then
dbus-send --session --type=signal /KIconLoader org.kde.KIconLoader.iconChanged int32:0 >/dev/null 2>&1 || true
fi
}
fetch_default_model() {
# RIFE's default weights (4.22.lite), so the first Play with Enhance does not stop to download them, and so a
# root-owned engine folder (installed as root) still has them. Other models download on first use.
engine_dir="$1"
model="$engine_dir/models/flownet_v4.22.lite.pkl"
if [ -f "$model" ]; then
return
fi
step "Downloading the default RIFE model (about 20 MB)"
run mkdir -p "$engine_dir/models"
if run curl -fsSL -o "$model.part" "https://github.com/HolyWu/vs-rife/releases/download/model/flownet_v4.22.lite.pkl"; then
run mv "$model.part" "$model"
else
run rm -f "$model.part"
log " warning: download failed; the engine will try again the first time Enhance runs"
fi
}
setup_engine_venv() {
step "Setting up the engine's Python environment (uv, Python 3.12)"
ensure_uv
engine_dir="$SHARE_DIR/engine"
if [ ! -d "$engine_dir" ]; then
engine_dir="$SRC_DIR/engine"
fi
if [ ! -d "$engine_dir" ]; then
log " engine sources not found, skipping venv setup"
return
fi
if "$engine_dir/.venv/bin/python" -c 'import sys; sys.exit(sys.version_info[:2] != (3, 12))' 2>/dev/null; then
log " keeping the existing venv ($engine_dir/.venv); installing what is new or missing in it"
else
run uv venv --clear --python 3.12 "$engine_dir/.venv"
fi
if [ "$GPU_VENDOR" = "nvidia" ]; then
# torch first: requirements.txt only says torch>=2.6, and PyPI's default wheel is built for a newer CUDA than
# many installed drivers support (seen: torch 2.15+cu132 on a driver that stops at CUDA 13.0).
step "NVIDIA GPU detected: installing CUDA 12.8 torch build"
run uv pip install --python "$engine_dir/.venv" torch --index-url https://download.pytorch.org/whl/cu128
else
log " no NVIDIA GPU detected, skipping CUDA torch (engine will run CPU-only or be unavailable)"
fi
run uv pip install --python "$engine_dir/.venv" -r "$engine_dir/requirements.txt"
fetch_default_model "$engine_dir"
}
# chiaki-ng with the frame tap on PATH: its binary carries the tap's shared-memory name.
chiaki_with_tap() {
c="$(command -v chiaki 2>/dev/null || command -v chiaki-ng 2>/dev/null || true)"
[ -n "$c" ] && grep -q 'chiaki-frametap' "$c" 2>/dev/null
}
install_remote_play() {
step "PlayStation Remote Play: chiaki-ng with SmoovPlay's frame tap"
if chiaki_with_tap; then
log " already installed: $(command -v chiaki 2>/dev/null || command -v chiaki-ng)"
return
fi
pkgsrc="$SRC_DIR/packaging/chiaki-ng"
if [ ! -f "$pkgsrc/PKGBUILD" ]; then
log " warning: $pkgsrc is missing (an older checkout?): skipping"
return
fi
case "$DISTRO_FAMILY" in
arch)
if [ "$(id -u)" -eq 0 ]; then
log " warning: makepkg does not run as root: run install.sh --with-remote-play as your own user"
return
fi
# Built in a copy, so makepkg's src/ and pkg/ stay out of the checkout. makepkg -s installs chiaki-ng's build
# dependencies with pacman (it asks for sudo itself); the package replaces a plain chiaki-ng, keeping its consoles.
build="$HOME/.cache/summit/chiaki-ng"
run mkdir -p "$build"
run cp "$pkgsrc/PKGBUILD" "$pkgsrc/apply_patch.py" "$pkgsrc/frametap.c" "$pkgsrc/frametap.h" \
"$pkgsrc/frametap_session.cpp" "$pkgsrc/frametap_session.h" "$build/"
if [ "$ASSUME_YES" -eq 0 ] && [ "$DRY_RUN" -eq 0 ]; then
ask ' build and install chiaki-ng-smoovplay now (about 10 minutes, asks for sudo)?' || { log " skipped"; return; }
fi
if [ "$DRY_RUN" -eq 1 ]; then
log " $ (cd $build && makepkg -si --needed)"
elif [ "$ASSUME_YES" -eq 1 ]; then
( cd "$build" && run makepkg -si --noconfirm --needed ) || log " warning: the chiaki-ng build failed: Remote Play is off (see the output above)"
else
( cd "$build" && run makepkg -si --needed ) || log " warning: the chiaki-ng build failed: Remote Play is off (see the output above)"
fi
;;
*)
log " no package for $DISTRO_FAMILY yet. Build it by hand, with chiaki-ng's build dependencies installed:"
log " git clone --branch v1.10.1 https://github.com/streetpea/chiaki-ng.git ~/src/chiaki-ng"
log " bash $pkgsrc/build_linux.sh ~/src/chiaki-ng ~/src/chiaki-ng-build"
log " install -Dm755 ~/src/chiaki-ng-build/gui/chiaki $SHARE_DIR/chiaki-ng/chiaki"
;;
esac
}
do_install() {
step "Plan"
log " distro family : $DISTRO_FAMILY (ID=$DISTRO_ID)"
log " GPU vendor : $GPU_VENDOR"
log " session type : $SESSION_TYPE"
detect_existing
log " will install : summit, summit-gui into $BIN_DIR"
log " engine : $SHARE_DIR/engine with its own venv"
if [ "$REMOTE_PLAY" -eq 1 ]; then
log " remote play : chiaki-ng with SmoovPlay's frame tap"
fi
if [ "$DRY_RUN" -eq 1 ]; then
log " (--dry-run: no changes will be made)"
fi
if [ "$ASSUME_YES" -eq 0 ] && [ "$DRY_RUN" -eq 0 ]; then
printf '\n'
ask 'Proceed?' || die "aborted"
fi
install_dependencies
asset_url="$(release_asset_url || true)"
if [ -n "$asset_url" ]; then
install_native_package "$asset_url"
else
build_from_source
fi
setup_engine_venv
if [ "$REMOTE_PLAY" -eq 1 ]; then
install_remote_play
fi
step "Done"
log " summit -> $BIN_DIR/summit"
log " summit-gui -> $BIN_DIR/summit-gui"
log " engine -> $SHARE_DIR/engine (venv at $SHARE_DIR/engine/.venv)"
log " app menu -> $APPS_DIR/summit.desktop"
check_runtime_tools
log ""
if [ "$REMOTE_PLAY" -eq 0 ] && ! chiaki_with_tap; then
log " PlayStation Remote Play: run this again with --with-remote-play (builds chiaki-ng with SmoovPlay's frame tap)."
fi
log " Next: 'summit doctor' checks what Enhance needs; 'summit-gui' (or Summit in the app menu) starts the launcher."
}
do_uninstall() {
step "Uninstalling Summit"
run_prefix rm -f "$BIN_DIR/summit" "$BIN_DIR/summit-gui" "$APPS_DIR/summit.desktop" "$ICON_BASE/scalable/apps/summit.svg"
for n in $ICON_SIZES; do run_prefix rm -f "$ICON_BASE/${n}x$n/apps/summit.png"; done
run_prefix rm -rf "$SHARE_DIR"
log "Left in place: $SRC_DIR (build cache), ~/.config/summit, ~/.local/share/summit (your data)"
}
main() {
detect_distro
detect_gpu
detect_session
if [ "$UNINSTALL" -eq 1 ]; then
do_uninstall
else
do_install
fi
}
main "$@"