Files
gridcraft/packaging/linux/nightly-launch.sh
T
skylartaylor f59fdf3e84 Linux nightlies: start every format through the flavor's launch profile
Dylan's ports keep the nightly identities but start the GUI directly, and a nightly build
refuses to start without --launch-profile nightly-v1 --profile-root <dir>. Ship the launcher
every Linux nightly format needs, so an installed, extracted or sandboxed nightly never runs
against the stable profile (his remaining re-review items close with it).

- deb/rpm: usr/bin/gridcraft-nightly is a launcher; the GUI moves to
  usr/lib/gridcraft-nightly/gridcraft, which nfpm.yaml carries with mode 0755. A stable stage
  has no such file, so the three-line entry is dropped and the rendered stable nfpm.yaml stays
  byte-identical to his head.
- AppImage: AppRun is a script, not the usr/bin/gridcraft symlink, and usr/bin/gridcraft-nightly
  is installed beside it; the desktop Exec/TryExec name the launcher.
- Arch handoff: nightly-arch-launch.sh passes the profile tokens instead of relocating the four
  XDG folders (the profile holds settings, logs, the control token and the session record).
- Flatpak: bin/gridcraft-nightly is installed and is the manifest's command: and the desktop
  entry's Exec/TryExec. profile_root now accepts that package's own id
  (ai.storyteller.gridcraft.nightly) and still refuses the stable id and every other one.
- plain tarballs: bin/gridcraft-nightly in package.sh's tree and gridcraft-nightly in the flat
  nightly.sh archive, which nightly-archive.py now requires.

The profile root is ${XDG_DATA_HOME:-$HOME/.local/share}/gridcraft-nightly/profile in every
format; it sits beside, never inside, the stable rows.

Also from the re-review: the nightly metainfo no longer lists mediatypes and names the launcher
as its binary, the nightly desktop file and metainfo are validated now that the tools are
present, and nightly-common.sh passes GRIDCRAFT_VERSION on the build command as well as
inheriting it and checks the exact identity the binary prints (with the output in the message).
packaging/linux/nightly-linux-launch-tests.py runs the launcher in both moved-tree layouts and
stages deb, tar and AppImage with stub nfpm/appimagetool/strip, so the wrappers are tested
without cargo; nightly-arch-tar-test.sh asserts the launcher argv.

Builds on dylanmtaylor's co-installable Linux packages (#4733, @dylanmtaylor).

skylartaylor <skylartaylor@users.noreply.github.com>
2026-11-24 23:19:36 +01:00

25 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
# GridCraft Nightly launcher for a moved tree: an AppImage (AppRun and usr/bin), the plain nightly
# tar, or a distro tarball's usr/bin. The launch profile is the only data root a nightly build
# accepts, so this is what keeps a Nightly run out of the stable app's settings, prefs and logs.
set -eu
here="$(cd "$(dirname "$0")" && pwd)"
real="$here/usr/bin/gridcraft"
[ -x "$real" ] || real="$here/gridcraft"
if [ ! -x "$real" ]; then
echo "gridcraft-nightly: no GridCraft binary beside $0" >&2
exit 2
fi
if [ -z "${XDG_DATA_HOME:-}" ] && [ -z "${HOME:-}" ]; then
echo "gridcraft-nightly: XDG_DATA_HOME and HOME are both unset, so there is no Nightly data folder" >&2
exit 2
fi
# A bare version query and the Launcher's own protocol pass straight through.
case "${1-}" in
--launch-profile | --profile-root) exec "$real" "$@" ;;
esac
if [ "$#" -eq 1 ] && { [ "${1-}" = "--version" ] || [ "${1-}" = "-V" ]; }; then
exec "$real" "$@"
fi
exec "$real" --launch-profile nightly-v1 --profile-root "${XDG_DATA_HOME:-$HOME/.local/share}/gridcraft-nightly/profile" -- "$@"