diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 87fe6f995644d9b2f6e3f134762ffc312aad643b..c70f2b2d639df061217b780a71b24d1c90cf271f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -55,6 +55,7 @@ jobs: USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 + FFMPEG_FORMULA_VERSION: '@4' SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} diff --git a/travis_config.sh b/travis_config.sh index 7bbfec68d3367e12b9bcee58b821f46bd4a1be23..dfb656e85a59704805adffcd26dd0b1b48d08297 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -50,7 +50,7 @@ if [ -n "$IS_OSX" ]; then function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" - local FF_FORMULA; FF_FORMULA=$(brew formula "$FF") + local FF_FORMULA; FF_FORMULA=$(brew formula "${FF}${FFMPEG_FORMULA_VERSION}") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" local REGENERATE @@ -70,8 +70,9 @@ if [ -n "$IS_OSX" ]; then if [ -n "$REGENERATE" ]; then echo "Regenerating custom ffmpeg formula" # Bottle block syntax: https://docs.brew.sh/Bottles#bottle-dsl-domain-specific-language + # FfmpegAT4 is a class in ffmpeg@4 formula perl -wpe 'BEGIN {our ($found_blank, $bottle_block);} - if (/(^class )(Ffmpeg)(\s.*)/) {$_=$1.$2."Opencv".$3."\n"; next;} + if (/(^class )(FfmpegAT4)(\s.*)/) {$_=$1."FfmpegOpencv".$3."\n"; next;} if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;} if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; } if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; } @@ -111,34 +112,14 @@ function pre_build { CACHE_STAGE= export HOMEBREW_NO_AUTO_UPDATE=1 - #after the cache stage, all bottles and Homebrew metadata should be already cached locally - # if [ -n "$CACHE_STAGE" ]; then - # brew update - # generate_ffmpeg_formula - # brew_add_local_bottles - # fi - echo 'Installing FFmpeg' - # if [ -n "$CACHE_STAGE" ]; then - # brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } - # else - brew update - generate_ffmpeg_formula - brew_add_local_bottles - # brew unlink python@2 - brew install --build-bottle ffmpeg_opencv - # fi - - # echo 'Installing qt5' - - # if [ -n "$CACHE_STAGE" ]; then - # echo "Qt5 has bottle, no caching needed" - # else - # brew switch qt 5.13.2 - # brew pin qt - # export PATH="/usr/local/opt/qt/bin:$PATH" - # fi + brew update + generate_ffmpeg_formula + brew_add_local_bottles + brew install --build-bottle ffmpeg_opencv + # It needs when we use not the latest ffmpeg formula + brew link ffmpeg_opencv if [ -n "$CACHE_STAGE" ]; then brew_go_bootstrap_mode 0