about summary refs log tree commit diff homepage
path: root/scripts/build
diff options
context:
space:
mode:
authorFrank Busse <bb0xfb@gmail.com>2018-11-01 14:17:24 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-12-19 22:22:27 +0000
commitfceca8fafee9213a2d627fa01ae74edca363e6a8 (patch)
tree05c2651e34e33f3a3f11248983fbbe844cc56abf /scripts/build
parent00470aec372dce20580818fcbc2951c25327392d (diff)
downloadklee-fceca8fafee9213a2d627fa01ae74edca363e6a8.tar.gz
Travis OSX: install Python 3.x
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/build-travis.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/build/build-travis.sh b/scripts/build/build-travis.sh
index eaa30822..a2287a2e 100755
--- a/scripts/build/build-travis.sh
+++ b/scripts/build/build-travis.sh
@@ -7,10 +7,14 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
 elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
   brew install ccache
   set +e
-  brew install python@2
-  if [[ "X$?" != "X0" ]]; then
-     brew link --overwrite python@2
-  fi
+  brew upgrade python               # upgrade to Python 3
+  brew install python@2             # install Python 2 (OSX version outdated + pip missing)
+  brew link --overwrite python@2    # keg-only => link manually
+  rm -f /usr/local/bin/{python,pip} # re-link python/pip to Python 2
+  py2path=$(find /usr/local/Cellar/python@2/ -name "python" -type f | head -n 1)
+  pip2path=$(find /usr/local/Cellar/python@2/ -name "pip" -type f | head -n 1)
+  ln -s "${py2path}" /usr/local/bin/python
+  ln -s "${pip2path}" /usr/local/bin/pip
   set -e
   pip install lit==0.6.0
   export PATH="/usr/local/opt/ccache/libexec:$PATH"