-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_macos_app.sh
More file actions
executable file
·32 lines (26 loc) · 1.13 KB
/
Copy pathbuild_macos_app.sh
File metadata and controls
executable file
·32 lines (26 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Build "Photo Tagger.app" (unsigned) for macOS with PyInstaller.
#
# ./packaging/build_macos_app.sh
#
# Output: dist/Photo Tagger.app (PyInstaller's build/ and dist/ are git-ignored).
# Unsigned, so the first launch needs a right-click > Open (Gatekeeper asks once). The app finds a
# Homebrew-installed exiftool automatically; install it with `brew install exiftool` if missing.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$(cd "$HERE/.." && pwd)"
cd "$ROOT"
RUN=(uv run --extra gui --group package)
echo "==> Generating the app icon (best-effort)..."
if ! "${RUN[@]}" python packaging/make_icns.py; then
echo " icon generation failed; bundling with PyInstaller's default icon."
fi
echo "==> Building the app bundle..."
"${RUN[@]}" pyinstaller --noconfirm --clean packaging/photo-tagger.spec \
--distpath "$ROOT/dist" --workpath "$ROOT/build"
APP="$ROOT/dist/Photo Tagger.app"
echo "==> Verifying the bundle (import self-test)..."
"$APP/Contents/MacOS/Photo Tagger" --selftest
echo
echo "==> Done: $APP"
echo " Launch it the first time with right-click > Open (it is unsigned)."