]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame - music_sampler.spec
Add config
[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'],
35bde798 38 datas=data,
d8046b94
IB
39 hookspath=hookspath(),
40 runtime_hooks=runtime_hooks(),
41 **excluded_and_hidden_modules)
35bde798 42
dd25f8f0
IB
43fonts = [
44 ("Ubuntu", sysfont.STYLE_NORMAL),
45 ("Ubuntu", sysfont.STYLE_BOLD),
46 ("Symbola", sysfont.STYLE_NONE)
47]
48
49for fontname, style in fonts:
35bde798
IB
50 font = sysfont.get_font(fontname, style=style)
51 a.datas.append((
52 'fonts/{}_{}.ttf'.format(fontname, style),
53 font[4],
54 'DATA'
55 ))
56
d8046b94 57pyz = PYZ(a.pure, a.zipped_data)
1bf9e494
IB
58
59# Single file
2e404903
IB
60exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas,
61 name='music_sampler')
1bf9e494
IB
62
63# Directory
2e404903
IB
64# exe = EXE(pyz, a.scripts,
65# exclude_binaries=True,
66# name='music_sampler_dir',
67# debug=False,
68# strip=False,
69# upx=True,
70# console=True)
71# coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas,
72# strip=False,
73# upx=True,
74# name='music_sampler_dir')