Packages no longer carry Stockfish (about 14 MB instead of 95): the first analysis without an engine offers to download the official Stockfish 19 "universal" build from GitHub (pinned per platform with its SHA-256, checked before use, unpacked into the user's local data directory, test-started), then starts the analysis the user asked for. Settings -> Engines: download with progress and cancel, "file not found" with download again, removal with confirmation; "Choose engine file…" for any other engine. A system stockfish is offered first when there is one. ChessPenguin's Stockfish = bundled (Flatpak) or downloaded. macOS: release job and CI job on macos-14 build ChessPenguin.app (icon, Info.plist, ad-hoc signature) in a .dmg; Homebrew paths for a system stockfish. Not signed by Apple yet. Decisions 14-15; design docs/design/engine-download.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.6 KiB
Bash
Executable file
38 lines
1.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Builds ChessPenguin-<version>-x86_64.AppImage from target/release/chesspenguin (the
|
|
# program downloads Stockfish on request).
|
|
# Usage (repository root): VERSION=0.1.0 packaging/build-appimage.sh dist/
|
|
set -euo pipefail
|
|
|
|
app_id="io.github.vrubelroman.chessPenguin"
|
|
out_dir="${1:-dist}"
|
|
version="${VERSION:?set VERSION}"
|
|
work="$(mktemp -d)"
|
|
trap 'rm -rf "${work}"' EXIT
|
|
|
|
curl -fsSL -o "${work}/linuxdeploy" \
|
|
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
curl -fsSL -o "${work}/appimagetool" \
|
|
https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
|
|
chmod +x "${work}/linuxdeploy" "${work}/appimagetool"
|
|
|
|
appdir="${work}/AppDir"
|
|
install -Dm755 target/release/chesspenguin "${appdir}/usr/bin/chesspenguin"
|
|
# AppStream metadata is left out: appimagetool validates its screenshot URLs over the network.
|
|
for size in 16 24 32 48 64 128 256 512; do
|
|
install -Dm644 "packaging/icons/hicolor/${size}x${size}/apps/${app_id}.png" \
|
|
"${appdir}/usr/share/icons/hicolor/${size}x${size}/apps/${app_id}.png"
|
|
done
|
|
|
|
# 1. linuxdeploy fills the AppDir (dependencies, AppRun, desktop entry, icon).
|
|
APPIMAGE_EXTRACT_AND_RUN=1 "${work}/linuxdeploy" \
|
|
--appdir "${appdir}" \
|
|
--desktop-file "packaging/${app_id}.desktop" \
|
|
--icon-file "packaging/icons/hicolor/256x256/apps/${app_id}.png"
|
|
|
|
# 2. appimagetool packs the AppDir as is.
|
|
mkdir -p "${out_dir}"
|
|
output="${out_dir}/ChessPenguin-${version}-x86_64.AppImage"
|
|
ARCH=x86_64 VERSION="${version}" APPIMAGE_EXTRACT_AND_RUN=1 \
|
|
"${work}/appimagetool" --no-appstream "${appdir}" "${output}"
|
|
echo "Built ${output}"
|