blob: 742fa8baf19b41efb15851384e598192d556d507 [file] [log] [blame]
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08001#!/usr/bin/env bash
Davide Pesavento69857c32020-04-05 16:36:26 -04002set -ex
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08003
Davide Pesaventoe0edc4c2016-09-13 18:29:52 +00004if has OSX $NODE_LABELS; then
Davide Pesaventoc25737c2017-08-26 13:18:17 -04005 FORMULAE=(boost openssl pkg-config)
Davide Pesavento69857c32020-04-05 16:36:26 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
Davide Pesavento7744a4a2017-06-20 21:29:56 -04008 fi
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08009
Davide Pesavento69857c32020-04-05 16:36:26 -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 Pesaventocc7bee72016-04-22 02:21:13 +020027 sudo apt-get -qq update
Davide Pesavento69857c32020-04-05 16:36:26 -040028 sudo apt-get -qy install g++ pkg-config python3-minimal \
29 libboost-all-dev libssl-dev libsqlite3-dev \
30 libpcap-dev libsystemd-dev
Davide Pesavento8d61c032017-04-29 20:06:33 -040031
32 if [[ $JOB_NAME == *"code-coverage" ]]; then
ashiqopud29a5da2018-11-25 01:09:15 +000033 sudo apt-get -qy install gcovr lcov libgd-perl
Davide Pesavento8d61c032017-04-29 20:06:33 -040034 fi
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000035
Davide Pesavento8f290fc2020-04-12 13:20:07 -040036elif has CentOS-8 $NODE_LABELS; then
37 sudo dnf config-manager --enable PowerTools
38 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
39 boost-devel openssl-devel sqlite-devel \
40 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000041fi