Repository navigation
Expand file tree
/
Copy pathVideoCaptioner.spec
More file actions
131 lines (115 loc) · 2.79 KB
/
Copy pathVideoCaptioner.spec
File metadata and controls
131 lines (115 loc) · 2.79 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller build recipe for the VideoCaptioner desktop bundle."""
import os
import sys
from pathlib import Path
from PyInstaller.utils.hooks import collect_submodules
block_cipher = None
ROOT = Path(SPECPATH)
RUNTIME_DIR = Path(os.environ.get("VIDEOCAPTIONER_DESKTOP_RUNTIME_DIR", ROOT / "build" / "desktop-runtime"))
def _data(src: Path, dest: str):
return (str(src), dest)
datas = [
_data(ROOT / "resource" / "assets", "resource/assets"),
_data(ROOT / "resource" / "fonts", "resource/fonts"),
_data(ROOT / "resource" / "subtitle_style", "resource/subtitle_style"),
_data(ROOT / "resource" / "translations", "resource/translations"),
_data(ROOT / "videocaptioner" / "core" / "prompts", "videocaptioner/core/prompts"),
]
runtime_bin = RUNTIME_DIR / "resource" / "bin"
if runtime_bin.exists():
datas.append(_data(runtime_bin, "resource/bin"))
hiddenimports = [
"PyQt5",
"PyQt5.QtCore",
"PyQt5.QtGui",
"PyQt5.QtWidgets",
"PyQt5.QtMultimedia",
"PyQt5.QtMultimediaWidgets",
"PyQt5.QtSvg",
"PyQt5.sip",
"openai",
"requests",
"edge_tts",
"diskcache",
"yt_dlp",
"modelscope",
"psutil",
"json_repair",
"langdetect",
"pydub",
"tenacity",
"GPUtil",
"PIL",
"PIL.Image",
"PIL.ImageDraw",
"PIL.ImageFont",
"fontTools",
"fontTools.ttLib",
]
hiddenimports += collect_submodules("qfluentwidgets")
excludes = [
"tkinter",
"matplotlib",
"scipy",
"numpy.testing",
"pytest",
"pyright",
"ruff",
"test",
"unittest",
]
a = Analysis(
[str(ROOT / "videocaptioner" / "__main__.py")],
pathex=[str(ROOT)],
binaries=[],
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=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,
[],
exclude_binaries=True,
name="VideoCaptioner",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="VideoCaptioner",
)
if sys.platform == "darwin":
app = BUNDLE(
coll,
name="VideoCaptioner.app",
bundle_identifier="com.weifeng.videocaptioner",
info_plist={
"CFBundleName": "VideoCaptioner",
"CFBundleDisplayName": "VideoCaptioner",
"NSHighResolutionCapable": True,
},
)