#!/usr/bin/env bash # Gera o Main.swf do Alien Egg Farm (Andras Nemeth, MIT, github.com/cu2/Alien-Egg-Farm, commit dd5fc4e) com a # fonte trocada: o Flixel 2.35 embute a "Nokia Cellphone FC" (freeware, sem licenca de redistribuicao); o # alien-egg-farm/patch-font.py reescreve essa tag com a Silkscreen (OFL 1.1) e deixa o resto do SWF como o autor # publicou (sem recompilar). # # src/FredGames.Bundler/Builds/build-alien-egg-farm.sh # # Saida: artifacts/build/alien-egg-farm-dd5fc4e/{alien-egg-farm.swf,Silkscreen-OFL.txt,flixel-license.txt} set -euo pipefail COMMIT=dd5fc4e29fe4ac43c5e4fc420287c5873bab985b SWF_SHA256=db71453a4a1f22e43ba5a9bf2ed98aba1b4ed10c50705f9756d9c6b0dfa61f52 GFONTS=8c3ea249848f15b7ff6092b3e16d44ef91771cad TTF_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/alien-egg-farm-${COMMIT:0:7}" cache="$root/artifacts/build/cache" py="$root/artifacts/tools/venv/bin/python" mkdir -p "$cache" "$out" fetch() { if [ ! -f "$cache/$2" ]; then curl -fsSL --retry 4 "$1" -o "$cache/$2.partial" && mv "$cache/$2.partial" "$cache/$2" fi echo "$3 $cache/$2" | shasum -a 256 -c - } fetch "https://raw.githubusercontent.com/cu2/Alien-Egg-Farm/$COMMIT/Main.swf" aef-Main.swf "$SWF_SHA256" fetch "https://raw.githubusercontent.com/google/fonts/$GFONTS/ofl/silkscreen/Silkscreen-Regular.ttf" silkscreen-Regular.ttf "$TTF_SHA256" fetch "https://raw.githubusercontent.com/google/fonts/$GFONTS/ofl/silkscreen/OFL.txt" silkscreen-OFL.txt "$OFL_SHA256" "$py" -I "$here/alien-egg-farm/patch-font.py" "$cache/aef-Main.swf" "$cache/silkscreen-Regular.ttf" "$out/alien-egg-farm.swf" shasum -a 256 "$out/alien-egg-farm.swf"