* Release under the SolidCraft name: binaries, assets and installers The desktop binary is now `solidcraft` and the CLI `solidcraft-cli` (the two app packages are renamed; their folders move with the rest of the rename later). Every release asset is named solidcraft-<ver>-… / SolidCraft-<ver>-windows-x64.exe, and the installers show the SolidCraft product name. Kept so existing installs keep updating (docs/compatibility.md): - `solvecraft-cli` alias binary in every package, forwarding to solidcraft-cli with a deprecation note on stderr (tests/legacy_alias.rs). - Linux app ID ai.storyteller.solvecraft (Flatpak ID, desktop entry, Wayland app_id). - MSI UpgradeCode, so the MSI upgrades in place. - deb Replaces/Conflicts/Provides and rpm Obsoletes/Provides solvecraft. - An old-named .zsync copy so earlier AppImages find updates; a legacy .flatpakrepo copy. - .solvecraft file associations; SOLVECRAFT_* fallbacks in the packaging scripts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT * MSI: register the legacy .solvecraft extension without a duplicate open verb Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
75 lines
3.3 KiB
Bash
Executable File
75 lines
3.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Repackage a SolidCraft Linux tarball as a single-file Flatpak bundle:
|
|
#
|
|
# $DIST/solidcraft-<version>-linux-<arch>.flatpak
|
|
#
|
|
# Usage: packaging/linux/flatpak-bundle.sh [--no-test] [TARBALL]
|
|
#
|
|
# TARBALL defaults to $DIST/solidcraft-<version>-linux-<arch>.tar.gz from package.sh. The bundle
|
|
# is built for the host architecture (x86_64 or aarch64), which must match the tarball's.
|
|
# Needs flatpak, flatpak-builder and the SVG pixbuf loader (librsvg2-common) for the host's
|
|
# `appstreamcli compose`; the freedesktop runtime and SDK named in the manifest are
|
|
# installed per-user from Flathub. Unless --no-test, the bundle is installed per-user, the CLI
|
|
# is checked, and the desktop creates/measures a box on headless X11 and Wayland. The desktop
|
|
# check also needs python3, dbus-x11, xvfb, xauth and weston; no screenshots are produced.
|
|
# Manifest: packaging/linux/flatpak/ai.storyteller.solvecraft.bundle.yml.
|
|
# Adapted from PhotoCraft's (storytold/photocraft, Apache-2.0; see ATTRIBUTION.md).
|
|
set -euo pipefail
|
|
# shellcheck source=../env.sh
|
|
. "$(dirname "${BASH_SOURCE[0]}")/../env.sh"
|
|
HERE="$ROOT/packaging/linux"
|
|
FLATHUB=https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
|
|
TEST=1
|
|
TARBALL=""
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
--no-test) TEST=0; shift ;;
|
|
-h | --help) sed -n '2,14p' "$0"; exit 0 ;;
|
|
-*) echo "unknown argument: $1" >&2; exit 2 ;;
|
|
*) TARBALL="$1"; shift ;;
|
|
esac
|
|
done
|
|
|
|
ARCH="$(uname -m)"
|
|
case "$ARCH" in
|
|
x86_64) ;;
|
|
aarch64 | arm64) ARCH=aarch64 ;;
|
|
*) echo "unsupported architecture $ARCH" >&2; exit 2 ;;
|
|
esac
|
|
BASENAME="solidcraft-$VERSION-linux-$ARCH"
|
|
TARBALL="${TARBALL:-$DIST/$BASENAME.tar.gz}"
|
|
[ -f "$TARBALL" ] || { echo "error: $TARBALL not found (run packaging/linux/package.sh --formats tar first)" >&2; exit 1; }
|
|
for tool in flatpak flatpak-builder; do
|
|
command -v "$tool" >/dev/null || { echo "error: $tool not found (apt install flatpak flatpak-builder librsvg2-common)" >&2; exit 1; }
|
|
done
|
|
|
|
echo "==> SolidCraft $VERSION Flatpak bundle for $ARCH from $(basename "$TARBALL")"
|
|
|
|
WORK="$CARGO_TARGET_DIR/flatpak-bundle"
|
|
rm -rf "$WORK"
|
|
mkdir -p "$WORK/stage"
|
|
tar -xzf "$TARBALL" -C "$WORK/stage" --strip-components=1
|
|
[ -x "$WORK/stage/bin/solidcraft" ] || { echo "error: $TARBALL has no bin/solidcraft" >&2; exit 1; }
|
|
cp "$HERE/flatpak/$APP_ID.bundle.yml" "$WORK/$APP_ID.yml"
|
|
|
|
flatpak remote-add --user --if-not-exists flathub "$FLATHUB"
|
|
# --disable-rofiles-fuse: no FUSE in containers and CI runners.
|
|
flatpak-builder --user --install-deps-from=flathub --disable-rofiles-fuse --force-clean \
|
|
--default-branch=stable --repo="$WORK/repo" --state-dir="$WORK/state" "$WORK/build" "$WORK/$APP_ID.yml"
|
|
|
|
OUT="$DIST/$BASENAME.flatpak"
|
|
# --runtime-repo lets `flatpak install` fetch the freedesktop runtime from Flathub if missing.
|
|
flatpak build-bundle --runtime-repo="$FLATHUB" "$WORK/repo" "$OUT" "$APP_ID" stable
|
|
echo "wrote $OUT"
|
|
|
|
if [ "$TEST" = 1 ]; then
|
|
flatpak install --user -y --noninteractive --reinstall "$OUT"
|
|
flatpak info --user "$APP_ID"
|
|
flatpak run --command=solidcraft-cli "$APP_ID" --version
|
|
flatpak run --command=sh "$APP_ID" -c 'ls /app/share/applications /app/share/metainfo /app/share/mime/packages /app/share/icons/hicolor/256x256/apps /app/share/doc/solidcraft'
|
|
python3 "$HERE/flatpak-smoke.py" --backend both
|
|
fi
|
|
echo "==> done"
|
|
ls -lh "$OUT"
|