From 0a49b9834592f2578d32deb650ad368baadabf78 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 8 Apr 2020 01:00:47 -0700 Subject: [PATCH] Travis: Cache macOS python build as a bottle. --- .travis.sh | 23 +++++++++++++++++++++++ .travis.yml | 2 -- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.travis.sh b/.travis.sh index c1fce361fb7b..bee6b0930b07 100644 --- a/.travis.sh +++ b/.travis.sh @@ -2,6 +2,8 @@ export USE_CCACHE=1 export NDK_CCACHE=ccache +export HOMEBREW_NO_INSTALL_CLEANUP=1 +export HOMEBREW_NO_AUTO_UPDATE=1 NDK_VER=android-ndk-r18b download_extract() { @@ -20,6 +22,27 @@ download_extract_zip() { travis_before_install() { git submodule update --init --recursive + + if [ "$TRAVIS_OS_NAME" = osx ]; then + # Depends on Python, wastes time updating... + brew uninstall -f mercurial + + for PKG in openssl@1.1 readline pkg-config gdbm sqlite xz python sdl2; do + if [ -f $HOME/Library/Caches/Homebrew/$PKG-*.bottle.*.tar.gz ]; then + brew upgrade $HOME/Library/Caches/Homebrew/$PKG-*.bottle.*.tar.gz || brew install -f $HOME/Library/Caches/Homebrew/$PKG-*.bottle.*.tar.gz || true + fi + done + + for PKG in openssl@1.1 readline pkg-config gdbm sqlite xz python sdl2; do + if [ ! -f $HOME/Library/Caches/Homebrew/$PKG-*.bottle.*.tar.gz ]; then + echo "Rebuilding $PKG as bottle..." + brew uninstall -f --ignore-dependencies $PKG && brew install --build-bottle $PKG || true + brew bottle $PKG && brew postinstall $PKG || true + rm $HOME/Library/Caches/Homebrew/$PKG-*.bottle.*.tar.gz || true + mv ./$PKG-*.bottle.*.tar.gz $HOME/Library/Caches/Homebrew/ || true + fi + done + fi } travis_install() { diff --git a/.travis.yml b/.travis.yml index 5ae9a80979e0..28e548611e42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,6 @@ addons: update: true packages: - ccache - - python - - sdl2 cache: apt: true