travis: fix macOS VMs with older homebrew versions

apparently travis changed the homebrew setup and that broke the build.
reasons was a different homebrew version that doesn't support the new
brew cli.
This commit is contained in:
der richter 2021-02-06 14:25:17 +01:00
parent 7f8d069087
commit 93066ff12f
1 changed files with 10 additions and 2 deletions

View File

@ -118,13 +118,21 @@ before_install:
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
remove=$(brew list --formula)
if [[ "$TRAVIS_OSX_IMAGE" == "xcode12.2" ]]; then
remove=$(brew list --formula)
else
remove=$(brew list)
fi
keep="gettext pcre2 git"
install="autoconf automake pkg-config libtool python freetype fribidi little-cms2 luajit libass ffmpeg"
for formula in ${keep[@]}; do remove=("${remove[@]/$formula}"); done
for formula in ${install[@]}; do remove=("${remove[@]/$formula}"); done
brew remove --force $remove --ignore-dependencies
brew remove --cask $(brew list --cask)
if [[ "$TRAVIS_OSX_IMAGE" == "xcode12.2" ]]; then
brew remove $(brew list --cask)
else
brew cask remove $(brew cask list)
fi
brew untap homebrew/cask
brew update
if [[ -n "$CI_HOMEBREW_HASH" ]]; then