forked from plomgrading/plom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.windows.spec
58 lines (46 loc) · 1.87 KB
/
client.windows.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
# -*- mode: python ; coding: utf-8 -*-
import os
from pathlib import Path
# trickery from setup.py to define __version__ without import
with open(os.path.join("plom", "version.py")) as f:
exec(f.read())
# copy-pasted form client.linux.spec: unfortunate duplication
CursorList = [x.name for x in Path("plom/client/cursors").glob("*.png")]
# filter out some unused ones
CursorList = [x for x in CursorList if not x.startswith("text")]
print("** Hacky cursor list: {}".format(", ".join(CursorList)))
IconList = [x.name for x in Path("plom/client/icons").glob("*.svg")]
# filter out some unused ones
IconList = [x for x in IconList if not x.startswith("manager")]
IconList = [x for x in IconList if not x in ("rectangle.svg", "zoom_in.svg", "zoom_out.svg")]
print("** Hacky icon list: {}".format(", ".join(IconList)))
block_cipher = None
a = Analysis(['plom/scripts/client.py'],
pathex=['./'],
binaries=[],
datas=[(HOMEPATH + '\\PyQt5\\Qt\\bin\*', 'PyQt5\\Qt\\bin')],
hiddenimports=['pkg_resources.py2_warn'], # https://github.com/pyinstaller/pyinstaller/issues/4672
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
for icon in IconList:
a.datas += [(icon, 'plom/client/icons/{}'.format(icon), 'DATA')]
for cursor in CursorList:
a.datas += [(cursor, 'plom/client/cursors/{}'.format(cursor), 'DATA')]
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='PlomClient-{}.exe'.format(__version__),
debug=False,
strip=False,
onefile=True,
upx=True,
runtime_tmpdir=None,
console=True )