#!/usr/bin/env bash # Gera o seahorse-adventures.pgapp do Seahorse Adventures (entrada da PyWeek 4 da equipe The Olde Battleaxe, 2007; # bifurcacao de dulsi, GPL-2.0; pgu e os temas LGPL-2.1) a partir do commit 6ef1a49, com o patch # seahorse-adventures/web.patch: lacos assincronos (pgu/engine e timer esperam com asyncio), sem tela cheia, QUIT volta # ao menu, sem o endereco do site na tela, titulo da janela sem a marca. Fora do pacote: README, arquivos de empacotamento, # icones, editores de fase, os trofeus do Gamerzilla (servico online) e o about.gif sem uso. Dois arquivos trocados: # - data/title.png: o logotipo original dizia "Barbie" (marca da Mattel); so o "SEAHORSE ADVENTURES" fica, sem o # desenho da primeira palavra (seahorse-adventures/title.png); # - a fonte 04B_20 (Yuji Oshimo, sem texto de licenca) vira a Silkscreen (OFL 1.1, google/fonts) com a OFL junto. # Zip deterministico (Builds/pgapp.py). # # src/FredGames.Bundler/Builds/build-seahorse-adventures.sh # # Saida: artifacts/build/seahorse-adventures-6ef1a49/seahorse-adventures.pgapp set -euo pipefail COMMIT=6ef1a494f158e8e5e5f76e7b222c23f0a1690672 SHA256=89bb8b844a39065775d1e1b6aaafb46104e98587cc4395368498c00046251792 FONTS_COMMIT=2eb0b48d5f760f62e286216f0859a8c540dbc1bd FONT_SHA256=c845473330b94c2079ce9af01c51ac8ba2d99c24f4d14c039843bbb8e642ebd8 OFL_SHA256=86c5e9c9382cdcc5948704fdfe60f2aa164a719746931219a42736ecd9cefbd3 here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" root="$(git -C "$here" rev-parse --show-toplevel 2>/dev/null || pwd)" out="$root/artifacts/build/seahorse-adventures-6ef1a49" cache="$root/artifacts/build/cache" mkdir -p "$cache" fetch() { [ -f "$cache/$1" ] || curl -fsSL "$2" -o "$cache/$1"; echo "$3 $cache/$1" | shasum -a 256 -c -; } fetch seahorse-adventures-6ef1a49.tar.gz "https://github.com/dulsi/seahorse-adventures/archive/$COMMIT.tar.gz" "$SHA256" fetch silkscreen-Regular.ttf "https://raw.githubusercontent.com/google/fonts/$FONTS_COMMIT/ofl/silkscreen/Silkscreen-Regular.ttf" "$FONT_SHA256" fetch silkscreen-OFL-2eb0b48.txt "https://raw.githubusercontent.com/google/fonts/$FONTS_COMMIT/ofl/silkscreen/OFL.txt" "$OFL_SHA256" rm -rf "$out" mkdir -p "$out/tree" tar -xzf "$cache/seahorse-adventures-6ef1a49.tar.gz" -C "$out/tree" --strip-components 1 cd "$out/tree" rm -rf README.txt NOTES.txt TODO.txt LEVELS.txt CHANGES.txt create-upload.py icon.icns icon.ico icon128.png icon32.png icon64.png \ leveledit-sample.ini leveledit.py tileedit-sample.ini tileedit.py seahorse-adventures.desktop \ seahorse-adventures.metainfo.xml setup.py run_game.py data/gamerzilla data/fonts/about.gif data/fonts/04B_20__.TTF patch -p1 < "$here/seahorse-adventures/web.patch" cp "$here/seahorse-adventures/title.png" data/title.png cp "$cache/silkscreen-Regular.ttf" data/fonts/Silkscreen-Regular.ttf cp "$cache/silkscreen-OFL-2eb0b48.txt" data/fonts/Silkscreen-OFL.txt find . -name __pycache__ -prune -exec rm -rf {} \; python3 -I "$here/pgapp.py" "$out/tree" "$out/seahorse-adventures.pgapp" shasum -a 256 "$out/seahorse-adventures.pgapp"