-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.py
More file actions
732 lines (614 loc) · 25.8 KB
/
build.py
File metadata and controls
732 lines (614 loc) · 25.8 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
import sys
import os
import subprocess
import platform
import zipfile
import tarfile
import importlib
import json
import ast
import shutil
import urllib.request
import stat
# =============================================================================
# Constants and Configuration
# =============================================================================
script_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(script_dir)
CURRENT_PLATFORM = platform.system()
IS_WINDOWS = CURRENT_PLATFORM == "Windows"
IS_MACOS = CURRENT_PLATFORM == "Darwin"
IS_LINUX = CURRENT_PLATFORM == "Linux"
# AppImage tool URL for Linux
APPIMAGETOOL_URL = "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
# Add main directory to Python path to import constants and utils
sys.path.insert(0, os.path.join(script_dir, "main"))
def get_arch():
"""Get normalized architecture name for file naming.
Returns:
tuple: (arch, native_arch) where arch is the normalized name (amd64/arm64)
and native_arch is the platform's native name (x86_64/aarch64)
"""
native_arch = platform.machine().lower()
if native_arch in ("x86_64", "amd64"):
return "amd64", "x86_64"
elif native_arch in ("aarch64", "arm64"):
return "arm64", "aarch64"
else:
return native_arch, native_arch
def check_modules():
required_modules = ["pip", "venv"]
for module in required_modules:
try:
importlib.import_module(module)
except ImportError:
if module == "pip":
sys.stderr.write(
"Module 'pip' is not installed. Please install it using your system's package manager.\n"
)
sys.stderr.write(
"Debian: sudo apt-get install python3-pip python3-venv\n"
)
sys.stderr.write("Arch Linux: sudo pacman -S python python-pip\n")
sys.stderr.write("Fedora: sudo dnf install python3-pip python3-venv\n")
sys.stderr.write("macOS: brew install python3\n")
sys.exit(1)
elif module == "venv":
sys.stderr.write(
"Module 'venv' is not installed. Please install it using your system's package manager.\n"
)
sys.stderr.write(
"Debian: sudo apt-get install python3-pip python3-venv\n"
)
sys.stderr.write("Arch Linux: sudo pacman -S python python-pip\n")
sys.stderr.write("Fedora: sudo dnf install python3-pip python3-venv\n")
sys.stderr.write("macOS: brew install python3\n")
sys.exit(1)
print("All required modules are installed.")
def create_virtualenv():
if not os.path.exists("venv"):
print("Creating virtual environment...")
completed_process = subprocess.run(
[sys.executable, "-m", "venv", "venv"], text=True
)
if completed_process.returncode != 0:
print("Error creating virtual environment.")
sys.exit(completed_process.returncode)
print("Virtual environment created.")
else:
print("Virtual environment already exists. Skipping creation.")
def install_requirements():
print("Installing requirements from pyproject.toml...")
if IS_WINDOWS:
pip_executable = "venv\\Scripts\\pip"
else:
pip_executable = "venv/bin/pip"
# Install package in editable mode with dev dependencies from pyproject.toml
completed_process = subprocess.run(
[pip_executable, "install", "-e", ".[dev]", "--upgrade"],
text=True,
)
if completed_process.returncode != 0:
print("Error installing requirements.")
sys.exit(completed_process.returncode)
print("Requirements installed.")
def remove_webrtcvad_hook():
if IS_WINDOWS:
hook_path = os.path.join(
"venv",
"Lib",
"site-packages",
"_pyinstaller_hooks_contrib",
"stdhooks",
"hook-webrtcvad.py",
)
if os.path.exists(hook_path):
try:
os.remove(hook_path)
print(f"Removed: {hook_path}")
except Exception as e:
print(f"Failed to remove {hook_path}: {e}")
else:
print(f"File not found, skipping: {hook_path}")
def ensure_ffmpeg():
apps = ["ffmpeg", "ffprobe"]
exe = ".exe" if IS_WINDOWS else ""
ffmpeg_dir = "main/resources/ffmpeg-bin"
if not all(os.path.exists(os.path.join(ffmpeg_dir, app + exe)) for app in apps):
print("FFmpeg executables not found, running ffmpeg_download.py...")
if IS_WINDOWS:
python_executable = "venv\\Scripts\\python"
else:
python_executable = "venv/bin/python"
if (
subprocess.run(
[python_executable, "main/resources/ffmpeg_download.py"], text=True
).returncode
!= 0
):
print("Error downloading FFmpeg.")
sys.exit(1)
print("FFmpeg downloaded.")
else:
print("FFmpeg executables already exist. Skipping download.")
def get_version_info(module_name):
"""Return a version information of package using the venv Python."""
if IS_WINDOWS:
python_executable = os.path.join("venv", "Scripts", "python.exe")
else:
python_executable = os.path.join("venv", "bin", "python")
try:
result = subprocess.run(
[
python_executable,
"-c",
f"import importlib.metadata; print(importlib.metadata.version('{module_name}'))",
],
capture_output=True,
text=True,
)
if result.returncode == 0:
return result.stdout.strip()
else:
return "0.0"
except Exception:
return "0.0"
def get_autosubsync_version():
try:
with open(os.path.join("main", "VERSION"), "r") as f:
version = f.read().strip()
print("Detected AutoSubSync version: " + version)
return version
except Exception as e:
print(f"Error reading AutoSubSync version: {e}")
return "unknown"
def get_ffmpeg_version():
try:
ffmpeg_path = os.path.join("main", "resources", "ffmpeg-bin", "ffmpeg.exe")
result = subprocess.run(
[ffmpeg_path, "-version"], capture_output=True, text=True
)
first_line = result.stdout.split("\n")[0]
# Extract version number from "ffmpeg version X.X.X-static"
version_part = first_line.split(" ")[2] # Get the third part
version = version_part.split("-")[0] # Remove "-static" or other suffixes
print("Detected FFmpeg version: " + version)
return version
except:
return "unknown"
def get_sync_tools_names_from_constants():
"""Parse constants.py using ast to extract SYNC_TOOLS dictionary top-level keys as a list of tool names."""
constants_path = os.path.join(script_dir, "main", "constants.py")
with open(constants_path, "r", encoding="utf-8") as f:
content = f.read()
tree = ast.parse(content, filename=constants_path)
for node in ast.walk(tree):
if isinstance(node, ast.Assign):
for target in node.targets:
if isinstance(target, ast.Name) and target.id == "SYNC_TOOLS":
if isinstance(node.value, ast.Dict):
tool_names = []
for key in node.value.keys:
if isinstance(key, ast.Constant) and isinstance(
key.value, str
):
tool_names.append(key.value)
return tool_names
return []
def get_sync_tools_versions():
"""Get versions of sync tools by parsing constants.py for tool names and using get_version_info or the version field for executables. Also extract github url if present."""
constants_path = os.path.join(script_dir, "main", "constants.py")
with open(constants_path, "r", encoding="utf-8") as f:
tree = ast.parse(f.read(), filename=constants_path)
sync_tools = {}
for node in ast.walk(tree):
if (
isinstance(node, ast.Assign)
and any(
isinstance(t, ast.Name) and t.id == "SYNC_TOOLS" for t in node.targets
)
and isinstance(node.value, ast.Dict)
):
for key, value in zip(node.value.keys, node.value.values):
if (
isinstance(key, ast.Constant)
and isinstance(key.value, str)
and isinstance(value, ast.Dict)
):
tool_name = key.value
tool_type = tool_version = github_url = None
for k, v in zip(value.keys, value.values):
if isinstance(k, ast.Constant):
if k.value == "type" and isinstance(v, ast.Constant):
tool_type = v.value
elif k.value == "version" and isinstance(v, ast.Constant):
tool_version = v.value
elif k.value == "github" and isinstance(v, ast.Constant):
github_url = v.value
sync_tools[tool_name] = {
"version": (
tool_version
if tool_type == "executable" and tool_version
else get_version_info(tool_name)
)
}
if github_url:
sync_tools[tool_name]["github"] = github_url
for tool_name, info in sync_tools.items():
print(f"Detected {tool_name} version: {info['version']}")
if "github" in info:
print(f" GitHub: {info['github']}")
return sync_tools
def check_versions():
if IS_WINDOWS:
versions = {
"AutoSubSync": get_autosubsync_version(),
"ffmpeg": get_ffmpeg_version(),
}
# Add sync tools versions
sync_tools_versions = get_sync_tools_versions()
if sync_tools_versions:
versions["sync_tools"] = sync_tools_versions
print("Writing versions to 'versions.json'...")
with open(os.path.join("main", "resources", "versions.json"), "w") as f:
json.dump(versions, f, indent=2)
else:
print("Skipping version check for non-Windows platform.")
def fix_macos_dylib_versions():
"""Fix macOS dylibs that lack proper SDK version info to prevent PyInstaller warnings."""
if not IS_MACOS:
return
print("Checking for problematic macOS dylibs...")
# Find dylibs in the virtual environment that may lack version info
venv_site_packages = os.path.join(script_dir, "venv", "lib")
# Find all dylib files
problematic_dylibs = []
for root, dirs, files in os.walk(venv_site_packages):
for file in files:
if file.endswith(".dylib"):
dylib_path = os.path.join(root, file)
# Check if the dylib has version info
try:
result = subprocess.run(
["otool", "-l", dylib_path], capture_output=True, text=True
)
# Check for LC_BUILD_VERSION or LC_VERSION_MIN_MACOSX
if (
"LC_BUILD_VERSION" not in result.stdout
and "LC_VERSION_MIN_MACOSX" not in result.stdout
):
problematic_dylibs.append(dylib_path)
except Exception as e:
print(f" Warning: Error checking {dylib_path}: {e}")
if not problematic_dylibs:
print("No problematic dylibs found.")
return
print(
f"Found {len(problematic_dylibs)} dylib(s) without version info. Attempting to fix..."
)
for dylib_path in problematic_dylibs:
try:
# Use vtool to add version info (available on macOS 11+)
# This adds LC_BUILD_VERSION with macOS 10.13 as minimum
result = subprocess.run(
[
"vtool",
"-set-build-version",
"macos",
"10.13",
"10.13",
"-replace",
"-output",
dylib_path,
dylib_path,
],
capture_output=True,
text=True,
)
if result.returncode == 0:
print(f" Fixed: {os.path.basename(dylib_path)}")
else:
print(
f" Warning: Could not fix {os.path.basename(dylib_path)}: {result.stderr}"
)
except FileNotFoundError:
# vtool not available, try alternative approach
print(
f" Warning: vtool not available, skipping {os.path.basename(dylib_path)}"
)
except Exception as e:
print(f" Warning: Error fixing {os.path.basename(dylib_path)}: {e}")
def build_with_pyinstaller():
print("Building with PyInstaller...")
if IS_WINDOWS:
pyinstaller_executable = "venv\\Scripts\\pyinstaller"
else:
pyinstaller_executable = "venv/bin/pyinstaller"
completed_process = subprocess.run(
[pyinstaller_executable, "--clean", "-y", "--dist", "./dist", "build.spec"],
text=True,
)
if completed_process.returncode != 0:
print("Error building with PyInstaller.")
sys.exit(completed_process.returncode)
print("Build completed.")
# =============================================================================
# Linux AppImage Packaging
# =============================================================================
def download_appimagetool():
"""Download appimagetool if not present."""
tools_dir = os.path.join(script_dir, "build_tools")
os.makedirs(tools_dir, exist_ok=True)
appimagetool_path = os.path.join(tools_dir, "appimagetool")
if os.path.exists(appimagetool_path):
print("appimagetool already exists.")
return appimagetool_path
print("Downloading appimagetool...")
try:
urllib.request.urlretrieve(APPIMAGETOOL_URL, appimagetool_path)
# Make executable
st = os.stat(appimagetool_path)
os.chmod(appimagetool_path, st.st_mode | stat.S_IEXEC)
print("appimagetool downloaded successfully.")
return appimagetool_path
except Exception as e:
print(f"Error downloading appimagetool: {e}")
return None
def create_appimage_structure(version):
"""Create the AppDir structure required for AppImage."""
appdir = os.path.join(script_dir, "dist", "AutoSubSync.AppDir")
# Clean up existing AppDir
if os.path.exists(appdir):
shutil.rmtree(appdir)
os.makedirs(appdir, exist_ok=True)
# Copy the built application directly to AppDir (flat structure for PyInstaller apps)
# PyInstaller outputs to dist/AutoSubSync/
pyinstaller_output = os.path.join(script_dir, "dist", "AutoSubSync")
if os.path.exists(pyinstaller_output):
for item in os.listdir(pyinstaller_output):
src = os.path.join(pyinstaller_output, item)
dst = os.path.join(appdir, item)
if os.path.isdir(src):
shutil.copytree(src, dst)
else:
shutil.copy2(src, dst)
else:
print(f"ERROR: PyInstaller output not found at {pyinstaller_output}")
return None
# Create AppRun script - simple launcher that runs the executable from AppDir
apprun_content = """#!/bin/bash
# AppRun script for AutoSubSync AppImage
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
# Set library path to find bundled libraries
export LD_LIBRARY_PATH="${HERE}:${LD_LIBRARY_PATH}"
# Execute the main application
exec "${HERE}/AutoSubSync" "$@"
"""
apprun_path = os.path.join(appdir, "AppRun")
with open(apprun_path, "w") as f:
f.write(apprun_content)
st = os.stat(apprun_path)
os.chmod(apprun_path, st.st_mode | stat.S_IEXEC)
# Create .desktop file (required by AppImage specification)
# Note: Version field in .desktop refers to Desktop Entry Spec version (1.0), not app version
# App version can be included in Comment or X-AppImage-Version
desktop_content = f"""[Desktop Entry]
Version=1.0
Name=AutoSubSync
GenericName=Automatic Subtitle Synchronizer
Exec=AutoSubSync %f
Icon=autosubsync
Type=Application
Categories=AudioVideo;Video;
Comment=Automatic subtitle synchronization tool.
Terminal=false
StartupWMClass=AutoSubSync
X-AppImage-Version={version}
"""
desktop_path = os.path.join(appdir, "AutoSubSync.desktop")
with open(desktop_path, "w") as f:
f.write(desktop_content)
# Copy PNG icon for AppImage (AppImage REQUIRES a PNG icon at the root of AppDir)
icon_png_src = os.path.join(script_dir, "main", "assets", "icon.png")
icon_dst = os.path.join(appdir, "autosubsync.png")
if os.path.exists(icon_png_src):
shutil.copy2(icon_png_src, icon_dst)
print("PNG icon copied to AppDir.")
# Create .DirIcon symlink (used by some file managers for folder icons)
diricon_path = os.path.join(appdir, ".DirIcon")
if os.path.exists(diricon_path) or os.path.islink(diricon_path):
os.remove(diricon_path)
os.symlink("autosubsync.png", diricon_path)
else:
print("ERROR: icon.png not found in main/assets/")
print(" AppImage will work but won't display an icon.")
return appdir
def build_appimage():
"""Build AppImage for Linux."""
with open("main/VERSION", "r") as f:
version = f.read().strip()
print("Building AppImage for Linux...")
# Download appimagetool if needed
appimagetool = download_appimagetool()
if not appimagetool:
print("Error: Could not obtain appimagetool. Falling back to tar.gz archive.")
return None
# Create AppDir structure
appdir = create_appimage_structure(version)
if appdir is None:
print(
"Error: Failed to create AppDir structure. Falling back to tar.gz archive."
)
return None
# Build the AppImage
arch, appimagetool_arch = get_arch()
appimage_name = f"AutoSubSync-linux-{arch}.AppImage"
appimage_path = os.path.join(script_dir, appimage_name)
# Remove existing AppImage if present
if os.path.exists(appimage_path):
os.remove(appimage_path)
print(f"Creating AppImage: {appimage_name}")
# Set ARCH environment variable for appimagetool (requires x86_64/aarch64 format)
env = os.environ.copy()
env["ARCH"] = appimagetool_arch
try:
completed_process = subprocess.run(
[appimagetool, "--appimage-extract-and-run", appdir, appimage_path],
text=True,
env=env,
capture_output=True,
)
if completed_process.returncode != 0:
print(f"appimagetool stderr: {completed_process.stderr}")
print("Error creating AppImage. Falling back to tar.gz archive.")
return None
print(f"AppImage created successfully: {appimage_name}")
print(f"Full path: {appimage_path}")
# Clean up AppDir
shutil.rmtree(appdir, ignore_errors=True)
return appimage_path
except Exception as e:
print(f"Error running appimagetool: {e}")
return None
# =============================================================================
# macOS .app Bundle Packaging
# =============================================================================
def sign_macos_app(app_path):
"""Ad-hoc sign the macOS app bundle to prevent Gatekeeper issues."""
print("Signing macOS application bundle (ad-hoc)...")
# First, clear any existing quarantine attributes
try:
subprocess.run(["xattr", "-cr", app_path], check=False)
print("Cleared extended attributes.")
except Exception as e:
print(f"Warning: Could not clear xattr: {e}")
# Ad-hoc sign the app bundle with deep signing and force
# This signs all nested code (frameworks, helpers, etc.)
try:
result = subprocess.run(
["codesign", "--force", "--deep", "--sign", "-", app_path],
capture_output=True,
text=True,
)
if result.returncode == 0:
print("App bundle signed successfully (ad-hoc).")
return True
else:
print(f"Warning: Code signing failed: {result.stderr}")
return False
except FileNotFoundError:
print("Warning: codesign not found. App may trigger Gatekeeper warnings.")
return False
except Exception as e:
print(f"Warning: Code signing error: {e}")
return False
def package_macos_app():
"""Package macOS .app bundle into a ZIP using ditto to preserve permissions and signatures."""
with open("main/VERSION", "r") as f:
version = f.read().strip()
print("Packaging macOS application bundle...")
app_path = os.path.join(script_dir, "dist", "AutoSubSync.app")
if not os.path.exists(app_path):
print(f"Error: Application bundle not found at {app_path}")
return None
# Sign the app bundle before packaging
sign_macos_app(app_path)
arch, _ = get_arch()
# Create a ZIP archive of the .app bundle using ditto
# ditto preserves macOS-specific attributes, permissions, and code signatures
zip_name = f"AutoSubSync-macos-{arch}.zip"
zip_path = os.path.join(script_dir, zip_name)
# Remove existing zip if present
if os.path.exists(zip_path):
os.remove(zip_path)
print(f"Creating ZIP archive: {zip_name}")
# Use ditto to create the ZIP - this preserves permissions, symlinks, and signatures
try:
result = subprocess.run(
[
"ditto",
"-c",
"-k",
"--sequesterRsrc",
"--keepParent",
app_path,
zip_path,
],
capture_output=True,
text=True,
)
if result.returncode != 0:
print(f"Error creating ZIP with ditto: {result.stderr}")
return None
except FileNotFoundError:
print("Error: ditto command not found. This should only run on macOS.")
return None
print(f"ZIP archive created: {zip_name}")
print(f"Full path: {zip_path}")
return zip_path
# =============================================================================
# Windows Packaging
# =============================================================================
def package_windows():
"""Package Windows build into a ZIP archive."""
print("Packaging Windows application...")
# The build output is in dist/AutoSubSync/
dist_dir = os.path.join("dist", "AutoSubSync")
arch, _ = get_arch()
zip_name = f"AutoSubSync-windows-{arch}.zip"
with zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED) as zipf:
for root, _, files in os.walk(dist_dir):
for file in files:
file_path = os.path.join(root, file)
# Files go directly into ZIP root, no subfolder
arcname = os.path.relpath(file_path, dist_dir)
zipf.write(file_path, arcname)
print(f"ZIP archive created: {zip_name}")
print(f"Full path: {os.path.abspath(zip_name)}")
return zip_name
# =============================================================================
# Archive Creation (Platform-Specific)
# =============================================================================
def create_archive():
"""Create platform-specific archive/package."""
print("Creating platform-specific package...")
with open("main/VERSION", "r") as f:
version = f.read().strip()
if IS_LINUX:
# Try to create AppImage, fall back to tar.gz
result = build_appimage()
if result is None:
print("Falling back to tar.gz archive...")
create_linux_tarball(version)
elif IS_MACOS:
# Package .app bundle
package_macos_app()
else:
# Windows
package_windows()
def create_linux_tarball(version):
"""Create a tar.gz archive for Linux (fallback if AppImage fails)."""
# The build output is in dist/AutoSubSync/
dist_dir = os.path.join("dist", "AutoSubSync")
arch, _ = get_arch()
tar_name = f"AutoSubSync-linux-{arch}.tar.gz"
with tarfile.open(tar_name, "w:gz") as tar:
for root, _, files in os.walk(dist_dir):
for file in files:
file_path = os.path.join(root, file)
# Files go directly into tar root, no subfolder
arcname = os.path.relpath(file_path, dist_dir)
tar.add(file_path, arcname=arcname)
print(f"Tar.gz archive created: {tar_name}")
print(f"Full path: {os.path.abspath(tar_name)}")
if __name__ == "__main__":
check_modules()
create_virtualenv()
install_requirements()
remove_webrtcvad_hook()
ensure_ffmpeg()
check_versions()
fix_macos_dylib_versions()
build_with_pyinstaller()
create_archive()