blob: 52a8a97bd0b06a4e43b1edd96857992a09c36f0a [file] [log] [blame]
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04001#!/usr/bin/env bash
Davide Pesavento2349e282020-03-24 14:28:03 -04002set -ex
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04003
Davide Pesavento09348882016-09-17 02:39:44 +02004if has OSX $NODE_LABELS; then
Davide Pesavento97242f72020-02-29 14:28:15 -05005 FORMULAE=(boost openssl pkg-config)
Davide Pesaventod776a932020-03-20 18:42:36 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
Davide Pesaventob1a2a4b2017-06-08 19:37:21 -04008 fi
Davide Pesaventod776a932020-03-20 18:42:36 -04009
10 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
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040025
Davide Pesavento2349e282020-03-24 14:28:03 -040026elif has Ubuntu $NODE_LABELS; then
Davide Pesaventoe11c8d82016-04-16 14:32:07 +020027 sudo apt-get -qq update
Davide Pesavento2349e282020-03-24 14:28:03 -040028 sudo apt-get -qy install g++ pkg-config python3-minimal \
Davide Pesaventod776a932020-03-20 18:42:36 -040029 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesaventoc44cc832017-04-03 22:11:48 -040030
31 if [[ $JOB_NAME == *"code-coverage" ]]; then
Davide Pesaventocf8a3682018-11-24 19:52:21 -050032 sudo apt-get -qy install gcovr lcov libgd-perl
Davide Pesaventoc44cc832017-04-03 22:11:48 -040033 fi
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000034
Davide Pesavento2349e282020-03-24 14:28:03 -040035elif has CentOS-8 $NODE_LABELS; then
36 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
37 boost-devel openssl-devel sqlite-devel
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000038fi