]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame - music_sampler.spec
Fix crash when click on unconfigured key
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler.spec
CommitLineData
d8ab67c7 1# -*- mode: python -*-
cc008de4 2import os
e257f4d9 3import setuptools_scm
2e404903
IB
4from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal,\
5 hookspath, runtime_hooks
d8ab67c7 6
35bde798
IB
7import importlib.machinery
8sysfont = importlib.machinery\
dd25f8f0 9 .SourceFileLoader('sysfont', os.getcwd()+'/music_sampler/sysfont.py') \
35bde798
IB
10 .load_module()
11
2e404903
IB
12excluded_and_hidden_modules = get_deps_minimal(
13 video=None,
14 camera=None,
15 audio=None,
16 clipboard=None,
17 spelling=None)
18
19excluded_and_hidden_modules['hiddenimports'] += [
20 'six',
21 'packaging',
22 'packaging.version',
23 'packaging.specifiers',
24 'packaging.requirements' ]
d8ab67c7 25
e257f4d9 26commit_message = setuptools_scm.get_version()
cc008de4
IB
27pyinstaller_file = open(".pyinstaller_commit", "w")
28pyinstaller_file.write(commit_message)
29pyinstaller_file.close()
30
35bde798 31data = [
6ebe6247 32 ('music_sampler/music_sampler.kv', '.'),
6a327173
IB
33 ('.pyinstaller_commit', '.'),
34 ('music_sampler/locales', 'locales')
35bde798
IB
35]
36
6ebe6247 37a = Analysis(['run.py'],
d8ab67c7 38 binaries=None,
35bde798 39 datas=data,
d8046b94
IB
40 hookspath=hookspath(),
41 runtime_hooks=runtime_hooks(),
42 **excluded_and_hidden_modules)
35bde798 43
dd25f8f0
IB
44fonts = [
45 ("Ubuntu", sysfont.STYLE_NORMAL),
46 ("Ubuntu", sysfont.STYLE_BOLD),
47 ("Symbola", sysfont.STYLE_NONE)
48]
49
50for fontname, style in fonts:
35bde798
IB
51 font = sysfont.get_font(fontname, style=style)
52 a.datas.append((
53 'fonts/{}_{}.ttf'.format(fontname, style),
54 font[4],
55 'DATA'
56 ))
57
d8046b94 58pyz = PYZ(a.pure, a.zipped_data)
1bf9e494
IB
59
60# Single file
2e404903
IB
61exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas,
62 name='music_sampler')
1bf9e494
IB
63
64# Directory
2e404903
IB
65# exe = EXE(pyz, a.scripts,
66# exclude_binaries=True,
67# name='music_sampler_dir',
68# debug=False,
69# strip=False,
70# upx=True,
71# console=True)
72# coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas,
73# strip=False,
74# upx=True,
75# name='music_sampler_dir')