• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -x
2
3set -e
4
5install_brew_package() {
6  if brew list -1 | grep -q "^$1\$"; then
7    # Package is installed, upgrade if needed
8    time (brew outdated "$1" || brew upgrade "$@")
9  else
10    # Package not installed yet, install.
11    # If there are conflicts, try overwriting the files (these are in /usr/local anyway so it should be ok).
12    time (brew install "$@" || brew link --overwrite gcc49)
13  fi
14}
15
16time brew update
17
18# For md5sum
19install_brew_package md5sha1sum
20# For `timeout'
21install_brew_package coreutils
22
23if [[ "${INSTALL_VALGRIND}" == "1" ]]
24then
25    install_brew_package valgrind
26fi
27
28which cmake &>/dev/null || install_brew_package cmake
29
30case "${COMPILER}" in
31gcc-4.9)       install_brew_package gcc@4.9 ;;
32gcc-5)         install_brew_package gcc@5 ;;
33gcc-6)         install_brew_package gcc@6 ;;
34clang-default) ;;
35clang-3.7)     install_brew_package llvm@3.7 --with-clang --with-libcxx;;
36clang-3.8)     install_brew_package llvm@3.8 --with-clang --with-libcxx;;
37clang-3.9)     install_brew_package llvm@3.9 --with-clang --with-libcxx;;
38clang-4.0)     install_brew_package llvm     --with-clang --with-libcxx;;
39*) echo "Compiler not supported: ${COMPILER}. See travis_ci_install_osx.sh"; exit 1 ;;
40esac
41
42install_brew_package python
43time pip3 install pytest
44time pip3 install pytest-xdist
45time pip3 install sh
46
47# This adds python-installed executables to PATH (notably py.test).
48export PATH="$(brew --prefix)/bin:$PATH"
49