#!/usr/bin/env bash # Fetches the helper binaries FlightTube ships as Tauri sidecars. # # They are not in git — together they are about 140MB. Run this once before # building, or after changing the target architecture. set -euo pipefail TRIPLE="${1:-aarch64-apple-darwin}" DEST="$(cd "$(dirname "$0")/.." && pwd)/src-tauri/binaries" TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT mkdir -p "$DEST" echo "Fetching yt-dlp (official GitHub release)…" curl -fsSL -o "$TMP/yt-dlp" \ https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos # Static arm64 builds; Homebrew's ffmpeg links a dozen dylibs and cannot be # relocated into an app bundle. for tool in ffmpeg ffprobe; do echo "Fetching $tool (static, osxexperts.net)…" curl -fsSL -A "Mozilla/5.0" -o "$TMP/$tool.zip" "https://www.osxexperts.net/${tool}9arm.zip" unzip -o -q "$TMP/$tool.zip" -d "$TMP" done for tool in yt-dlp ffmpeg ffprobe; do install -m 0755 "$TMP/$tool" "$DEST/$tool-$TRIPLE" echo " -> $DEST/$tool-$TRIPLE" done echo "Done. Verifying they run:" for tool in yt-dlp ffmpeg ffprobe; do "$DEST/$tool-$TRIPLE" -version 2>/dev/null | head -1 || \ "$DEST/$tool-$TRIPLE" --version 2>/dev/null | head -1 done