#!/usr/bin/env bash # Build LinTunes.app and LinTunes--.dmg. # # Runs on a Mac only, and builds for the Mac it runs on (an Apple Silicon # Mac makes the AppleSilicon dmg, an Intel Mac the Intel one). The same # script runs in GitHub Actions and on a desk: # # packaging/mac/build.sh # # Needs: Python 3.11+ for this Mac's architecture (python.org, Homebrew or # pyenv; set PYTHON=/path/to/python3 to pick one) and Xcode's command line # tools (codesign, hdiutil, lipo come with macOS / the CLT). No Homebrew # packages: ffmpeg and fpcalc are downloaded and checked against the # SHA-256 pinned in tools.json. # # Signing. Without secrets the app is ad-hoc signed ("codesign --sign -"), # which Apple Silicon requires before it will run anything, and users see # Gatekeeper's "Open Anyway" once (docs/mac.md). With all of these set it # is signed with a Developer ID, hardened runtime and entitlements.plist, # then notarized and stapled instead (docs/mac-release.md): # MACOS_CERTIFICATE base64 of the Developer ID Application .p12 # MACOS_CERTIFICATE_PASSWORD that .p12's password # MACOS_SIGNING_IDENTITY e.g. "Developer ID Application: Name (TEAMID)" # MACOS_NOTARY_APPLE_ID Apple ID used for notarization # MACOS_NOTARY_TEAM_ID the 10-character team id # MACOS_NOTARY_PASSWORD an app-specific password for that Apple ID # # Output: build/mac/LinTunes--