Skip to content

Commit

Permalink
Merge pull request #632 from asenyaev/asen/fix_current_builds
Browse files Browse the repository at this point in the history
Defined ffmpeg version for MacOS and Windows Server version in Github Actions
  • Loading branch information
asenyaev committed Mar 4, 2022
2 parents 209d32e + 602a8be commit 8880543
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 31 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_wheels_macos.yml
Expand Up @@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_wheels_windows.yml
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
os: [windows-2019]
python-version: ['3.6']
platform: [x86, x64]
with_contrib: [0, 1]
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
architecture: ${{ matrix.platform }}

- name: Setup MSBuild.exe
uses: warrenbuckley/Setup-MSBuild@v1
uses: microsoft/setup-msbuild@v1.1

- name: Build a package
run: |
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
os: [windows-2019]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
platform: [x86, x64]
with_contrib: [0, 1]
Expand Down
37 changes: 9 additions & 28 deletions travis_config.sh
Expand Up @@ -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
Expand All @@ -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; }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8880543

Please sign in to comment.