-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCodexSwitch.spec
More file actions
74 lines (67 loc) · 1.88 KB
/
Copy pathCodexSwitch.spec
File metadata and controls
74 lines (67 loc) · 1.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
# -*- mode: python ; coding: utf-8 -*-
# PyInstaller spec — macOS .app bundle (onedir 模式,启动秒开)
import os
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
SRC = os.path.join(os.path.abspath(SPECPATH), 'src')
ICON = os.path.join(os.path.abspath(SPECPATH), 'assets', 'CodexSwitch.icns')
# customtkinter 自带主题 json + 字体,必须 collect-all
ctk_datas = collect_data_files('customtkinter')
ctk_hidden = collect_submodules('customtkinter')
a = Analysis(
[os.path.join(SRC, 'gui_ctk.py')],
pathex=[SRC],
binaries=[],
datas=ctk_datas,
hiddenimports=['tomlkit', 'adapter', 'core', 'darkdetect'] + ctk_hidden,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
# onedir 模式:EXE 不内嵌 binary/data,运行时直接读文件夹 → 秒开
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='CodexSwitch',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
# 把所有 binary + data 收到一个目录
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name='CodexSwitch',
)
app = BUNDLE(
coll,
name='CodexSwitch.app',
icon=ICON,
bundle_identifier='com.aliang.codexswitch',
info_plist={
'CFBundleName': 'CodexSwitch',
'CFBundleDisplayName': 'CodexSwitch',
'CFBundleShortVersionString': '1.1.0',
'CFBundleVersion': '1.1.0',
'NSHighResolutionCapable': True,
'LSMinimumSystemVersion': '11.0',
'LSUIElement': False,
'NSHumanReadableCopyright': '跟着阿亮学AI — Local-only adapter for Codex.',
},
)