#!/bin/sh # Native macOS build and app bundle. No Docker, mirror configuration, or tests. set -eu if [ "$(uname -s)" != Darwin ]; then echo "Build this app bundle on macOS." >&2 exit 1 fi cd "$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)" cargo build --release --locked "$@" version=$(awk -F '"' '$1 ~ /^version[[:space:]]*=/ { print $2; exit }' Cargo.toml) test -n "$version" bundle="$(pwd)/target/release/Tessera.app" mkdir -p "$bundle/Contents/MacOS" cp target/release/tessera "$bundle/Contents/MacOS/tessera.new" mv -f "$bundle/Contents/MacOS/tessera.new" "$bundle/Contents/MacOS/tessera" cat > "$bundle/Contents/Info.plist.new" < CFBundleIdentifiercom.entroia.tessera CFBundleNameTessera CFBundleDisplayNameTessera CFBundleExecutabletessera CFBundlePackageTypeAPPL CFBundleShortVersionString$version CFBundleVersion$version NSHighResolutionCapable PLIST mv -f "$bundle/Contents/Info.plist.new" "$bundle/Contents/Info.plist" printf '%s\n' "$bundle"