-
Notifications
You must be signed in to change notification settings - Fork 2
/
windows-build.spec
50 lines (45 loc) · 1.33 KB
/
windows-build.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
# -*- mode: python -*-
#
# Creates an .exe for the windows spotify version which has no dependencies
# (ie. python and the python packages are all included)
# To run this script and build you must first install pyinstall and download
# python and all the dependencies. It must be run on windows.
def extra_datas(mydir):
def rec_glob(p, files):
import os
import glob
for d in glob.glob(p):
if os.path.isfile(d):
files.append(d)
rec_glob("%s/*" % d, files)
files = []
rec_glob("%s/*" % mydir, files)
extra_datas = []
for f in files:
extra_datas.append((f, f, 'DATA'))
return extra_datas
a = Analysis(['swisher\winbox.py'],
pathex=['swisher'],
hiddenimports=[],
hookspath=None)
a.datas += extra_datas('swisher\\templates')
a.datas += extra_datas('swisher\\assets')
a.datas += extra_datas('swisher\\winresources')
a.datas += extra_datas('mpd-0.17.4-win32')
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=1,
name=os.path.join('build\\pyi.win32\\swisher', 'swisher.exe'),
debug=False,
strip=None,
upx=True,
icon='swisher\\winresources\\icon.ico',
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name=os.path.join('dist', 'swisher'))