From 07b5b164d9d3f654a17ea5ed1d416b3e324c334a Mon Sep 17 00:00:00 2001 From: Benjamin Lupton Date: Tue, 21 Nov 2023 11:43:18 +0800 Subject: [PATCH] setup-mac-brew: fix latest ffmpeg install failure --- commands/setup-mac-brew | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/commands/setup-mac-brew b/commands/setup-mac-brew index e39e48da8..7aa17fda4 100755 --- a/commands/setup-mac-brew +++ b/commands/setup-mac-brew @@ -38,6 +38,22 @@ function setup_mac_brew() ( chromaprint lescanauxdiscrets/tap/zvbi ) + local HOMEBREW_ENCODING_REMOVE_OPTIONS=( + # Resolved: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/81#issuecomment-828722622 + # Fails: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/96#issuecomment-1398315717 + --with-librsvg + # Fails: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/92 + --with-decklink + # Fails: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/37#issuecomment-958018136 + --with-game-music-emu + # Fails: Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "zvbi". + --with-libzvbi + # Fails: ERROR: libflite not found + --with-libflite + # Fails: Unknown option "--enable-openvino". + --enable-openvino + --with-openvino + ) # Deprecated configurations: local SETUP_UTILS=() # for configuration adjustments local HOMEBREW_INSTALL_ENCODING='' # deprecated, replaced by HOMEBREW_ENCODING_INSTALL @@ -271,21 +287,13 @@ function setup_mac_brew() ( echo-segment --h2="Install ffmpeg with options" # fetch all the build options for ffmpeg - local ffmpeg_opts + local ffmpeg_opts bad_option ffmpeg_opts="$(brew options homebrew-ffmpeg/ffmpeg/ffmpeg --compact)" - # Remove options that break ffmpeg - # Resolved: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/81#issuecomment-828722622 - # Fails: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/96#issuecomment-1398315717 - ffmpeg_opts="${ffmpeg_opts/--with-librsvg /}" - # Fails: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/92 - ffmpeg_opts="${ffmpeg_opts/--with-decklink /}" - # Fails: https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/37#issuecomment-958018136 - ffmpeg_opts="${ffmpeg_opts/--with-game-music-emu /}" - # Fails: Error: An exception occurred within a child process: FormulaUnavailableError: No available formula with the name "zvbi". - ffmpeg_opts="${ffmpeg_opts/--with-libzvbi /}" - # Fails: ERROR: libflite not found - ffmpeg_opts="${ffmpeg_opts/--with-libflite /}" - # space seperated array + # remove options that break ffmpeg + for bad_option in "${HOMEBREW_ENCODING_REMOVE_OPTIONS[@]}"; do + ffmpeg_opts="${ffmpeg_opts/$bad_option /}" + done + # parse the space seperated options into an array mapfile -t ffmpeg_opts < <(echo-split ' ' -- "$ffmpeg_opts") # install with the build options