-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenlaunchdeck.spec
More file actions
124 lines (115 loc) · 2.88 KB
/
Copy pathopenlaunchdeck.spec
File metadata and controls
124 lines (115 loc) · 2.88 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
112
113
114
115
116
117
118
119
120
121
122
123
124
# -*- mode: python ; coding: utf-8 -*-
from pathlib import Path
from openlaunchdeck.version import APP_NAME, __version__
block_cipher = None
root = Path.cwd()
def _version_tuple(version: str) -> tuple[int, int, int, int]:
parts = [int(part) for part in version.split(".")]
return tuple((parts + [0, 0, 0, 0])[:4])
version_parts = _version_tuple(__version__)
version_info_path = root / "build" / "openlaunchdeck_version_info.txt"
version_info_path.parent.mkdir(parents=True, exist_ok=True)
version_info_path.write_text(
f"""# UTF-8
VSVersionInfo(
ffi=FixedFileInfo(
filevers={version_parts},
prodvers={version_parts},
mask=0x3f,
flags=0x0,
OS=0x40004,
fileType=0x1,
subtype=0x0,
date=(0, 0)
),
kids=[
StringFileInfo([
StringTable(
'040904B0',
[
StringStruct('CompanyName', 'Rique'),
StringStruct('FileDescription', 'Launchpad Mini MK3 macro deck for Windows'),
StringStruct('FileVersion', '{__version__}'),
StringStruct('InternalName', '{APP_NAME}'),
StringStruct('LegalCopyright', 'Copyright (c) Rique'),
StringStruct('OriginalFilename', '{APP_NAME}.exe'),
StringStruct('ProductName', '{APP_NAME}'),
StringStruct('ProductVersion', '{__version__}')
]
)
]),
VarFileInfo([VarStruct('Translation', [1033, 1200])])
]
)
""",
encoding="utf-8",
)
hidden_imports = [
"PySide6.QtMultimedia",
"mido.backends.rtmidi",
"websocket",
]
try:
import openlaunchdeck_native # noqa: F401
except Exception:
pass
else:
hidden_imports.append("openlaunchdeck_native")
a = Analysis(
["openlaunchdeck/main.py"],
pathex=[str(root)],
binaries=[],
datas=[
("openlaunchdeck/resources", "openlaunchdeck/resources"),
("docs", "docs"),
("README.md", "."),
("LICENSE", "."),
],
hiddenimports=hidden_imports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
"PIL",
"Xlib",
"_tkinter",
"mouseinfo",
"pyautogui",
"pyscreeze",
"tkinter",
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="OpenLaunchDeck",
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,
entitlements_file=None,
icon=str(root / "openlaunchdeck" / "resources" / "icons" / "openlaunchdeck.ico"),
version=str(version_info_path),
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="OpenLaunchDeck",
)