-
Notifications
You must be signed in to change notification settings - Fork 0
/
bindingoffenrir.spec
65 lines (54 loc) · 1.62 KB
/
bindingoffenrir.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- mode: python -*-
#
# To build executable: $ pyinstaller bindingoffenrir.spec
# Write build / version information into executable.
import os
import datetime
builddatefile = os.path.join('resources', 'builddate')
with open(builddatefile, 'w') as f:
f.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
NAME = 'bindingoffenrir'
ASSETS = [('resources', 'resources')]
CODE = ['bindingoffenrir/main.py']
DEBUG = False
CONSOLE = DEBUG
# Write runtime options into executable.
# NOTE this is reverted at end of this file.
fullscreenfile = None
if os.getenv('FULLSCREEN') == 'true':
fullscreenfile = os.path.join(NAME, 'fullscreen.py')
with open(fullscreenfile, 'w') as f:
f.write('ENABLED = True\n')
# PyInstaller configuration below
block_cipher = None
a = Analysis(CODE,
pathex=['.'],
binaries=[],
datas=ASSETS,
hiddenimports=['pygame'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=NAME,
debug=DEBUG,
bootloader_ignore_signals=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=CONSOLE)
# Revert runtime options.
if fullscreenfile:
with open(fullscreenfile, 'w') as f:
f.write('ENABLED = False\n')