-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbifrost.spec
More file actions
114 lines (104 loc) · 3.18 KB
/
bifrost.spec
File metadata and controls
114 lines (104 loc) · 3.18 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
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller spec file for Bifrost robot control application.
Produces a single portable exe. External folders live next to the exe:
bifrost.exe
addons/ <- addon packages (discovered at runtime)
calibration/ <- writable config JSONs (created on first launch)
"""
import sys
import sysconfig
from pathlib import Path
block_cipher = None
src_dir = Path(SPECPATH)
site_packages = Path(sysconfig.get_paths()['purelib'])
# Resources bundled INSIDE the exe (extracted to temp dir at runtime)
# - STLs are read-only 3D models
# - Default configs are copied to calibration/ on first launch
datas = [
(str(src_dir / 'STLs'), 'STLs'),
(str(src_dir / 'dh_parameters.json'), '.'),
(str(src_dir / 'gripper_calibration.json'), '.'),
(str(src_dir / 'coordinate_frames.json'), '.'),
]
# Add optional config files if they exist
for optional in ['home_position.json', 'park_position.json']:
if (src_dir / optional).exists():
datas.append((str(src_dir / optional), '.'))
# Native DLLs for voice_control addon (vosk + sounddevice)
# These MUST be added as binaries with explicit destination — adding as datas
# causes PyInstaller to reclassify them and then drop them as "system" DLLs.
# vosk.__init__ expects DLLs in the vosk/ package directory; the runtime hook
# (pyi_rth_vosk.py) copies them there from wherever they end up.
binaries = []
vosk_dir = site_packages / 'vosk'
for dll in vosk_dir.glob('*.dll'):
binaries.append((str(dll), '.'))
sd_data_dir = site_packages / '_sounddevice_data' / 'portaudio-binaries'
for dll in sd_data_dir.glob('*.dll'):
binaries.append((str(dll), '.'))
a = Analysis(
['bifrost.py'],
pathex=[str(src_dir)],
binaries=binaries,
datas=datas,
hiddenimports=[
'OpenGL.platform.win32',
'OpenGL.arrays.vbo',
'OpenGL.arrays.numpymodule',
'OpenGL.arrays.arraydatatype',
'OpenGL.arrays.formathandler',
'OpenGL.converters',
'scipy.spatial.transform._rotation',
'scipy._cyutility',
# Used by addons (external, not analysed by PyInstaller)
'PyQt5.QtNetwork',
'vosk',
'vosk.vosk_cffi',
'sounddevice',
'_sounddevice_data',
'srt',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[str(src_dir / 'pyi_rth_vosk.py')],
excludes=[
'OpenGL_accelerate',
'scipy.integrate',
'scipy.stats',
'scipy.optimize',
'scipy.interpolate',
'scipy.signal',
'scipy.ndimage',
'scipy.io',
'scipy.fft',
'pytest',
'setuptools',
'_pytest',
],
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,
a.binaries,
a.zipfiles,
a.datas,
[],
name='bifrost',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)