travis: update macOS images and make building faster

don't build our own ffmpeg anymore and instead use the bottled version
from homebrew. update the newest macOS image. also handle macOS 10.12
as a legacy OS since homebrew and Apple stopped supporting it.
nevertheless it's helpful to build on that version since it's the last
version we support building on. it's a bit special since we have to pin
the homebrew-core version to a previous one where all the bottles for
macOS 10.12 are still available, otherwise it would build nearly
everything from source and that would take ages. also start caching the
homebrew cache folder for downloads.
This commit is contained in:
der richter 2019-12-28 21:42:20 +01:00
parent 363048077f
commit 57f9de7b53
2 changed files with 51 additions and 61 deletions

View File

@ -1,16 +1,29 @@
language: c
macbase:
- &macOld
os: osx
compiler: clang
env:
- HOMEBREW_NO_AUTO_UPDATE=1
- HOMEBREW_NO_INSTALL_CLEANUP=1
- &macNew
<<: *macOld
addons:
homebrew:
packages: ['autoconf', 'automake', 'ffmpeg', 'freetype', 'fribidi',
'libass', 'libtool', 'little-cms2', 'luajit', 'nasm',
'pkg-config', 'python']
update: true
matrix:
include:
- os: osx
osx_image: xcode11
compiler: clang
- os: osx
- <<: *macNew
osx_image: xcode11.3
- <<: *macNew
osx_image: xcode10.1
compiler: clang
- os: osx
- <<: *macOld
osx_image: xcode9.2
compiler: clang
- os: linux
compiler: gcc
env: CONTAINER=registry.cirno.systems/kiwi/containers/mpv-ci:stable-deps CI_SCRIPT=ci/build-tumbleweed.sh
@ -21,6 +34,10 @@ matrix:
env: CONTAINER=registry.cirno.systems/kiwi/containers/mpv-ci-mingw64:i686 CI_SCRIPT=ci/build-mingw64.sh TARGET=i686-w64-mingw32
- os: linux
env: CONTAINER=registry.cirno.systems/kiwi/containers/mpv-ci-mingw64:x86_64 CI_SCRIPT=ci/build-mingw64.sh TARGET=x86_64-w64-mingw32
allow_failures:
- os: osx
osx_image: xcode9.2
fast_finish: true
dist: bionic
services:
@ -48,9 +65,34 @@ before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker pull $CONTAINER; fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [[ "$TRAVIS_OSX_IMAGE" == "xcode9.2" ]]; then
brew update
pushd "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
git checkout 55e02323812604add9a69bab8730319b9255a697
popd
brew install autoconf
brew install automake
brew install pkg-config
brew install libtool
brew install python
brew install freetype
brew install fribidi
brew install little-cms2
brew install luajit
brew install libass
brew install ffmpeg
else
brew link --overwrite python
"$TRAVIS_BUILD_DIR/ci/get_ffmpeg.sh"
fi
fi
before_cache:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew cleanup -s ; fi
cache:
directories:
- $HOME/Library/Caches/Homebrew
script:
- ./bootstrap.py
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker run --env CC --env TARGET -v $TRAVIS_BUILD_DIR:/build $CONTAINER /bin/sh -c "cd /build && $CI_SCRIPT"; fi
@ -75,17 +117,3 @@ addons:
build_command_prepend: "./bootstrap.py && ./waf configure"
build_command: "./waf build"
branch_pattern: coverity_scan
homebrew:
packages:
- autoconf
- automake
- freetype
- fribidi
- libass
- libtool
- little-cms2
- luajit
- nasm
- pkg-config
- python
update: true

View File

@ -1,38 +0,0 @@
#!/usr/bin/env bash
set -e
FFMPEG_SRC_DIR="${HOME}/deps/src/ffmpeg"
FFMPEG_BUILD_DIR="${FFMPEG_SRC_DIR}/${TRAVIS_OS_NAME}"
FFMPEG_SYSROOT="${HOME}/deps/sysroot"
FFMPEG_HASH="18928e2bb4568cbe5e9061c3e6b63559392af3d2"
# Get the sauce if not around
if [[ ! -d "${FFMPEG_SRC_DIR}" ]] ; then
git clone "https://git.videolan.org/git/ffmpeg.git" "${FFMPEG_SRC_DIR}"
fi
# pop into FFmpeg's source dir and clean up & check out our wanted revision
pushd "${FFMPEG_SRC_DIR}"
git reset --hard HEAD && git clean -dfx
git checkout "${FFMPEG_HASH}"
popd
# If a build dir of the same type is around, clean it up
if [[ -d "${FFMPEG_BUILD_DIR}" ]] ; then
rm -rf "${FFMPEG_BUILD_DIR}"
fi
# Create and move into the build dir, configure and build!
mkdir -p "${FFMPEG_BUILD_DIR}" && pushd "${FFMPEG_BUILD_DIR}"
PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" ../configure \
--disable-{autodetect,stripping} \
--cc="${CC}" \
--cxx="${CXX}" \
--prefix="${FFMPEG_SYSROOT}" \
--enable-{zlib,securetransport,videotoolbox}
make -j4 && make install && popd
exit 0