-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_mac.sh
More file actions
executable file
·56 lines (49 loc) · 2.1 KB
/
Copy pathbuild_mac.sh
File metadata and controls
executable file
·56 lines (49 loc) · 2.1 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# Build PortusSIM.app (and a .dmg) on macOS.
# Run this ON A MAC — PyInstaller cannot cross-compile.
set -euo pipefail
cd "$(dirname "$0")"
echo "==> PortusSIM macOS build"
# 1. Fresh virtual environment (keeps the build clean & reproducible)
python3 -m venv .build-venv
source .build-venv/bin/activate
pip install --upgrade pip wheel >/dev/null
pip install -r requirements.txt pyinstaller pillow pyobjc-framework-Cocoa >/dev/null
# 2. (Optional but recommended) regenerate a native, fully-conformant .icns
if command -v iconutil >/dev/null 2>&1; then
echo "==> Building native .icns with iconutil"
ICONSET="assets/logo/PortusSIM.iconset"
rm -rf "$ICONSET"; mkdir -p "$ICONSET"
cp assets/logo/portussim_mark_16.png "$ICONSET/icon_16x16.png"
cp assets/logo/portussim_mark_32.png "$ICONSET/icon_16x16@2x.png"
cp assets/logo/portussim_mark_32.png "$ICONSET/icon_32x32.png"
cp assets/logo/portussim_mark_64.png "$ICONSET/icon_32x32@2x.png"
cp assets/logo/portussim_mark_128.png "$ICONSET/icon_128x128.png"
cp assets/logo/portussim_mark_256.png "$ICONSET/icon_128x128@2x.png"
cp assets/logo/portussim_mark_256.png "$ICONSET/icon_256x256.png"
cp assets/logo/portussim_mark_512.png "$ICONSET/icon_256x256@2x.png"
cp assets/logo/portussim_mark_512.png "$ICONSET/icon_512x512.png"
iconutil -c icns "$ICONSET" -o assets/logo/PortusSIM.icns
rm -rf "$ICONSET"
else
echo "==> iconutil not found; using Pillow-generated .icns"
python make_icons.py
fi
# 3. Build
rm -rf build dist
pyinstaller PortusSIM.spec --noconfirm
echo "==> Built dist/PortusSIM.app"
# 4. Package into a .dmg for distribution
DMG="dist/PortusSIM-1.0.0.dmg"
rm -f "$DMG"
hdiutil create -volname "PortusSIM 1.0.0" \
-srcfolder "dist/PortusSIM.app" \
-ov -format UDZO "$DMG"
echo ""
echo "==> DONE"
echo " App: dist/PortusSIM.app"
echo " DMG: $DMG (this is what you send people)"
echo ""
echo "NOTE: This build is UNSIGNED. On first launch, users must right-click"
echo " the app → Open (or System Settings → Privacy → Open Anyway),"
echo " because it is not notarized by Apple. See SHIPPING.md."