-
Notifications
You must be signed in to change notification settings - Fork 1
/
Chameleon.spec
105 lines (97 loc) · 2.38 KB
/
Chameleon.spec
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
# -*- mode: python -*-
import platform
import re
from os.path import isfile
is_mac = platform.system().lower() == "darwin"
block_cipher = None
VERSION_FILE = "chameleon/resources/version.txt"
FILTER_FILE = "chameleon/resources/filter.yaml"
added_files = [
("chameleon/resources/chameleon.png", "."),
("chameleon/resources/extracolumns.yaml", "."),
("chameleon/resources/OSMtag.txt", "."),
]
if isfile(FILTER_FILE):
added_files.append(
(FILTER_FILE, "."),
)
try:
with open(VERSION_FILE, "r") as fp:
version_string = fp.read()
except OSError:
APP_VERSION = "0.0.0"
else:
added_files.append((VERSION_FILE, "."))
version_split = version_string[1:].split(".")
version_re = re.compile(r"(?<=\d)([A-z])[A-z]+(?=\d)*")
# shortens words like "alpha" or "beta" to first character
version_split = [version_re.sub(r"\1", i) for i in version_split]
APP_VERSION = ".".join(version_split)
a = Analysis(
["pyinstaller_entry.py"],
pathex=[],
binaries=[],
datas=added_files,
hiddenimports=[
"cmath",
"pandas._libs.tslibs.timedeltas",
],
hookspath=[],
runtime_hooks=[],
excludes=["ptvsd"],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
items = (
[]
if is_mac
else [
a.binaries,
a.zipfiles,
a.datas,
]
)
exe = EXE(
pyz,
a.scripts,
*items,
[],
exclude_binaries=is_mac,
name="Chameleon",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
icon="chameleon/resources/chameleon.icns" if is_mac else None,
entitlements_file=None,
)
if is_mac:
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="Chameleon",
)
app = BUNDLE(
coll,
name="Chameleon.app",
icon="chameleon/resources/chameleon.icns",
bundle_identifier="com.kaart.chameleon",
info_plist={
"NSHighResolutionCapable": "True",
"CFBundleVersion": APP_VERSION,
"CFBundleShortVersionString": APP_VERSION,
},
)