-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPortusSIM.spec
More file actions
111 lines (99 loc) · 3.13 KB
/
Copy pathPortusSIM.spec
File metadata and controls
111 lines (99 loc) · 3.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec for PortusSIM 1.0.0
Build (run on the TARGET OS — PyInstaller is not a cross-compiler):
macOS: pyinstaller PortusSIM.spec
Windows: pyinstaller PortusSIM.spec
Produces:
macOS: dist/PortusSIM.app
Windows: dist/PortusSIM/PortusSIM.exe (one-folder build)
"""
import sys
from pathlib import Path
block_cipher = None
PROJECT = Path(SPECPATH)
# --- Bundled data files (PyInstaller does NOT include these automatically) ---
# Each tuple is (source_on_disk, destination_inside_bundle).
datas = [
(str(PROJECT / "assets"), "assets"), # logo PNGs + Inter font
(str(PROJECT / "presets"), "presets"), # scenario presets
]
# Optional extra data files if present
for extra in ("layout_test.json",):
p = PROJECT / extra
if p.exists():
datas.append((str(p), "."))
a = Analysis(
["main.py"],
pathex=[str(PROJECT)],
binaries=[],
datas=datas,
hiddenimports=[
# matplotlib's Qt backend is imported dynamically; name it explicitly
"matplotlib.backends.backend_qtagg",
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Trim weight: exclude GUI toolkits we don't use
"tkinter", "PyQt5", "PyQt6", "PySide2",
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
# Platform-specific icon
icon_file = None
if sys.platform == "darwin" and (PROJECT / "assets/logo/PortusSIM.icns").exists():
icon_file = str(PROJECT / "assets/logo/PortusSIM.icns")
elif sys.platform.startswith("win") and (PROJECT / "assets/logo/PortusSIM.ico").exists():
icon_file = str(PROJECT / "assets/logo/PortusSIM.ico")
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="PortusSIM",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False, # UPX often flagged by AV on Windows; keep off
console=False, # GUI app — no terminal window
disable_windowed_traceback=False,
argv_emulation=True, # macOS: handle file-open events / drag-drop
target_arch=None, # build for the machine's native arch
codesign_identity=None, # set later if you code-sign (see guide)
entitlements_file=None,
icon=icon_file,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name="PortusSIM",
)
# macOS: wrap the collected folder into a proper .app bundle
if sys.platform == "darwin":
app = BUNDLE(
coll,
name="PortusSIM.app",
icon=icon_file,
bundle_identifier="org.archaeological-abm.portussim",
version="1.0.0",
info_plist={
"CFBundleName": "PortusSIM",
"CFBundleDisplayName": "PortusSIM",
"CFBundleShortVersionString": "1.0.0",
"CFBundleVersion": "1.0.0",
"NSHighResolutionCapable": True,
"LSMinimumSystemVersion": "11.0",
"NSHumanReadableCopyright": "© 2026 Archaeological ABM",
},
)