blob: 304a19a854974d19a781015e80a17f861589b075 [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
Davide Pesaventod8398822020-03-29 18:46:19 -04002set -ex
Davide Pesavento956ac312016-09-20 19:11:30 +02003
Junxiao Shi439d9722015-03-20 15:08:44 -07004if has OSX $NODE_LABELS; then
Davide Pesavento07238e82017-08-26 13:21:57 -04005 FORMULAE=(boost openssl pkg-config)
Davide Pesaventoa1a9d702020-03-29 00:58:15 -04006 if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
7 FORMULAE+=(python)
Davide Pesavento1eecc172017-06-24 14:30:42 -04008 fi
Junxiao Shi439d9722015-03-20 15:08:44 -07009
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040010 if [[ -n $GITHUB_ACTIONS || -n $TRAVIS ]]; then
11 # GitHub Actions and Travis images come with a large number of
12 # pre-installed packages. Don't waste time upgrading all of them.
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040013 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
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040026 if [[ $JOB_NAME == *"Docs" ]]; then
27 pip3 install --upgrade --upgrade-strategy=eager sphinx
28 fi
29
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040030elif has Ubuntu $NODE_LABELS; then
Davide Pesavento0e8edde2016-05-03 18:08:39 +020031 sudo apt-get -qq update
Davide Pesavento02ec47c2020-08-09 02:23:07 -040032 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040033 libboost-all-dev libssl-dev libsqlite3-dev \
34 libpcap-dev
Davide Pesavento931dfe82017-04-29 20:33:45 -040035
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040036 case $JOB_NAME in
37 *code-coverage)
Davide Pesavento8c353902021-08-30 19:10:36 -040038 sudo apt-get -qy install lcov python3-pip
39 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.0'
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040040 ;;
41 *Docs)
42 sudo apt-get -qy install python3-pip
43 pip3 install --user --upgrade --upgrade-strategy=eager sphinx
44 ;;
45 esac
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000046
Davide Pesaventod8398822020-03-29 18:46:19 -040047elif has CentOS-8 $NODE_LABELS; then
Davide Pesavento3047ba42020-12-27 20:00:06 -050048 sudo dnf config-manager --enable powertools
Davide Pesaventod8398822020-03-29 18:46:19 -040049 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
50 boost-devel openssl-devel sqlite-devel \
51 libpcap-devel
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000052fi