#!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" PROFILE="${1:-release}" cd "$ROOT" OUT=$(cargo build --profile "$PROFILE" -p client --message-format=json | python3 -c ' import sys, json for line in sys.stdin: m = json.loads(line) if m.get("reason") == "build-script-executed" and "/crates/client" in m["package_id"]: print(m["out_dir"])') DIR="${PROFILE/dev/debug}" APP="target/$DIR/Yumush.app" rm -rf "$APP" mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" cp "target/$DIR/client" "$APP/Contents/MacOS/yumush" cp "$OUT/yumush.icns" "$APP/Contents/Resources/yumush.icns" VERSION=$(cargo pkgid -p client | sed 's/.*[#@]//') cat > "$APP/Contents/Info.plist" < CFBundleNameYumush CFBundleDisplayNameyumuß CFBundleIdentifiercom.yumush.client CFBundleExecutableyumush CFBundleIconFileyumush CFBundlePackageTypeAPPL CFBundleShortVersionString$VERSION CFBundleVersion$VERSION NSHighResolutionCapable NSMicrophoneUsageDescriptionVoice calls NSCameraUsageDescriptionVideo calls PLIST echo "$APP"