• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -x
2
3set -e
4
5# These packages depend on the ones that we update but we don't care about these, we don't want to waste time upgrading
6# them.
7for p in postgis ansible libdap libspatialite gdal mercurial poppler
8do
9  brew pin $p
10done
11
12install_brew_package() {
13  time (brew install "$@" || brew outdated "$1" || brew upgrade "$@" || true)
14  # Some formulas are not linked into /usr/local by default, make sure they are.
15  time (brew link --force --overwrite "$@" || true)
16}
17
18# For md5sum, timeout
19install_brew_package coreutils
20
21if [[ "${INSTALL_VALGRIND}" == "1" ]]
22then
23    install_brew_package valgrind
24fi
25
26which cmake &>/dev/null || install_brew_package cmake
27
28case "${COMPILER}" in
29gcc-4.9)       install_brew_package gcc@4.9 ;;
30gcc-5)         install_brew_package gcc@5 ;;
31gcc-6)         install_brew_package gcc@6 ;;
32gcc-7)         install_brew_package gcc@7 ;;
33gcc-8)         install_brew_package gcc@8 ;;
34gcc-9)         install_brew_package gcc@9 ;;
35clang-default) ;;
36clang-6.0)
37  install_brew_package llvm@6
38  ln -s /usr/local/opt/llvm@6/bin/clang++ /usr/local/bin/clang++-6.0
39  ;;
40clang-7.0)
41  install_brew_package llvm@7
42  ln -s /usr/local/opt/llvm@7/bin/clang++ /usr/local/bin/clang++-7
43  ;;
44clang-8.0)
45  install_brew_package llvm@8
46  ln -s /usr/local/opt/llvm@8/bin/clang++ /usr/local/bin/clang++-8
47  ;;
48clang-9.0)
49  install_brew_package llvm@9
50  ln -s /usr/local/opt/llvm@9/bin/clang++ /usr/local/bin/clang++-9
51  ln -s /usr/local/opt/llvm@9/bin/clang /usr/local/bin/clang-9
52  ;;
53*) echo "Compiler not supported: ${COMPILER}. See travis_ci_install_osx.sh"; exit 1 ;;
54esac
55
56# So that we can "brew link" python@3 instead.
57brew unlink python@2
58
59install_brew_package boost
60install_brew_package python
61time pip3 install absl-py
62time pip3 install pytest
63time pip3 install pytest-xdist
64time pip3 install sh
65
66# This adds python-installed executables to PATH (notably py.test).
67export PATH="$(brew --prefix)/bin:$PATH"
68