#!/usr/bin/env bash # Rebuilds Arch's ffmpeg package from source so it links against the installed # svt-av1-essential-git instead of the repo svt-av1 it was built with. # # Re-run this after a `pacman -Syu` that updates ffmpeg, otherwise the repo # build replaces this one. set -euo pipefail if ! pacman -Qq svt-av1-essential-git >/dev/null 2>&1; then echo "svt-av1-essential-git is not installed; nothing to rebuild against." >&2 exit 1 fi build="$(mktemp -d)" trap 'rm -rf "$build"' EXIT git clone --depth 1 https://gitlab.archlinux.org/archlinux/packaging/packages/ffmpeg.git "$build/ffmpeg" cd "$build/ffmpeg" # The PKGBUILD verifies a signed ffmpeg tag; makepkg won't fetch the keys itself mapfile -t keys < <(source ./PKGBUILD && printf '%s\n' "${validpgpkeys[@]}") if (( ${#keys[@]} )); then gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys "${keys[@]}" fi # No --needed: the version matches what's installed, we want it replaced anyway makepkg --syncdeps --install --cleanbuild --noconfirm