/
exaile.spec
107 lines (95 loc) · 2.82 KB
/
exaile.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# -*- mode: python -*-
from __future__ import print_function
import sys
from PyInstaller.utils.hooks import collect_submodules
if sys.platform == 'win32':
afile = '_inst/usr/lib/exaile/exaile_win.py'
elif sys.platform == 'darwin':
afile = '_inst/usr/lib/exaile/exaile_osx.py'
else:
afile = '_inst/usr/lib/exaile/exaile.py'
block_cipher = None
hiddenimports = collect_submodules('xl') + \
collect_submodules('xlgui') + \
collect_submodules('keyboard') + \
collect_submodules('feedparser') + \
collect_submodules('musicbrainzngs') + \
collect_submodules('mutagen') + \
collect_submodules('pylast')
datas =[
('_inst/usr/share/exaile/data', ''),
('_inst/usr/share/exaile/plugins', ''),
('_inst/usr/share/locale', 'share/locale')
]
# requires https://github.com/pyinstaller/pyinstaller/pull/3608
def assemble_hook(analysis):
# filter out gstreamer plugins we don't want
to_remove = [
'gstassrender',
'gstcacasink',
'gstdaala',
'gstdvdread',
'gstdvdsub',
'gstfaac',
'gstmxf',
'gstopenal',
'gstopenexr',
'gstopengl',
'gstopenh264',
'gstopencv',
'gstresindvd',
'gstrtmp',
'gstschro',
'gstvideo',
'gstvpx',
'gstwasapi', # Generally buggy, e.g. https://github.com/exaile/exaile/issues/532
'gstwebp',
'gstwebrtc',
'gstx264',
'gstx265',
'gstxvimage',
'gstzbar',
]
def _exclude(b):
for r in to_remove:
if r in b and 'libgstvideo-1' not in b:
print("Excluding", b)
return True
return False
analysis.binaries = [
b for b in analysis.binaries if not _exclude(b[0])
]
a = Analysis([afile],
pathex=['_inst/usr/lib/exaile'],
binaries=None,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
runtime_hooks=[],
excludes=['tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
assemble_hook=assemble_hook)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='exaile',
debug=False,
strip=False,
upx=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='exaile')
if sys.platform == 'darwin':
app = BUNDLE(coll,
name='Exaile.app',
icon="../../data/images/exaile.icns",
bundle_identifier=None)