blob: d4d9c33b0b6fda900e319f47d50783054dc4db56 [file] [log] [blame]
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07001#!/usr/bin/env bash
Davide Pesaventofee7ee32020-04-15 02:45:07 -04002set -ex
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07003
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -08004if has OSX $NODE_LABELS; then
Davide Pesavento4a315b32018-11-24 14:32:19 -05005 FORMULAE=(boost openssl pkg-config)
Davide Pesaventofee7ee32020-04-15 02:45:07 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
Davide Pesavento4a315b32018-11-24 14:32:19 -05008 fi
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07009
Davide Pesaventofee7ee32020-04-15 02:45:07 -040010 if [[ -n $TRAVIS ]]; then
11 # Travis images come with a large number of pre-installed
12 # brew packages, don't waste time upgrading all of them
13 brew list --versions "${FORMULAE[@]}" || brew update
14 for FORMULA in "${FORMULAE[@]}"; do
15 brew list --versions "$FORMULA" || brew install "$FORMULA"
16 done
17 # Ensure /usr/local/opt/openssl exists
18 brew reinstall openssl
19 else
20 brew update
21 brew upgrade
22 brew install "${FORMULAE[@]}"
23 brew cleanup
24 fi
25
26elif has Ubuntu $NODE_LABELS; then
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080027 sudo apt-get -qq update
Davide Pesaventofee7ee32020-04-15 02:45:07 -040028 sudo apt-get -qy install g++ pkg-config python3-minimal \
29 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesavento4a315b32018-11-24 14:32:19 -050030
31 if [[ $JOB_NAME == *"code-coverage" ]]; then
Davide Pesavento4473c7b2020-08-07 17:21:13 -040032 sudo apt-get -qy install gcovr lcov
Davide Pesavento4a315b32018-11-24 14:32:19 -050033 fi
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070034fi