POSIX sh one-liner installer that detects distro/GPU/session, builds from source with cargo, and sets up the engine's uv venv (CUDA torch only with an NVIDIA GPU). Plus packaging/arch/PKGBUILD, packaging/deb (built and verified locally), and an untested packaging/appimage recipe.
49 lines
1.8 KiB
Bash
Executable File
49 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
# Build a Summit AppImage. Untested here: no network access to download
|
|
# linuxdeploy/appimagetool in this environment. Needs linuxdeploy and
|
|
# appimagetool on PATH (https://github.com/linuxdeploy/linuxdeploy,
|
|
# https://github.com/AppImage/appimagetool), or set LINUXDEPLOY /
|
|
# APPIMAGETOOL to their paths.
|
|
#
|
|
# Usage: packaging/appimage/build.sh [output-dir]
|
|
#
|
|
# The engine's Python venv is not bundled (it is GPU-specific and far too
|
|
# large for an AppImage); summit-gui still runs, but `summit enhance` needs
|
|
# install.sh's venv setup done separately.
|
|
|
|
set -eu
|
|
|
|
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
OUT_DIR="${1:-$REPO_ROOT/target/appimage}"
|
|
LINUXDEPLOY="${LINUXDEPLOY:-linuxdeploy}"
|
|
APPIMAGETOOL="${APPIMAGETOOL:-appimagetool}"
|
|
APPDIR="$REPO_ROOT/target/appimage/Summit.AppDir"
|
|
|
|
command -v "$LINUXDEPLOY" >/dev/null 2>&1 || { echo "linuxdeploy not found, set LINUXDEPLOY=/path/to/it" >&2; exit 1; }
|
|
command -v "$APPIMAGETOOL" >/dev/null 2>&1 || { echo "appimagetool not found, set APPIMAGETOOL=/path/to/it" >&2; exit 1; }
|
|
|
|
cd "$REPO_ROOT"
|
|
|
|
if [ ! -x target/release/summit-gui ]; then
|
|
echo "building release binaries..." >&2
|
|
cargo build --release -p summit -p summit-gui
|
|
fi
|
|
|
|
rm -rf "$APPDIR"
|
|
mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/share/summit/engine"
|
|
cp target/release/summit "$APPDIR/usr/bin/"
|
|
cp target/release/summit-gui "$APPDIR/usr/bin/"
|
|
cp -r engine/. "$APPDIR/usr/share/summit/engine/"
|
|
find "$APPDIR/usr/share/summit/engine" -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true
|
|
|
|
mkdir -p "$OUT_DIR"
|
|
"$LINUXDEPLOY" \
|
|
--appdir "$APPDIR" \
|
|
--executable "$APPDIR/usr/bin/summit-gui" \
|
|
--desktop-file packaging/summit.desktop \
|
|
--icon-file packaging/icons/summit.png \
|
|
--output appimage
|
|
|
|
mv ./Summit*.AppImage "$OUT_DIR/" 2>/dev/null || true
|
|
echo "built AppImage in: $OUT_DIR"
|