# Downloads libmpv for Windows into vendor/mpv/windows. # Source: https://github.com/shinchiro/mpv-winbuild-cmake (the builds linked from mpv.io). param([string]$Tag = "20261021", [string]$Build = "mpv-dev-x86_64-20261021-git-e471496c56") $ErrorActionPreference = "Stop" $root = Split-Path -Parent $PSScriptRoot $dest = Join-Path $root "vendor\mpv\windows" if (Test-Path (Join-Path $dest "libmpv-2.dll")) { Write-Host "libmpv already present in $dest"; exit 0 } $tmp = Join-Path ([IO.Path]::GetTempPath()) ("kaleido-mpv-" + [guid]::NewGuid()) New-Item -ItemType Directory -Force $tmp, $dest | Out-Null $archive = Join-Path $tmp "mpv-dev.7z" Invoke-WebRequest "https://github.com/shinchiro/mpv-winbuild-cmake/releases/download/$Tag/$Build.7z" -OutFile $archive & 7z x $archive "-o$tmp\x" -y | Out-Null Copy-Item "$tmp\x\libmpv-2.dll" $dest Remove-Item -Recurse -Force $tmp Write-Host "libmpv installed to $dest"