-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
audiotext.spec
122 lines (106 loc) · 2.96 KB
/
audiotext.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
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
# -*- mode: python ; coding: utf-8 -*-
from pathlib import Path
from PyInstaller.compat import is_darwin, is_win
import shutil
import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)
def find_site_packages(venv_dir = "venv"):
venv_path = Path(venv_dir)
for site_packages in venv_path.rglob("site-packages"):
if site_packages.is_dir():
return site_packages
return None
site_packages_path = find_site_packages()
datas = [
(f"{site_packages_path}/customtkinter", "customtkinter"),
(f"{site_packages_path}/transformers", "transformers"),
(f"{site_packages_path}/lightning", "lightning"),
(f"{site_packages_path}/lightning_fabric", "lightning_fabric"),
(f"{site_packages_path}/speechbrain", "speechbrain"),
(f"{site_packages_path}/pyannote", "pyannote"),
(f"{site_packages_path}/asteroid_filterbanks", "asteroid_filterbanks"),
(f"{site_packages_path}/whisperx", "whisperx"),
(f"{site_packages_path}/librosa", "librosa"),
("res", "res"),
("config.ini", "."),
(".env", "."),
]
hiddenimports = [
"huggingface_hub.repository",
"sklearn.utils._cython_blas",
"sklearn.neighbors.quad_tree",
"sklearn.tree",
"sklearn.tree._utils",
]
block_cipher = None
is_debug = False
if is_debug:
options = [("v", None, "OPTION")]
else:
options = []
binaries = [
(shutil.which("ffmpeg"), "."),
(shutil.which("ffprobe"), "."),
]
if flac_path := shutil.which("flac"):
binaries += [(flac_path, ".")]
a = Analysis(
["src/app.py"],
pathex=[site_packages_path],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
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)
macos_icon = "res/macos/icon.icns"
windows_icon = "res/windows/icon.ico"
exe = EXE(
pyz,
a.scripts,
options,
exclude_binaries=True,
name="Audiotext",
debug=is_debug,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=is_debug,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file="res/macos/entitlements.plist" if is_darwin else None,
icon=windows_icon if is_win else macos_icon,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="Audiotext",
)
app = BUNDLE(
coll,
name="Audiotext.app",
icon=macos_icon,
bundle_identifier="com.henestrosadev.audiotext",
version="2.3.0",
info_plist={
"NSPrincipalClass": "NSApplication",
"NSAppleScriptEnabed": False,
"NSHighResolutionCapable": True,
"NSMicrophoneUsageDescription": "Allow Audiotext to record audio from your microphone to generate transcriptions.",
}
)