jan/src-tauri/build-utils/shim-linuxdeploy.sh
D. Rect. a668204cdc refactor: pin linuxdeploy in make/yarn build process instead of github workflow
- pulls fix for #5463 out of the github release workflow and into
  the make/yarn build process
- implements a wrapper script that pins linuxdeploy and injects
  a new location for XDG_CACHE_HOME into the build pipeline,
  allowing manipulating .cache/tauri without tainting the hosts
  .cache
- adds ./.cache (project_root/.cache) to make clean and mise clean
  task
- remove .devcontainer/buildAppImage.sh, obsolete now that extra
  build steps have been removed from the github workflow and
  incorporated in the normal build process
- remove appimagetool from .devcontainer/postCreateCommand.sh,
  as it was only used by .devcontainer/buildAppImage.sh
2025-07-10 04:50:12 +00:00

30 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# wrapper script to pin linuxdeploy version and inject environment variables into the
# build process. While yarn supports injecting environment vairables via env files,
# this applies to all yarn scripts. Using a wrapper allows granular control over
# when environment variables are injected, and avoids tainting the system .cache
# avoid redownloading corepack if possible
export COREPACK_HOME=${COREPACK_HOME:-${XDG_CACHE_HOME:-$HOME/.cache}/node/corepack}
# move cache home to <project root>/.cache
export XDG_CACHE_HOME=${PWD}/.cache
LINUXDEPLOY_VER="1-alpha-20250213-2"
LINUXDEPLOY="$XDG_CACHE_HOME/tauri/linuxdeploy-$LINUXDEPLOY_VER-x86_64.AppImage"
SYMLINK="$XDG_CACHE_HOME/tauri/linuxdeploy-x86_64.AppImage"
mkdir -p "$XDG_CACHE_HOME/tauri"
if [ ! -f "$LINUXDEPLOY" ]; then
GLOB_PATTERN="$XDG_CACHE_HOME/tauri/linuxdeploy-*-x86_64.AppImage"
rm -f $GLOB_PATTERN
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/$LINUXDEPLOY_VER/linuxdeploy-x86_64.AppImage" -O "$LINUXDEPLOY"
chmod a+x "$LINUXDEPLOY"
fi
rm -f "$SYMLINK"
ln -s "$LINUXDEPLOY" "$SYMLINK"
"$@"