Bundle Stockfish 19 with every package and set it up on first start
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run

- packaging/stockfish.sh fetches the pinned official universal build (SHA-256
  checked) for Linux and Windows and the source archive for the release.
- deb/rpm/Arch, AppImage, Flatpak, tarball and Windows zip ship it unmodified
  (AppImage: added after linuxdeploy, packed with appimagetool).
- The app resolves the built-in engine at run time (EngineConfig::builtin),
  adds it on first start (or a system stockfish), and offers engines found on
  the computer in Settings > Engines.
- install.sh installs Stockfish into ~/.local/lib/chesspenguin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubel 2026-10-18 11:53:30 +03:00
parent 6db8d67821
commit 56cfb4d09f
22 changed files with 383 additions and 35 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Builds ChessPenguin-<version>-x86_64.AppImage from target/release/chesspenguin.
# Builds ChessPenguin-<version>-x86_64.AppImage from target/release/chesspenguin and the
# Stockfish fetched by `packaging/stockfish.sh linux build/stockfish`.
# Usage (repository root): VERSION=0.1.0 packaging/build-appimage.sh dist/
set -euo pipefail
@ -11,7 +12,9 @@ trap 'rm -rf "${work}"' EXIT
curl -fsSL -o "${work}/linuxdeploy" \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x "${work}/linuxdeploy"
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"
@ -21,12 +24,20 @@ for size in 16 24 32 48 64 128 256 512; do
"${appdir}/usr/share/icons/hicolor/${size}x${size}/apps/${app_id}.png"
done
mkdir -p "${out_dir}"
export LINUXDEPLOY_OUTPUT_VERSION="${version}"
export OUTPUT="${out_dir}/ChessPenguin-${version}-x86_64.AppImage"
# 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" \
--output appimage
echo "Built ${OUTPUT}"
--icon-file "packaging/icons/hicolor/256x256/apps/${app_id}.png"
# 2. Stockfish is added afterwards: linuxdeploy would rewrite its RUNPATH, and the bundled
# engine must stay the unmodified official binary.
install -Dm755 build/stockfish/stockfish "${appdir}/usr/lib/chesspenguin/stockfish"
install -Dm644 build/stockfish/Copying.txt "${appdir}/usr/share/licenses/chesspenguin/stockfish-Copying.txt"
# 3. 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}"