-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathkvm-gui.spec
More file actions
173 lines (157 loc) · 4.46 KB
/
Copy pathkvm-gui.spec
File metadata and controls
173 lines (157 loc) · 4.46 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# -*- mode: python ; coding: utf-8 -*-
"""
PyInstaller spec file for KVM Serial GUI application.
Builds a standalone executable for kvm-gui.
Usage:
pyinstaller kvm-gui.spec
Platforms:
- macOS: Creates a .app bundle
- Windows: Creates a .exe executable
- Linux: Creates a standalone executable
"""
import sys
import toml
# Read version from pyproject.toml so it stays in sync
with open('pyproject.toml', 'r') as f:
VERSION = toml.load(f)['project']['version']
block_cipher = None
# Hidden imports — modules PyInstaller's static analysis may miss.
hiddenimports = [
# PyQt5 modules and plugins
'PyQt5.QtCore',
'PyQt5.QtGui',
'PyQt5.QtWidgets',
'PyQt5.QtMultimedia',
'PyQt5.QtMultimediaWidgets',
'PyQt5.sip',
# Serial communication
'serial',
'serial.tools',
'serial.tools.list_ports',
# Input capture
'pynput',
'pynput.keyboard',
'pynput.mouse',
# Other dependencies
'screeninfo',
'toml',
# KVM serial modules
'kvm_serial',
'kvm_serial.kvm',
'kvm_serial.backend',
'kvm_serial.backend.video',
'kvm_serial.backend.keyboard',
'kvm_serial.backend.mouse',
'kvm_serial.backend.implementations',
'kvm_serial.backend.implementations.qtop',
'kvm_serial.backend.implementations.mouseop',
'kvm_serial.utils',
'kvm_serial.utils.settings',
'kvm_serial.utils.communication',
]
# Collect any data files from kvm_serial package
datas = [
('assets/icon.ico', 'assets'),
('assets/icon.png', 'assets'),
]
a = Analysis(
['kvm_serial/kvm.py'],
pathex=[],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
# Exclude unnecessary packages to reduce size
'tkinter',
'matplotlib',
'scipy',
'pandas',
'cv2',
'numpy',
'PIL.ImageQt',
],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
# Platform-specific build configuration
# macOS: Use onedir mode (recommended and required for PyInstaller 7.0+)
# Windows/Linux: Use onefile mode for simpler distribution
if sys.platform == 'darwin':
# macOS: onedir mode
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True, # onedir: binaries in separate folder
name='kvm-gui',
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='assets/entitlements.plist',
icon='assets/icon.icns',
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='kvm-gui',
)
app = BUNDLE(
coll,
name='KVM Serial.app',
icon='assets/icon.icns',
bundle_identifier='dev.finnigan.kvm-serial',
info_plist={
'CFBundleName': 'KVM Serial',
'CFBundleDisplayName': 'KVM Serial',
'CFBundleShortVersionString': VERSION,
'CFBundleVersion': VERSION,
'NSHumanReadableCopyright': 'Copyright © 2023-2025 Samantha Finnigan',
'NSHighResolutionCapable': 'True',
# Camera and input monitoring permissions
'NSCameraUsageDescription': 'KVM Serial needs camera access to capture video from the remote machine.',
'NSMicrophoneUsageDescription': 'KVM Serial does not use the microphone.',
# Accessibility for keyboard/mouse capture
'NSAppleEventsUsageDescription': 'KVM Serial needs to capture keyboard and mouse events to control the remote machine.',
},
)
else:
# Windows/Linux: onefile mode
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='kvm-gui',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='assets/icon.ico' if sys.platform == 'win32' else None,
)