# macOS용 ffmpeg/ffprobe 사이드카 — arm64 + x64를 받아 lipo로 universal 생성. # CI(macos-14)에서 실행. 실패 시 개별 아키텍처 바이너리라도 배치한다. # 참고: Martin Riedl 빌드(ffmpeg.martin-riedl.de) — 서명·공증됨. $ErrorActionPreference = "Stop" $root = Split-Path $PSScriptRoot -Parent $binDir = Join-Path $root "src-tauri/binaries" New-Item -ItemType Directory -Force $binDir | Out-Null # Riedl 최신 릴리스 API (arm64/amd64 각각 ffmpeg/ffprobe zip) $api = "https://ffmpeg.martin-riedl.de/api/v1/latest" $release = Invoke-RestMethod $api function Get-Tool($arch, $tool) { $tmp = Join-Path ([System.IO.Path]::GetTempPath()) "ff-$arch-$tool" New-Item -ItemType Directory -Force $tmp | Out-Null $entry = $release.$tool.$arch if (-not $entry) { throw "$tool/$arch 다운로드 정보 없음" } $zip = Join-Path $tmp "$tool.zip" Invoke-WebRequest $entry.url -OutFile $zip Expand-Archive $zip -DestinationPath $tmp -Force $bin = Get-ChildItem $tmp -Recurse -Filter $tool | Select-Object -First 1 return $bin.FullName } foreach ($tool in @("ffmpeg", "ffprobe")) { $arm = Get-Tool "arm64" $tool $x64 = Get-Tool "amd64" $tool $out = Join-Path $binDir "$tool-universal-apple-darwin" # lipo로 universal 결합 & lipo -create $arm $x64 -output $out & chmod +x $out Write-Host "[fetch-ffmpeg-macos] $out (universal)" }