aboutsummaryrefslogtreecommitdiff
path: root/extras/scripts/travis_ci_install_osx.sh
blob: d3cc7c89d4643736e22e91c6c25d4190be687df9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash -x

set -e

# These packages depend on the ones that we update but we don't care about these, we don't want to waste time upgrading
# them.
for p in postgis ansible libdap libspatialite gdal mercurial poppler
do
  brew pin $p
done

install_brew_package() {
  time (brew install "$@" || brew outdated "$1" || brew upgrade "$@" || true)
  # Some formulas are not linked into /usr/local by default, make sure they are.
  time (brew link --force --overwrite "$@" || true)
}

# For md5sum, timeout
install_brew_package coreutils

if [[ "${INSTALL_VALGRIND}" == "1" ]]
then
    install_brew_package valgrind
fi

which cmake &>/dev/null || install_brew_package cmake

case "${COMPILER}" in
gcc-4.9)       install_brew_package gcc@4.9 ;;
gcc-5)         install_brew_package gcc@5 ;;
gcc-6)         install_brew_package gcc@6 ;;
gcc-7)         install_brew_package gcc@7 ;;
gcc-8)         install_brew_package gcc@8 ;;
gcc-9)         install_brew_package gcc@9 ;;
clang-default) ;;
clang-6.0)
  install_brew_package llvm@6
  ln -s /usr/local/opt/llvm@6/bin/clang++ /usr/local/bin/clang++-6.0
  ;;
clang-7.0)
  install_brew_package llvm@7
  ln -s /usr/local/opt/llvm@7/bin/clang++ /usr/local/bin/clang++-7
  ;;
clang-8.0)
  install_brew_package llvm@8
  ln -s /usr/local/opt/llvm@8/bin/clang++ /usr/local/bin/clang++-8
  ;;
clang-9.0)
  install_brew_package llvm@9
  ln -s /usr/local/opt/llvm@9/bin/clang++ /usr/local/bin/clang++-9
  ln -s /usr/local/opt/llvm@9/bin/clang /usr/local/bin/clang-9
  ;;
*) echo "Compiler not supported: ${COMPILER}. See travis_ci_install_osx.sh"; exit 1 ;;
esac

# So that we can "brew link" python@3 instead.
brew unlink python@2

install_brew_package boost
install_brew_package python
time pip3 install absl-py
time pip3 install pytest
time pip3 install pytest-xdist
time pip3 install sh

# This adds python-installed executables to PATH (notably py.test).
export PATH="$(brew --prefix)/bin:$PATH"