-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.spec
80 lines (69 loc) · 1.94 KB
/
build.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*- mode: python ; coding: utf-8 -*-
import os
import sys
import platform
# Add current directory to Python path
sys.path.insert(0, os.getcwd())
ffmpeg_bin = os.path.join(os.curdir, 'main', 'resources', 'ffmpeg-bin')
alass_bin = os.path.join(os.curdir, 'main', 'resources', 'alass-bin')
ffsubsync_bin = os.path.join(os.curdir, 'main', 'resources', 'ffsubsync-bin')
datas = [
(os.path.join(os.curdir, 'main', 'resources', 'config.json'), '.'),
(os.path.join(os.curdir, 'main', 'VERSION'), '.'),
(os.path.join(os.curdir, 'main', 'settings.png'), '.'),
(os.path.join(os.curdir, 'main', 'icon.ico'), '.')
]
with open('main/VERSION', 'r') as f:
version = f.read().strip()
# Only import VSVersionInfo on Windows, because it gives error when building in other OS's.
if platform.system() == 'Windows':
from main.version import VSVersionInfo
else:
VSVersionInfo = version
folder_name = f'AutoSubSync-v{version}'
a = Analysis(
['main/AutoSubSync.pyw'],
pathex=[],
binaries=[
(ffmpeg_bin, 'resources/ffmpeg-bin'),
(alass_bin, 'resources/alass-bin'),
(ffsubsync_bin, 'resources/ffsubsync-bin'),
],
datas=datas,
hiddenimports=[],
hookspath=['main/resources/hooks'],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='AutoSubSync',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=os.path.join(os.curdir, 'main', 'icon.ico'),
version=VSVersionInfo
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name=folder_name,
)