@@ -37,11 +37,6 @@ if [ -n "$IS_OSX" ]; then
37
37
" ffmpeg_opencv 10" \
38
38
)
39
39
40
- # Contrib adds significantly to project's build time
41
- if [ " $ENABLE_CONTRIB " -eq 1 ]; then
42
- BREW_TIME_LIMIT=$(( BREW_TIME_LIMIT - 10 * 60 ))
43
- fi
44
-
45
40
function generate_ffmpeg_formula {
46
41
local FF=" ffmpeg"
47
42
local LFF=" ffmpeg_opencv"
@@ -92,9 +87,14 @@ function pre_build {
92
87
93
88
if [ -n " $IS_OSX " ]; then
94
89
echo " Running for OSX"
90
+
91
+ local CACHE_STAGE; (echo " $TRAVIS_BUILD_STAGE_NAME " | grep -qiF " final" ) || CACHE_STAGE=1
95
92
96
- brew update
97
- brew_add_local_bottles
93
+ # after the cache stage, all bottles and Homebrew metadata should be already cached locally
94
+ if [ -n " $CACHE_STAGE " ]; then
95
+ brew update
96
+ brew_add_local_bottles
97
+ fi
98
98
99
99
# Don't query analytical info online on `brew info`,
100
100
# this takes several seconds and we don't need it
@@ -104,14 +104,25 @@ function pre_build {
104
104
echo ' Installing QT4'
105
105
brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4
106
106
brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin cartr/qt4
107
- brew_install_and_cache_within_time_limit qt@4 || { [ $? -gt 1 ] && return 2 || return 0; }
107
+ if [ -n " $CACHE_STAGE " ]; then
108
+ brew_install_and_cache_within_time_limit qt@4 || { [ $? -gt 1 ] && return 2 || return 0; }
109
+ else
110
+ brew install qt@4
111
+ fi
108
112
109
113
echo ' Installing FFmpeg'
110
114
111
- generate_ffmpeg_formula
112
- local IS_BOTTLE_AVAILABLE; _brew_is_bottle_available ffmpeg_opencv && IS_BOTTLE_AVAILABLE=1 || IS_BOTTLE_AVAILABLE=0
113
- _brew_install_and_cache ffmpeg_opencv " $IS_BOTTLE_AVAILABLE "
114
- # brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; }
115
+ if [ -n " $CACHE_STAGE " ]; then
116
+ generate_ffmpeg_formula
117
+ brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; }
118
+ else
119
+ brew install ffmpeg_opencv
120
+ fi
121
+
122
+ if [ -n " $CACHE_STAGE " ]; then
123
+ brew_go_bootstrap_mode 0
124
+ return 0
125
+ fi
115
126
116
127
# Have to install macpython late to avoid conflict with Homebrew Python update
117
128
before_install
0 commit comments