#!/usr/bin/env bash # Builds build/Sst.app (a normal Dock app, no LSUIElement). Pass --install to copy it to /Applications. set -euo pipefail cd "$(dirname "$0")/.." APP="build/Sst.app" IDENTIFIER="local.sst.app" VERSION="0.2.0" swift build -c release --product Sst BIN=".build/release/Sst" rm -rf "$APP" mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" cp "$BIN" "$APP/Contents/MacOS/Sst" # SwiftPM resource bundles (if any dependency ships them) live next to the binary. for b in .build/release/*.bundle; do [ -e "$b" ] && cp -R "$b" "$APP/Contents/Resources/" done if [ -f Design/AppIcon.icns ]; then cp Design/AppIcon.icns "$APP/Contents/Resources/AppIcon.icns" else echo "Let op: Design/AppIcon.icns ontbreekt; run scripts/make-icon.sh." fi cat > "$APP/Contents/Info.plist" < CFBundleIdentifier$IDENTIFIER CFBundleNameSst CFBundleDisplayNameSst CFBundleExecutableSst CFBundlePackageTypeAPPL CFBundleShortVersionString$VERSION CFBundleVersion1 CFBundleIconFileAppIcon LSMinimumSystemVersion14.0 LSApplicationCategoryTypepublic.app-category.productivity NSHighResolutionCapable NSMicrophoneUsageDescription Sst neemt je stem op zolang je de sneltoets ingedrukt houdt, om die lokaal naar tekst om te zetten. PLIST # A stable signing identity keeps the macOS permissions (Microphone, Accessibility, Input Monitoring) across rebuilds. IDENTITY="${SST_SIGN_IDENTITY:-$(security find-identity -v -p codesigning | sed -n 's/.*"\(Apple Development: [^"]*\)".*/\1/p' | head -1)}" if [ -n "$IDENTITY" ]; then codesign --force --sign "$IDENTITY" --identifier "$IDENTIFIER" "$APP" echo "Ondertekend met: $IDENTITY" else codesign --force --sign - --identifier "$IDENTIFIER" "$APP" echo "WAARSCHUWING: geen Apple Development-certificaat gevonden; ad-hoc ondertekend (rechten gaan na elke herbouw verloren)." fi codesign --verify --strict "$APP" echo "Gebouwd: $APP" echo "Eenmalig na het wisselen van ondertekening: tccutil reset Accessibility $IDENTIFIER; tccutil reset ListenEvent $IDENTIFIER; tccutil reset Microphone $IDENTIFIER (en geef de rechten opnieuw)." if [ "${1:-}" = "--install" ]; then rm -rf /Applications/Sst.app cp -R "$APP" /Applications/Sst.app echo "Geïnstalleerd: /Applications/Sst.app" fi