#!/usr/bin/env bash
# 把自建的干净 mpv/FFmpeg xcframework 铺进 vendor（构建前跑一次）。
# 源默认取 ~/Daily/serifu-mpv-build/xcframeworks；可用 SERIFU_MPV_ZIPS 覆盖。
# 全套重建配方见 docs/reports/2026-07-13-b1-mpv-clean-build.md。
set -euo pipefail
SRC="${SERIFU_MPV_ZIPS:-$HOME/Daily/serifu-mpv-build/xcframeworks}"
DEST="$(cd "$(dirname "$0")" && pwd)/MPVKit/xcframeworks"
[ -d "$SRC" ] || { echo "找不到 xcframework zip 源：$SRC（设 SERIFU_MPV_ZIPS 或重建）"; exit 1; }
mkdir -p "$DEST"; rm -rf "$DEST"/*.xcframework
for z in "$SRC"/*.xcframework.zip; do unzip -q -o "$z" -d "$DEST"; done
echo "铺开完成：$(ls "$DEST" | tr '\n' ' ')"
