@@ -50,7 +50,7 @@ if [ -n "$IS_OSX" ]; then
50
50
function generate_ffmpeg_formula {
51
51
local FF=" ffmpeg"
52
52
local LFF=" ffmpeg_opencv"
53
- local FF_FORMULA; FF_FORMULA=$( brew formula " $FF " )
53
+ local FF_FORMULA; FF_FORMULA=$( brew formula " ${FF}${FFMPEG_FORMULA_VERSION} " )
54
54
local LFF_FORMULA; LFF_FORMULA=" $( dirname " $FF_FORMULA " ) /${LFF} .rb"
55
55
56
56
local REGENERATE
@@ -70,8 +70,9 @@ if [ -n "$IS_OSX" ]; then
70
70
if [ -n " $REGENERATE " ]; then
71
71
echo " Regenerating custom ffmpeg formula"
72
72
# Bottle block syntax: https://docs.brew.sh/Bottles#bottle-dsl-domain-specific-language
73
+ # FfmpegAT4 is a class in ffmpeg@4 formula
73
74
perl -wpe ' BEGIN {our ($found_blank, $bottle_block);}
74
- if (/(^class )(Ffmpeg )(\s.*)/) {$_=$1.$2."Opencv ".$3."\n"; next;}
75
+ if (/(^class )(FfmpegAT4 )(\s.*)/) {$_=$1."FfmpegOpencv ".$3."\n"; next;}
75
76
if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;}
76
77
if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; }
77
78
if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; }
@@ -111,34 +112,14 @@ function pre_build {
111
112
CACHE_STAGE=
112
113
export HOMEBREW_NO_AUTO_UPDATE=1
113
114
114
- # after the cache stage, all bottles and Homebrew metadata should be already cached locally
115
- # if [ -n "$CACHE_STAGE" ]; then
116
- # brew update
117
- # generate_ffmpeg_formula
118
- # brew_add_local_bottles
119
- # fi
120
-
121
115
echo ' Installing FFmpeg'
122
116
123
- # if [ -n "$CACHE_STAGE" ]; then
124
- # brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; }
125
- # else
126
- brew update
127
- generate_ffmpeg_formula
128
- brew_add_local_bottles
129
- # brew unlink python@2
130
- brew install --build-bottle ffmpeg_opencv
131
- # fi
132
-
133
- # echo 'Installing qt5'
134
-
135
- # if [ -n "$CACHE_STAGE" ]; then
136
- # echo "Qt5 has bottle, no caching needed"
137
- # else
138
- # brew switch qt 5.13.2
139
- # brew pin qt
140
- # export PATH="/usr/local/opt/qt/bin:$PATH"
141
- # fi
117
+ brew update
118
+ generate_ffmpeg_formula
119
+ brew_add_local_bottles
120
+ brew install --build-bottle ffmpeg_opencv
121
+ # It needs when we use not the latest ffmpeg formula
122
+ brew link ffmpeg_opencv
142
123
143
124
if [ -n " $CACHE_STAGE " ]; then
144
125
brew_go_bootstrap_mode 0
0 commit comments