#!/usr/bin/env bash # Gera o x-masmatch.pyxapp de X-masmatch (Son Link (Alfonso Saavedra), codigo GPL-3.0-or-later e graficos CC0/dominio publico, GPL-3.0-or-later + CC0) a partir do commit fba654a do repositorio son-link/X-masmatch, # com mudancas nossas (publicadas junto do fonte): # x-masmatch/web.patch sem o botao Exit do menu principal (sair so congela a pagina na web) e quit_key desligada. # O .pyxapp leva game.py, assets.pyxres, main_screen.png, a fonte Retro Pixel Cute Mono (OFL-1.1, que o repositorio traz em docs/) com o texto # da licenca OFL do repositorio TakWolf/retro-pixel-font (commit pinado, sha256), e os dois LICENSE do jogo. # Zip deterministico (Builds/pyxapp.py): dois builds seguidos dao o mesmo sha256. # # src/FredGames.Bundler/Builds/build-x-masmatch.sh # # Saida: artifacts/build/x-masmatch-fba654a/x-masmatch.pyxapp set -euo pipefail COMMIT=fba654a85ed9e789c32e6239d26b2c6339edf573 SHA256=afdbadf09d95079cbb1c3b1cd66ed3dd1b1f5cbe6d0fed879407ccff786ef692 here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" root="$(git -C "$here" rev-parse --show-toplevel 2>/dev/null || pwd)" out="$root/artifacts/build/x-masmatch-fba654a" cache="$root/artifacts/build/cache" mkdir -p "$cache" tarball="$cache/x-masmatch-fba654a.tar.gz" [ -f "$tarball" ] || curl -fsSL "https://github.com/son-link/X-masmatch/archive/$COMMIT.tar.gz" -o "$tarball" echo "$SHA256 $tarball" | shasum -a 256 -c - rm -rf "$out" mkdir -p "$out/tree" "$out/app/x-masmatch" tar -xzf "$tarball" -C "$out/tree" --strip-components 1 patch -d "$out/tree" -p1 < "$here/x-masmatch/web.patch" cp "$out/tree/game.py" "$out/tree/assets.pyxres" "$out/tree/main_screen.png" "$out/tree/LICENSE-GPL3" "$out/tree/LICENSE-CC0" "$out/app/x-masmatch/" cp "$out/tree/docs/retro-pixel-cute-mono.bdf" "$out/app/x-masmatch/" ofl="$cache/retro-pixel-font-LICENSE-OFL" [ -f "$ofl" ] || curl -fsSL "https://raw.githubusercontent.com/TakWolf/retro-pixel-font/2c91d69c13a21fcdb2ea759ab1891419a1216a79/LICENSE-OFL" -o "$ofl" echo "fef832d4651226c082ff6164463662e8e97b674396d276bd4a1db1e3e8f70f01 $ofl" | shasum -a 256 -c - cp "$ofl" "$out/app/x-masmatch/LICENSE-FONT-OFL" python3 -I "$here/pyxapp.py" "$out/app/x-masmatch" game.py "$out/x-masmatch.pyxapp" shasum -a 256 "$out/x-masmatch.pyxapp"