From 8ca5a1fddad2d8aca3b495c6b83c4d859e487976 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Mon, 9 Nov 2026 19:45:17 +0000 Subject: [PATCH] Add a per-user Linux app installer script scripts/install-linux-app.sh installs a release archive into ~/.local/share/pipelines-app (writable, so in-app updates can swap it), with a ~/.local/bin launcher, icon and desktop entry, and checks for missing system libraries first. --- scripts/install-linux-app.sh | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 scripts/install-linux-app.sh diff --git a/scripts/install-linux-app.sh b/scripts/install-linux-app.sh new file mode 100755 index 00000000..ca92c5e4 --- /dev/null +++ b/scripts/install-linux-app.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Installs the Pipelines Linux desktop app for the current user from a release +# archive (pipelines-linux-x64-*.tar.gz from the update feed or the build cache): +# scripts/install-linux-app.sh [icon.png] +# The app lives in ~/.local/share/pipelines-app (writable, so in-app updates +# can swap it), with a launcher in ~/.local/bin and a desktop entry. An existing +# install is kept as pipelines-app.previous. +set -eu +archive=$1 +icon=${2:-} +data=${XDG_DATA_HOME:-$HOME/.local/share} +target=$data/pipelines-app +staging=$data/.pipelines-app-install.$$ +trap 'rm -rf "$staging"' EXIT +mkdir -p "$staging" +tar -xzf "$archive" -C "$staging" +bundle=$(dirname "$(find "$staging" -maxdepth 3 -type f -name pipelines-app | head -n 1)") +[ -x "$bundle/pipelines-app" ] && [ -d "$bundle/data/flutter_assets" ] && [ -d "$bundle/lib" ] || { + echo "The archive has no complete pipelines-app bundle." >&2; exit 1; } +missing=$(ldd "$bundle/pipelines-app" | grep "not found" || true) +[ -z "$missing" ] || { echo "Missing system libraries:" >&2; echo "$missing" >&2; exit 1; } +rm -rf "$target.previous" +[ -d "$target" ] && mv "$target" "$target.previous" +mv "$bundle" "$target" +mkdir -p "$HOME/.local/bin" "$data/applications" +ln -sf "$target/pipelines-app" "$HOME/.local/bin/pipelines-app" +if [ -n "$icon" ]; then + mkdir -p "$data/icons/hicolor/512x512/apps" + cp "$icon" "$data/icons/hicolor/512x512/apps/pipelines-app.png" +fi +cat > "$data/applications/pipelines-app.desktop" </dev/null 2>&1 && update-desktop-database "$data/applications" >/dev/null 2>&1 || true +echo "Installed $(cat "$target/version.txt" 2>/dev/null || echo Pipelines) at $target"