-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoolbox_linux.spec
More file actions
128 lines (116 loc) · 3.31 KB
/
Copy pathtoolbox_linux.spec
File metadata and controls
128 lines (116 loc) · 3.31 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
125
126
127
128
# -*- mode: python ; coding: utf-8 -*-
import os
from pathlib import Path
project_root = Path(globals().get("SPECPATH", os.getcwd())).resolve()
datas: list[tuple[str, str]] = []
for icon_name in ("one.png", "one_tray.png"):
icon_path = project_root / "app" / "assets" / icon_name
if icon_path.is_file():
datas.append((str(icon_path), "app/assets"))
def _explicit_optional_binary(env_var: str, binary_name: str) -> list[tuple[str, str]]:
raw_path = os.environ.get(env_var, "").strip()
if not raw_path:
return []
candidate = Path(raw_path).expanduser().resolve()
if not candidate.is_file():
raise FileNotFoundError(f"{env_var} does not point to a file: {candidate}")
return [(str(candidate), binary_name)]
binaries = [
*_explicit_optional_binary("TOOLBOX_FFMPEG_BINARY", "ffmpeg"),
*_explicit_optional_binary("TOOLBOX_FFPROBE_BINARY", "ffprobe"),
]
qt_excludes = [
"PySide6.Qt3DAnimation",
"PySide6.Qt3DCore",
"PySide6.Qt3DExtras",
"PySide6.Qt3DInput",
"PySide6.Qt3DLogic",
"PySide6.Qt3DRender",
"PySide6.QtCharts",
"PySide6.QtDataVisualization",
"PySide6.QtGraphs",
"PySide6.QtGraphsWidgets",
"PySide6.QtHttpServer",
"PySide6.QtLocation",
"PySide6.QtMultimedia",
"PySide6.QtMultimediaWidgets",
"PySide6.QtNetworkAuth",
"PySide6.QtNfc",
"PySide6.QtPdf",
"PySide6.QtPdfWidgets",
"PySide6.QtPositioning",
"PySide6.QtQml",
"PySide6.QtQuick",
"PySide6.QtQuick3D",
"PySide6.QtQuickControls2",
"PySide6.QtQuickWidgets",
"PySide6.QtRemoteObjects",
"PySide6.QtScxml",
"PySide6.QtSensors",
"PySide6.QtSerialBus",
"PySide6.QtSerialPort",
"PySide6.QtSpatialAudio",
"PySide6.QtSql",
"PySide6.QtStateMachine",
"PySide6.QtTest",
"PySide6.QtTextToSpeech",
"PySide6.QtWebChannel",
"PySide6.QtWebEngineCore",
"PySide6.QtWebEngineQuick",
"PySide6.QtWebEngineWidgets",
"PySide6.QtWebSockets",
"PySide6.QtWebView",
"PySide6.QtXml",
]
a = Analysis(
[str(project_root / "main.py")],
pathex=[str(project_root)],
binaries=binaries,
datas=datas,
hiddenimports=[],
hookspath=[str(project_root / "packaging" / "pyinstaller-hooks")],
hooksconfig={},
runtime_hooks=[],
excludes=qt_excludes,
noarchive=False,
optimize=1,
)
# Linux Mint 22.3 is the primary release target. Keep glibc, the graphics
# driver stack, and other base-system libraries on the host, but bundle the
# small XCB/XKB helper libraries that are not guaranteed to be installed on
# an otherwise complete Mint desktop. These are required by Qt's qxcb plugin
# before QApplication can show an actionable error.
bundled_xcb_runtime_libraries = [
"libxcb-cursor.so.*",
"libxcb-image.so.*",
"libxcb-render-util.so.*",
"libxcb-util.so.*",
"libxcb-xkb.so.*",
"libxkbcommon.so.*",
"libxkbcommon-x11.so.*",
]
a.exclude_system_libraries(
list_of_exceptions=bundled_xcb_runtime_libraries,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="toolbox",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False,
disable_windowed_traceback=False,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
name="toolbox",
)