-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.spec
100 lines (96 loc) · 2.54 KB
/
main.spec
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
# -*- mode: python ; coding: utf-8 -*-
import sys
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[('icon.ico', '.'), ('data.json', '.')],
hiddenimports=['tiktoken_ext.openai_public', 'tiktoken_ext', 'PySide6', 'PySide6.QtCore', 'PySide6.QtGui', 'qfluentwidgets'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
# 平台特定的排除项
if sys.platform == 'win32':
exclude_prefix = [
'PySide6\\opengl32sw.dll',
'PySide6\\Qt6Pdf.dll',
'PySide6\\Qt6Network.dll',
'PySide6\\QtNetwork.pyd',
'PySide6\\Qt6VirtualKeyboard.dll',
'PySide6\\Qt6Qml.dll',
'PySide6\\Qt6Quick.dll',
'PySide6\\Qt6OpenGL.dll',
'PySide6\\Qt6QmlModels.dll',
'PySide6\\translations',
'Pythonwin',
]
else:
exclude_prefix = [
'PySide6/Qt6Pdf',
'PySide6/Qt6Network',
'PySide6/QtNetwork',
'PySide6/Qt6VirtualKeyboard',
'PySide6/Qt6Qml',
'PySide6/Qt6Quick',
'PySide6/Qt6OpenGL',
'PySide6/Qt6QmlModels',
'PySide6/translations',
]
def should_include(t):
return not any(t[0].startswith(prefix) for prefix in exclude_prefix)
a.binaries = list(filter(should_include, a.binaries))
a.datas = list(filter(should_include, a.datas))
pyz = PYZ(a.pure)
if sys.platform == 'win32':
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='main',
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=['icon.ico'],
)
elif sys.platform == 'darwin':
exe = EXE(
pyz,
a.scripts,
[], # 不包含二进制文件
exclude_binaries=True,
name='SakuraLauncher',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
argv_emulation=True,
)
app = BUNDLE(
exe,
a.binaries,
a.datas,
name='SakuraLauncher.app',
icon='icon.ico',
bundle_identifier='com.sakura.launcher',
info_plist={
'NSHighResolutionCapable': True,
'LSBackgroundOnly': False,
'CFBundleDisplayName': 'SakuraLauncher',
}
)