Skip to content

Commit b399ef2

Browse files
authored
fix: build
1 parent 97de139 commit b399ef2

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

main.spec

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
# -*- mode: python ; coding: utf-8 -*-
2-
from PyInstaller.utils.hooks import collect_all
3-
4-
datas = []
5-
binaries = []
6-
hiddenimports = ['plyer.platforms.win.notification']
7-
tmp_ret = collect_all('readchar')
8-
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
2+
from PyInstaller.utils.hooks import copy_metadata
3+
import platform
94

5+
datas = copy_metadata("readchar")
6+
if platform.system() == "Windows":
7+
name = "BHYG-Windows"
8+
elif platform.system() == "Linux":
9+
name = "BHYG-Linux"
10+
elif platform.system() == "Darwin":
11+
print(platform.machine())
12+
if "arm" in platform.machine():
13+
name = "BHYG-macOS-Apple_Silicon"
14+
elif "64" in platform.machine():
15+
name = "BHYG-macOS-Intel"
16+
else:
17+
name = "BHYG-macOS"
18+
else:
19+
name = "BHYG"
1020

1121
a = Analysis(
1222
['main.py'],
1323
pathex=[],
14-
binaries=binaries,
24+
binaries=[],
1525
datas=datas,
16-
hiddenimports=hiddenimports,
26+
hiddenimports=[],
1727
hookspath=[],
1828
hooksconfig={},
1929
runtime_hooks=[],
20-
excludes=['PyQt5'],
30+
excludes=[],
2131
noarchive=False,
2232
optimize=0,
2333
)
@@ -29,7 +39,7 @@ exe = EXE(
2939
a.binaries,
3040
a.datas,
3141
[],
32-
name='main',
42+
name=name,
3343
debug=False,
3444
bootloader_ignore_signals=False,
3545
strip=False,

0 commit comments

Comments
 (0)