Stockfish on request instead of bundled; macOS (Apple Silicon) builds
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

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>
This commit is contained in:
vrubelroman 2026-10-19 09:33:37 +03:00
parent 99264f3d24
commit 50eb5e6623
24 changed files with 2473 additions and 85 deletions

View file

@ -3,12 +3,13 @@ pkgname=chesspenguin-bin
_appid=io.github.vrubelroman.chessPenguin
pkgver=0.5.0
pkgrel=1
pkgdesc="Chess database: view, enter and analyse PGN games; Stockfish included"
pkgdesc="Chess database: view, enter and analyse PGN and ChessBase games; Stockfish on request"
arch=('x86_64')
url="https://github.com/vrubelroman/chessPenguin"
license=('GPL-3.0-or-later' 'GPL-3.0-only')
depends=('glibc' 'gcc-libs' 'alsa-lib' 'libxkbcommon' 'dbus' 'hicolor-icon-theme')
optdepends=('vulkan-icd-loader: GPU rendering via Vulkan')
optdepends=('vulkan-icd-loader: GPU rendering via Vulkan'
'stockfish: chess engine from the AUR (otherwise the program offers to download it)')
provides=('chesspenguin')
conflicts=('chesspenguin')
options=('!debug')
@ -18,10 +19,6 @@ sha256sums=('17334d0050b1726f21c70b8a5441578b875d7ff42433065d15afb8c17341d066')
package() {
cd "ChessPenguin-${pkgver}-linux-x86_64"
install -Dm755 chesspenguin "${pkgdir}/usr/bin/chesspenguin"
# Bundled Stockfish (GPL-3.0); the application looks for it in ../lib/chesspenguin.
install -Dm755 stockfish/stockfish "${pkgdir}/usr/lib/chesspenguin/stockfish"
install -Dm644 stockfish/Copying.txt "${pkgdir}/usr/share/licenses/${pkgname}/stockfish-Copying.txt"
install -Dm644 stockfish/AUTHORS "${pkgdir}/usr/share/doc/${pkgname}/stockfish-AUTHORS"
install -Dm644 "${_appid}.desktop" "${pkgdir}/usr/share/applications/${_appid}.desktop"
for size in 16 24 32 48 64 128 256 512; do
install -Dm644 "icons/hicolor/${size}x${size}/apps/${_appid}.png" \

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Builds ChessPenguin-<version>-x86_64.AppImage from target/release/chesspenguin and the
# Stockfish fetched by `packaging/stockfish.sh linux build/stockfish`.
# 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
@ -30,12 +30,7 @@ APPIMAGE_EXTRACT_AND_RUN=1 "${work}/linuxdeploy" \
--desktop-file "packaging/${app_id}.desktop" \
--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.
# 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 \

76
packaging/macos/build-app.sh Executable file
View file

@ -0,0 +1,76 @@
#!/usr/bin/env bash
# Builds ChessPenguin.app and ChessPenguin-<version>-macos-arm64.dmg from
# target/release/chesspenguin on macOS (decision 15). The app is signed ad hoc only:
# Apple Silicon refuses unsigned code, and a Developer ID signature with notarization
# needs an Apple developer account. The first start goes through "Open" in the context
# menu (or System Settings -> Privacy & Security -> Open Anyway).
# Usage (repository root): VERSION=0.6.0 packaging/macos/build-app.sh dist/
set -euo pipefail
out_dir="${1:?usage: $0 OUT_DIR}"
version="${VERSION:?set VERSION}"
app_id="io.github.vrubelroman.chessPenguin"
work="$(mktemp -d)"
trap 'rm -rf "${work}"' EXIT
app="${work}/ChessPenguin.app"
mkdir -p "${app}/Contents/MacOS" "${app}/Contents/Resources"
install -m755 target/release/chesspenguin "${app}/Contents/MacOS/ChessPenguin"
cp LICENSE THIRD_PARTY_NOTICES.md "${app}/Contents/Resources/"
cp -r examples "${app}/Contents/Resources/"
# Icon: an .iconset from the PNGs (iconutil wants these exact names).
iconset="${work}/ChessPenguin.iconset"
mkdir -p "${iconset}"
icon() { cp "packaging/icons/hicolor/$1x$1/apps/${app_id}.png" "${iconset}/$2"; }
icon 16 icon_16x16.png
icon 32 icon_16x16@2x.png
icon 32 icon_32x32.png
icon 64 icon_32x32@2x.png
icon 128 icon_128x128.png
icon 256 icon_128x128@2x.png
icon 256 icon_256x256.png
icon 512 icon_256x256@2x.png
icon 512 icon_512x512.png
iconutil -c icns -o "${app}/Contents/Resources/ChessPenguin.icns" "${iconset}"
cat > "${app}/Contents/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key><string>ChessPenguin</string>
<key>CFBundleDisplayName</key><string>ChessPenguin</string>
<key>CFBundleIdentifier</key><string>${app_id}</string>
<key>CFBundleVersion</key><string>${version}</string>
<key>CFBundleShortVersionString</key><string>${version}</string>
<key>CFBundleExecutable</key><string>ChessPenguin</string>
<key>CFBundleIconFile</key><string>ChessPenguin</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>LSMinimumSystemVersion</key><string>11.0</string>
<key>NSHighResolutionCapable</key><true/>
<key>LSApplicationCategoryType</key><string>public.app-category.board-games</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key><string>Chess games</string>
<key>CFBundleTypeRole</key><string>Viewer</string>
<key>CFBundleTypeExtensions</key>
<array><string>pgn</string><string>cbh</string><string>cbv</string></array>
</dict>
</array>
</dict>
</plist>
EOF
codesign --force --deep --sign - "${app}"
# Disk image with the app and a link to /Applications.
staging="${work}/dmg"
mkdir -p "${staging}"
cp -R "${app}" "${staging}/"
ln -s /Applications "${staging}/Applications"
mkdir -p "${out_dir}"
output="${out_dir}/ChessPenguin-${version}-macos-arm64.dmg"
hdiutil create -volname "ChessPenguin ${version}" -srcfolder "${staging}" -ov -format UDZO "${output}"
echo "Built ${output}"

View file

@ -1,5 +1,4 @@
# deb, rpm and Arch packages (https://nfpm.goreleaser.com). Run from the repository root:
# packaging/stockfish.sh linux build/stockfish
# VERSION=0.1.0 nfpm package -f packaging/nfpm.yaml -p deb -t dist/ (deb, rpm, archlinux)
name: chesspenguin
arch: amd64
@ -14,8 +13,9 @@ license: GPL-3.0-or-later
description: |
Chess database for Linux.
View, enter and analyse chess games in PGN: variations, comments,
multi-line engine analysis and whole-game review. Stockfish is included;
any other UCI engine can be added.
multi-line engine analysis and whole-game review. The official Stockfish
is downloaded on request (or a system stockfish is used); any other UCI
engine can be added.
contents:
- src: target/release/chesspenguin
@ -49,15 +49,6 @@ contents:
dst: /usr/share/doc/chesspenguin/THIRD_PARTY_NOTICES.md
- src: examples/classics.pgn
dst: /usr/share/doc/chesspenguin/examples/classics.pgn
# Bundled Stockfish (GPL-3.0); the application looks for it in ../lib/chesspenguin.
- src: build/stockfish/stockfish
dst: /usr/lib/chesspenguin/stockfish
file_info:
mode: 0755
- src: build/stockfish/Copying.txt
dst: /usr/share/licenses/chesspenguin/stockfish-Copying.txt
- src: build/stockfish/AUTHORS
dst: /usr/share/doc/chesspenguin/stockfish-AUTHORS
overrides:
deb:
@ -69,6 +60,8 @@ overrides:
recommends:
- libvulkan1
- libegl1
suggests:
- stockfish
rpm:
depends:
- alsa-lib
@ -77,6 +70,8 @@ overrides:
recommends:
- vulkan-loader
- mesa-libEGL
suggests:
- stockfish
archlinux:
depends:
- glibc
@ -85,3 +80,5 @@ overrides:
- libxkbcommon
- dbus
- hicolor-icon-theme
suggests:
- stockfish