]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - music_sampler.spec
Some documentation modifications
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler.spec
index a60c546c2dd7cfc5c9987e5adbeabddf1b358ff3..591a6cf0cae30da1e4e9ce8780db5cd9263bd938 100644 (file)
@@ -1,36 +1,52 @@
 # -*- mode: python -*-
+import os
+from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal,\
+        hookspath, runtime_hooks
 
-block_cipher = None
+excluded_and_hidden_modules = get_deps_minimal(
+        video=None,
+        camera=None,
+        audio=None,
+        clipboard=None,
+        spelling=None)
+
+excluded_and_hidden_modules['hiddenimports'] += [
+        'six',
+        'packaging',
+        'packaging.version',
+        'packaging.specifiers',
+        'packaging.requirements' ]
+
+commit_message = os.popen('git log -1 --format="%h  %ci"').read()
+pyinstaller_file = open(".pyinstaller_commit", "w")
+pyinstaller_file.write(commit_message)
+pyinstaller_file.close()
 
 a = Analysis(['music_sampler.py'],
              binaries=None,
              datas=[
-              ('config.yml', '.'),
-              ('Ubuntu-Regular.ttf', '.'),
-              ('Symbola.ttf', '.')
-             ],
-             hiddenimports=[
-               'six',
-               'packaging',
-               'packaging.version',
-               'packaging.specifiers',
-               'packaging.requirements'
+              ('fonts/*', 'fonts'),
+              ('music_sampler.kv', '.'),
+              ('.pyinstaller_commit', '.')
              ],
-             hookspath=[],
-             runtime_hooks=[],
-             excludes=[],
-             win_no_prefer_redirects=False,
-             win_private_assemblies=False,
-             cipher=block_cipher)
-pyz = PYZ(a.pure, a.zipped_data,
-             cipher=block_cipher)
-exe = EXE(pyz,
-          a.scripts,
-          a.binaries,
-          a.zipfiles,
-          a.datas,
-          name='music_sampler',
-          debug=False,
-          strip=False,
-          upx=True,
-          console=True )
+             hookspath=hookspath(),
+             runtime_hooks=runtime_hooks(),
+             **excluded_and_hidden_modules)
+pyz = PYZ(a.pure, a.zipped_data)
+
+# Single file
+exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas,
+        name='music_sampler')
+
+# Directory
+# exe = EXE(pyz, a.scripts,
+#     exclude_binaries=True,
+#     name='music_sampler_dir',
+#     debug=False,
+#     strip=False,
+#     upx=True,
+#     console=True)
+# coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas,
+#     strip=False,
+#     upx=True,
+#     name='music_sampler_dir')