diff options
Diffstat (limited to 'music_sampler.spec')
-rw-r--r-- | music_sampler.spec | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/music_sampler.spec b/music_sampler.spec index 591a6cf..0d99dca 100644 --- a/music_sampler.spec +++ b/music_sampler.spec | |||
@@ -3,6 +3,11 @@ import os | |||
3 | from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal,\ | 3 | from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal,\ |
4 | hookspath, runtime_hooks | 4 | hookspath, runtime_hooks |
5 | 5 | ||
6 | import importlib.machinery | ||
7 | sysfont = importlib.machinery\ | ||
8 | .SourceFileLoader('sysfont', os.getcwd() + '/helpers/sysfont.py') \ | ||
9 | .load_module() | ||
10 | |||
6 | excluded_and_hidden_modules = get_deps_minimal( | 11 | excluded_and_hidden_modules = get_deps_minimal( |
7 | video=None, | 12 | video=None, |
8 | camera=None, | 13 | camera=None, |
@@ -22,16 +27,26 @@ pyinstaller_file = open(".pyinstaller_commit", "w") | |||
22 | pyinstaller_file.write(commit_message) | 27 | pyinstaller_file.write(commit_message) |
23 | pyinstaller_file.close() | 28 | pyinstaller_file.close() |
24 | 29 | ||
30 | data = [ | ||
31 | ('music_sampler.kv', '.'), | ||
32 | ('.pyinstaller_commit', '.') | ||
33 | ] | ||
34 | |||
25 | a = Analysis(['music_sampler.py'], | 35 | a = Analysis(['music_sampler.py'], |
26 | binaries=None, | 36 | binaries=None, |
27 | datas=[ | 37 | datas=data, |
28 | ('fonts/*', 'fonts'), | ||
29 | ('music_sampler.kv', '.'), | ||
30 | ('.pyinstaller_commit', '.') | ||
31 | ], | ||
32 | hookspath=hookspath(), | 38 | hookspath=hookspath(), |
33 | runtime_hooks=runtime_hooks(), | 39 | runtime_hooks=runtime_hooks(), |
34 | **excluded_and_hidden_modules) | 40 | **excluded_and_hidden_modules) |
41 | |||
42 | for fontname, style in [("Ubuntu", sysfont.STYLE_NORMAL), ("Ubuntu", sysfont.STYLE_BOLD), ("Symbola", sysfont.STYLE_NONE)]: | ||
43 | font = sysfont.get_font(fontname, style=style) | ||
44 | a.datas.append(( | ||
45 | 'fonts/{}_{}.ttf'.format(fontname, style), | ||
46 | font[4], | ||
47 | 'DATA' | ||
48 | )) | ||
49 | |||
35 | pyz = PYZ(a.pure, a.zipped_data) | 50 | pyz = PYZ(a.pure, a.zipped_data) |
36 | 51 | ||
37 | # Single file | 52 | # Single file |