-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4Charm.spec
More file actions
100 lines (87 loc) · 2.41 KB
/
4Charm.spec
File metadata and controls
100 lines (87 loc) · 2.41 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
# -*- mode: python ; coding: utf-8 -*-
from pathlib import Path
try:
import tomllib
except ModuleNotFoundError: # pragma: no cover
import tomli as tomllib # type: ignore
APP_NAME = "4Charm"
SPEC_DIR = Path(globals().get("SPECPATH", Path.cwd())).resolve()
PROJECT_ROOT = SPEC_DIR
MAIN_SCRIPT = PROJECT_ROOT / "src" / "four_charm" / "main.py"
ICON_FILE = PROJECT_ROOT / "assets" / "icons" / "4Charm.icns"
PYPROJECT = PROJECT_ROOT / "pyproject.toml"
def get_project_version(default: str = "0.0.0") -> str:
if not PYPROJECT.exists():
return default
try:
with PYPROJECT.open("rb") as fp:
data = tomllib.load(fp)
return data["project"]["version"]
except Exception:
return default
APP_VERSION = get_project_version()
BUNDLE_ID = "com.RazorBackRoar.4Charm"
a = Analysis(
[str(MAIN_SCRIPT)],
pathex=[str(PROJECT_ROOT / "src")],
binaries=[],
datas=[(str(PROJECT_ROOT / "assets"), "assets")],
hiddenimports=[
"shiboken6",
"PySide6.QtCore",
"PySide6.QtGui",
"PySide6.QtWidgets",
],
hookspath=[],
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name=APP_NAME,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False,
disable_windowed_traceback=False,
argv_emulation=True,
target_arch="arm64",
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name=APP_NAME,
)
app = BUNDLE(
coll,
name=f"{APP_NAME}.app",
icon=str(ICON_FILE),
bundle_identifier=BUNDLE_ID,
info_plist={
"CFBundleName": APP_NAME,
"CFBundleDisplayName": APP_NAME,
"CFBundleIdentifier": BUNDLE_ID,
"CFBundleVersion": APP_VERSION,
"CFBundleShortVersionString": APP_VERSION,
"LSMinimumSystemVersion": "11.0",
"LSRequiresNativeExecution": True,
"LSApplicationCategoryType": "public.app-category.utilities",
"NSHighResolutionCapable": True,
"NSRequiresAquaSystemAppearance": False,
"NSAppTransportSecurity": {"NSAllowsArbitraryLoads": True},
"NSHumanReadableCopyright": "Copyright © 2026 RazorBackRoar. All rights reserved.",
},
)