Skip to content

Commit

Permalink
Merge pull request #12807 from unknownbrackets/travis-mac
Browse files Browse the repository at this point in the history
Travis: Cache macOS python (and sdl2, etc.) build as a bottle
  • Loading branch information
hrydgard authored Apr 9, 2020
2 parents 6df4228 + 0a49b98 commit 7d3552a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ addons:
update: true
packages:
- ccache
- python
- sdl2

cache:
apt: true
Expand Down

0 comments on commit 7d3552a

Please sign in to comment.