macOS (Apple silicon) now plays, browses and updates like Windows: - Video: libmpv's render API draws into a CAOpenGLLayer beneath the WKWebView, with the miniplayer rectangle, HDR passthrough through extended dynamic range (PQ/BT.2020) and display-sleep prevention. - Window: native traffic lights on the top bar's centre line, hidden with the player's controls; the page's caption buttons are Windows-only. - Interface: macOS shortcut labels (⌘K, ⌘[, ⌃⌘F), Plex identifies the player as a Mac, and header values are kept ASCII (Mac computer names usually contain a curly apostrophe). - The window appears without waiting for an animation frame, which WKWebView doesn't run in a hidden window. - Credentials: release builds use the Keychain and are signed with a lasting self-signed certificate so access survives updates; debug builds keep tokens in a private file to avoid prompts on every rebuild. - Bundling: scripts/fetch-libmpv.sh makes Homebrew's libmpv and its libraries self-contained; scripts/build.sh builds the .app, .dmg and signed update archive. Releases now carry both platforms: publish-release.mjs uploads each machine's build into one release, and update-manifest.mjs writes the feed from that release's assets, refusing while a platform is missing. The updater uses a new signing key (public key in tauri.conf.json), so existing installs must be reinstalled once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
2.6 KiB
Bash
54 lines
2.6 KiB
Bash
#!/usr/bin/env sh
|
|
# Builds Kaleido for macOS: the .app, a .dmg for first installs and the signed updater
|
|
# archive, renamed Kaleido_<version>_<arch>.app.tar.gz for the release.
|
|
# sh scripts/build.sh # release build
|
|
# sh scripts/build.sh --debug # faster unoptimized build
|
|
set -eu
|
|
root=$(cd "$(dirname "$0")/.." && pwd)
|
|
cd "$root"
|
|
profile=release
|
|
[ "${1:-}" = "--debug" ] && profile=debug
|
|
|
|
sh scripts/fetch-libmpv.sh
|
|
|
|
# The bundled libraries decide the oldest macOS Kaleido runs on (Homebrew builds them
|
|
# for the macOS of the machine that installed them).
|
|
minos=$(for f in vendor/mpv/macos/*.dylib; do otool -l "$f" | awk '/LC_BUILD_VERSION/{b=1} b&&/minos/{print $2; b=0}'; done | sort -V | tail -1)
|
|
|
|
# Signing with one lasting certificate keeps the app's identity across updates, so the
|
|
# Keychain keeps trusting it with the Plex token (ad hoc signatures change every build).
|
|
# "Kaleido Self-Signed" lives in the login keychain; .tools/macos-signing.p12 backs it up.
|
|
identity=${KALEIDO_SIGNING_IDENTITY:-Kaleido Self-Signed}
|
|
if security find-identity -p codesigning | grep -q "\"$identity\""; then
|
|
codesign --force --sign "$identity" vendor/mpv/macos/*.dylib 2>/dev/null
|
|
else
|
|
echo "warning: no \"$identity\" signing certificate; signing ad hoc (the Keychain will ask again after updates)." >&2
|
|
identity=-
|
|
fi
|
|
|
|
# The updater signing key stays outside git (.tools/), as on Windows.
|
|
updater=true
|
|
if [ -z "${TAURI_SIGNING_PRIVATE_KEY:-}" ]; then
|
|
if [ -f .tools/updater.key ]; then
|
|
TAURI_SIGNING_PRIVATE_KEY=$(cat .tools/updater.key)
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD=${TAURI_SIGNING_PRIVATE_KEY_PASSWORD:-}
|
|
export TAURI_SIGNING_PRIVATE_KEY TAURI_SIGNING_PRIVATE_KEY_PASSWORD
|
|
else
|
|
echo "warning: no updater signing key (.tools/updater.key); building without update artifacts." >&2
|
|
updater=false
|
|
fi
|
|
fi
|
|
config="{\"bundle\":{\"createUpdaterArtifacts\":$updater,\"macOS\":{\"minimumSystemVersion\":\"$minos\",\"signingIdentity\":\"$identity\"}}}"
|
|
|
|
[ -d node_modules ] || npm ci
|
|
if [ "$profile" = debug ]; then npx tauri build --debug --config "$config"; else npx tauri build --config "$config"; fi
|
|
|
|
version=$(node -p "require('./package.json').version")
|
|
arch=$(uname -m | sed 's/arm64/aarch64/; s/x86_64/x64/')
|
|
bundle="src-tauri/target/$profile/bundle"
|
|
if [ -f "$bundle/macos/Kaleido.app.tar.gz" ]; then
|
|
cp "$bundle/macos/Kaleido.app.tar.gz" "$bundle/macos/Kaleido_${version}_${arch}.app.tar.gz"
|
|
cp "$bundle/macos/Kaleido.app.tar.gz.sig" "$bundle/macos/Kaleido_${version}_${arch}.app.tar.gz.sig"
|
|
fi
|
|
echo "Built for macOS $minos or later:"
|
|
ls -l "$bundle/dmg" "$bundle/macos"
|