blob: cd3eb76430efc31ad7d0ccc4ee59ff81396c1ed2 [file] [log] [blame]
Davide Pesavento0bd37312017-08-20 20:21:13 -04001#!/usr/bin/env bash
Davide Pesaventof6be8e32020-04-30 16:06:03 -04002set -ex
Davide Pesavento0bd37312017-08-20 20:21:13 -04003
4if has OSX $NODE_LABELS; then
Davide Pesavento0b0eddd2019-03-19 14:42:15 -04005 FORMULAE=(boost openssl pkg-config)
Davide Pesaventof6be8e32020-04-30 16:06:03 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
Davide Pesavento0bd37312017-08-20 20:21:13 -04008 fi
Davide Pesavento0bd37312017-08-20 20:21:13 -04009
Davide Pesaventof6be8e32020-04-30 16:06:03 -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
Davide Pesavento0bd37312017-08-20 20:21:13 -040027 sudo apt-get -qq update
Davide Pesavento4a90b9a2020-08-07 17:44:33 -040028 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesaventof6be8e32020-04-30 16:06:03 -040029 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesavento0bd37312017-08-20 20:21:13 -040030
31 if [[ $JOB_NAME == *"code-coverage" ]]; then
Davide Pesavento4a90b9a2020-08-07 17:44:33 -040032 sudo apt-get -qy install gcovr lcov
Davide Pesavento0bd37312017-08-20 20:21:13 -040033 fi
34fi