-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_clipper_beta.py
More file actions
executable file
·35 lines (26 loc) · 1.15 KB
/
Copy pathbuild_clipper_beta.py
File metadata and controls
executable file
·35 lines (26 loc) · 1.15 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
"""Build the self-contained backend/FFmpeg sidecars required by Tauri."""
from __future__ import annotations
import shutil
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent
BINARIES = ROOT / "frontend" / "src-tauri" / "binaries"
TRIPLE = "x86_64-pc-windows-msvc"
def _require_tool(name: str) -> Path:
resolved = shutil.which(name)
if not resolved:
raise RuntimeError(f"{name} is required to build the tester package")
return Path(resolved)
def main() -> None:
BINARIES.mkdir(parents=True, exist_ok=True)
subprocess.check_call([sys.executable, "-m", "PyInstaller", "ClipperBackend.spec", "--clean", "--noconfirm"], cwd=ROOT)
backend = ROOT / "dist" / "instaclip-backend.exe"
if not backend.exists():
raise RuntimeError(f"PyInstaller did not create {backend}")
shutil.copy2(backend, BINARIES / f"instaclip-backend-{TRIPLE}.exe")
shutil.copy2(_require_tool("ffmpeg"), BINARIES / f"ffmpeg-{TRIPLE}.exe")
shutil.copy2(_require_tool("ffprobe"), BINARIES / f"ffprobe-{TRIPLE}.exe")
print(f"Prepared clipper sidecars in {BINARIES}")
if __name__ == "__main__":
main()