From e08d0c4e0fbd5b91999d93b4f4e26e005224a0b8 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Mon, 13 May 2019 02:29:39 +0300 Subject: [PATCH] Fix Travis-CI for macOS and libtorrent 1.1.x --- .travis.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 314ae8658..7c5392eff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -117,7 +117,7 @@ install: PATH="/usr/local/opt/ccache/libexec:$PATH" brew update > /dev/null - brew install ccache colormake boost libtorrent-rasterbar openssl qt zlib + brew install ccache colormake boost openssl qt zlib brew link --force qt zlib if [ "$build_system" = "cmake" ]; then @@ -147,6 +147,32 @@ install: sudo dpkg -i "$HOME/travis/deb/libtorrent-rasterbar-dev_1.2.x_amd64.deb" "$HOME/travis/deb/libtorrent-rasterbar10_1.2.x_amd64.deb" fi + - | + if [ "$libt_branch" = "RC_1_1" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then + wget https://builds.shiki.hu/travis/brew/1_1/version + if ! cmp --quiet "version" "$HOME/travis/brew/1_1/version" ; then + echo "Cached files are different from server. Downloading new ones." + # First delete old files + rm -r "$HOME/travis/brew/1_1" + mkdir "$HOME/travis/brew/1_1" + cp "version" $HOME/travis/brew/1_1 + cd "$HOME/travis/brew/1_1" + wget https://builds.shiki.hu/travis/brew/1_1/libtorrent-rasterbar.rb + wget https://builds.shiki.hu/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz + fi + # Copy custom libtorrent bottle to homebrew's download cache so it can find and install it + # Also install our custom libtorrent formula by passing the local path to it + # These 2 files are restored from Travis' cache. + cp "$HOME/travis/brew/1_1/bd36a4b440aa138a88e375c1a3b672f1a1bc6606e7866fc3415b6b98fa49e771--libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz" "$(brew --cache)/downloads" + brew uninstall libtorrent-rasterbar + brew install "$HOME/travis/brew/1_1/libtorrent-rasterbar.rb" + + # NOTE about the bottle name + # The part before the "--" characters is a sha256 hash of the string + # of the URL homebrew itself would use to download the bottle. + # In this case the URL is the following: + # http://127.0.0.1/libtorrent-rasterbar-1.1.13.high_sierra.bottle.tar.gz + fi - | if [ "$libt_branch" = "RC_1_2" ] && [ "$TRAVIS_OS_NAME" = "osx" ]; then wget https://builds.shiki.hu/travis/brew/version