X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git;a=blobdiff_plain;f=music_sampler.spec;h=0d99dca2caefcc67238169feeb09ab7fdcf94b1a;hp=591a6cf0cae30da1e4e9ce8780db5cd9263bd938;hb=35bde798b6cda13579337b0ec5a803fdd5eab19a;hpb=cfde9820184a3b70c70bcf396c396a4c64fa9a39 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 from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal,\ hookspath, runtime_hooks +import importlib.machinery +sysfont = importlib.machinery\ + .SourceFileLoader('sysfont', os.getcwd() + '/helpers/sysfont.py') \ + .load_module() + excluded_and_hidden_modules = get_deps_minimal( video=None, camera=None, @@ -22,16 +27,26 @@ pyinstaller_file = open(".pyinstaller_commit", "w") pyinstaller_file.write(commit_message) pyinstaller_file.close() +data = [ + ('music_sampler.kv', '.'), + ('.pyinstaller_commit', '.') +] + a = Analysis(['music_sampler.py'], binaries=None, - datas=[ - ('fonts/*', 'fonts'), - ('music_sampler.kv', '.'), - ('.pyinstaller_commit', '.') - ], + datas=data, hookspath=hookspath(), runtime_hooks=runtime_hooks(), **excluded_and_hidden_modules) + +for fontname, style in [("Ubuntu", sysfont.STYLE_NORMAL), ("Ubuntu", sysfont.STYLE_BOLD), ("Symbola", sysfont.STYLE_NONE)]: + font = sysfont.get_font(fontname, style=style) + a.datas.append(( + 'fonts/{}_{}.ttf'.format(fontname, style), + font[4], + 'DATA' + )) + pyz = PYZ(a.pure, a.zipped_data) # Single file