#!/usr/bin/env bash # Reproducible Metal-only release template used by the particle exit checks. # Does not replace Godot's installed templates. Pass the resulting executable # to build-macos-client.sh using MT_MAC_ENGINE and the matching MT_MAC_ARCHES. set -euo pipefail cd "$(dirname "$0")/.." repo_dir="$PWD" source_dir="$repo_dir/build/godot-particle-diagnostic" revision="a13da4feb8d8aefc283c3763d33a2f170a18d541" engine_arch="${1:-arm64}" case "$engine_arch" in arm64|x86_64) ;; *) echo "Expected arm64 or x86_64" >&2; exit 1 ;; esac if [ ! -d "$source_dir" ]; then git clone --depth 1 --branch 4.7.1-stable https://github.com/godotengine/godot.git "$source_dir" fi test "$(git -C "$source_dir" rev-parse HEAD)" = "$revision" git -C "$source_dir" diff --exit-code git -C "$source_dir" diff --cached --exit-code cd "$source_dir" scons platform=macos arch="$engine_arch" target=template_release \ debug_symbols=yes optimize=speed lto=none vulkan=no -j8 echo "Engine: $source_dir/bin/godot.macos.template_release.$engine_arch" shasum -a 256 "bin/godot.macos.template_release.$engine_arch"