#!/bin/sh # Builds `Hex Playground.app`: the Scrawl capture capsule in a window of its # own (`hex capsule-playground`), driven by a fake host with live tuning. # It touches no Hex data, settings, or captures, and records and sends # nothing, so it runs beside the installed Hex. Ad-hoc signed, for this Mac. set -eu root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) export MACOSX_DEPLOYMENT_TARGET=15.0 cargo build --locked --release --bin hex --manifest-path "$root/Cargo.toml" target=${CARGO_TARGET_DIR:-$root/target} bundle="${HEX_PLAYGROUND_OUT:-$root/target/app}/Hex Playground.app" rm -rf "$bundle" mkdir -p "$bundle/Contents/MacOS" "$bundle/Contents/Resources" cp "$target/release/hex" "$bundle/Contents/MacOS/hex" cat > "$bundle/Contents/MacOS/playground" <<'SH' #!/bin/sh exec "$(dirname "$0")/hex" capsule-playground SH chmod +x "$bundle/Contents/MacOS/playground" cat > "$bundle/Contents/Info.plist" <<'PLIST' CFBundleExecutableplayground CFBundleIdentifieranomaly.hex.playground CFBundleNameHex Playground CFBundlePackageTypeAPPL CFBundleShortVersionString0 NSHighResolutionCapable PLIST codesign --force --sign - "$bundle/Contents/MacOS/hex" codesign --force --sign - "$bundle" echo "$bundle"