-
-
Notifications
You must be signed in to change notification settings - Fork 400
/
Copy pathpicard.spec
95 lines (74 loc) · 2.39 KB
/
picard.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
# -*- mode: python -*-
import os
import glob
import platform
def _picard_get_locale_files():
locales = []
path_domain = {
'po': 'picard',
os.path.join('po', 'countries'): 'picard-countries',
os.path.join('po', 'attributes'): 'picard-attributes',
}
for path, domain in path_domain.items():
for filepath in glob.glob(os.path.join(path, '*.po')):
filename = os.path.basename(filepath)
locale = os.path.splitext(filename)[0]
locales.append((domain, locale, filepath))
return locales
def get_locale_messages():
data_files = []
for locale in _picard_get_locale_files():
data_files.append(
(os.path.join("build", "locale", locale[1], "LC_MESSAGES" , locale[0] + ".mo"),
os.path.join("locale", locale[1], "LC_MESSAGES")))
return data_files
block_cipher = None
os_name = platform.system()
binaries = []
data_files = get_locale_messages()
fpcalc_name = 'fpcalc'
if os_name == 'Windows':
fpcalc_name = 'fpcalc.exe'
binaries += [('discid.dll', ''), ('ssleay32.dll', ''), ('libeay32.dll', '')]
if os_name == 'Darwin':
binaries += [('libdiscid.0.dylib', '')]
if os.path.isfile(fpcalc_name):
binaries += [(fpcalc_name, '')]
a = Analysis(['tagger.py'],
pathex=['picard'],
binaries=binaries,
datas=data_files,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='picard',
debug=False,
strip=False,
upx=False,
icon='picard.ico',
console=False)
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name='picard')
if platform.system() == 'Darwin':
info_plist = {'NSHighResolutionCapable': 'True',
'NSPrincipalClass': 'NSApplication'}
app = BUNDLE(coll,
name='MusicBrainz Picard.app',
icon='picard.icns',
bundle_identifier=None,
info_plist=info_plist
)