]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blame_incremental - music_sampler.spec
Add Unfocused overlay when focus is lost
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler.spec
... / ...
CommitLineData
1# -*- mode: python -*-
2import os
3import setuptools_scm
4from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal,\
5 hookspath, runtime_hooks
6
7import importlib.machinery
8sysfont = importlib.machinery\
9 .SourceFileLoader('sysfont', os.getcwd()+'/music_sampler/sysfont.py') \
10 .load_module()
11
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' ]
25
26commit_message = setuptools_scm.get_version()
27pyinstaller_file = open(".pyinstaller_commit", "w")
28pyinstaller_file.write(commit_message)
29pyinstaller_file.close()
30
31data = [
32 ('music_sampler/music_sampler.kv', '.'),
33 ('.pyinstaller_commit', '.')
34]
35
36a = Analysis(['run.py'],
37 binaries=None,
38 datas=data,
39 hookspath=hookspath(),
40 runtime_hooks=runtime_hooks(),
41 **excluded_and_hidden_modules)
42
43fonts = [
44 ("Ubuntu", sysfont.STYLE_NORMAL),
45 ("Ubuntu", sysfont.STYLE_BOLD),
46 ("Symbola", sysfont.STYLE_NONE)
47]
48
49for fontname, style in fonts:
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
57pyz = PYZ(a.pure, a.zipped_data)
58
59# Single file
60exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas,
61 name='music_sampler')
62
63# Directory
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')