forked from mousepawmedia/omission
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathomission.spec
More file actions
72 lines (57 loc) · 1.83 KB
/
Copy pathomission.spec
File metadata and controls
72 lines (57 loc) · 1.83 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
NAME = 'Omission'
import os
from os.path import join
from kivy.utils import platform
if platform == 'win':
from kivy.deps import sdl2, glew
else:
glew = sdl2 = None
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
if IS_LINUX:
from PyInstaller.depend import dylib
dylib._unix_excludes.update({
r'.*nvidia.*': 1,
r'.*libdrm.*': 1,
r'.*hashlib.*': 1,
})
dylib.exclude_list = dylib.ExcludeList()
from kivy.tools.packaging.pyinstaller_hooks import get_hooks
binexcludes = [
'gobject', 'gio', 'gtk', 'gi', 'wx', 'twisted', 'curses',
'gstreamer', 'libffi', 'libglib', 'libmikmod', 'libflac', 'libvorbis',
'libgstreamer', 'libvorbisfile', 'include', 'libstdc++.so.6',
'gst_plugins', 'liblapack', 'pygame', 'lib/', 'include', 'kivy_install/modules',
]
a = Analysis(['omission/__main__.py'],
pathex=['.'],
hiddenimports=['numpy.core.multiarray'],
excludes=binexcludes,
**get_hooks())
pyz = PYZ(a.pure)
name = '%s%s' % (NAME, '.exe' if os.name == 'nt' else '')
def not_in(x, binexcludes):
return not any(y in x.lower() for y in binexcludes)
a.binaries = [
x for x in a.binaries
if not_in(x[0], binexcludes)
]
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name=name,
debug=False,
strip=None,
upx=True,
console=False,
icon=join('deploy_windows', 'omission.ico'))
with open('blacklist.txt') as f:
excludes = [x.strip() for x in f.readlines()]
coll = COLLECT(exe,
Tree('.', excludes=excludes),
a.binaries,
a.zipfiles,
a.datas,
*([Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)] if sdl2 else []),
strip=None,
upx=True,
name=NAME)