-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathspcal.spec
More file actions
99 lines (93 loc) · 2.79 KB
/
Copy pathspcal.spec
File metadata and controls
99 lines (93 loc) · 2.79 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
# vim: set ft=python:
import argparse
import importlib.metadata
import os
from pathlib import Path
parser = argparse.ArgumentParser()
parser.add_argument("--bundle", action="store_true")
parser.add_argument("--debug", action="store_true")
opts = parser.parse_args()
binaries = []
if os.name == "nt":
binaries.append(
("C:/tbb/inteltbb.redist.win/runtimes/win-x64/native/tbb12.dll", ".")
)
a = Analysis(
[Path("spcal", "__main__.py")],
binaries=binaries,
datas=[
("spcal/resources/app.ico", "spcal/resources"),
("spcal/resources/npdb.npz", "spcal/resources"),
("spcal/resources/cpln_quantiles.npz", "spcal/resources"),
],
hiddenimports=["bottleneck"],
)
pyz = PYZ(a.pure)
name = f"spcal_{importlib.metadata.version('spcal')}"
if opts.debug:
exe = EXE(pyz, a.scripts, exclude_binaries=True, name=name)
coll = COLLECT(exe, a.binaries, a.datas, name=name + "_debug")
elif opts.bundle:
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name=name,
debug=False,
upx_exclude=["Qt*.dll", "PySide*.pyd"],
console=False,
icon="app.ico",
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
name=name,
upx_exclude=["Qt*.dll", "PySide*.pyd"],
)
app = BUNDLE(
coll,
name="spcal.app",
icon="app.ico",
bundle_identifier="com.spcal.spcal",
version=importlib.metadata.version("spcal"),
info_plist={
"NSPrincipalClass": "NSApplication",
"NSAppleScriptEnabled": False,
"CFBundleDocumentTypes": [
{
"CFBundleTypeExtensions": [".txt", ".csv", ".text"],
"CFBundleTypeName": "SP Text Data",
"CFBundleTypeRole": "Viewer",
"LSItemContentTypes": ["public.text"],
"LSHandlerRank": "Default",
},
{
"CFBundleTypeExtensions": [".info"],
"CFBundleTypeName": "Nu Instruments Data",
"CFBundleTypeRole": "Viewer",
"LSItemContentTypes": ["public.data"],
"LSHandlerRank": "Default",
},
{
"CFBundleTypeExtensions": [".h5"],
"CFBundleTypeName": "TOFWERK Data",
"CFBundleTypeRole": "Viewer",
"LSItemContentTypes": ["public.data"],
"LSHandlerRank": "Default",
},
],
},
)
else:
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
name=name,
debug=False,
upx_exclude=["Qt*.dll", "PySide*.pyd"],
console=False,
icon="app.ico",
)