blob: faf01be705c5874573e174008e85b48c6f9d7c80 [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
Davide Pesavento8f0028d2021-07-27 20:01:06 -04009 if [[ $JOB_NAME == *"Docs" ]]; then
10 FORMULAE+=(doxygen graphviz)
11 fi
Alexander Afanasyevb81cff92015-07-09 09:45:09 +080012
Davide Pesavento8f0028d2021-07-27 20:01:06 -040013 if [[ -n $GITHUB_ACTIONS || -n $TRAVIS ]]; then
14 # GitHub Actions and Travis images come with a large number of
15 # pre-installed packages. Don't waste time upgrading all of them.
Davide Pesavento69857c32020-04-05 16:36:26 -040016 brew list --versions "${FORMULAE[@]}" || brew update
17 for FORMULA in "${FORMULAE[@]}"; do
18 brew list --versions "$FORMULA" || brew install "$FORMULA"
19 done
20 # Ensure /usr/local/opt/openssl exists
21 brew reinstall openssl
22 else
23 brew update
24 brew upgrade
25 brew install "${FORMULAE[@]}"
26 brew cleanup
27 fi
28
Davide Pesavento8f0028d2021-07-27 20:01:06 -040029 if [[ $JOB_NAME == *"Docs" ]]; then
30 pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
31 fi
32
Davide Pesavento69857c32020-04-05 16:36:26 -040033elif has Ubuntu $NODE_LABELS; then
Davide Pesaventocc7bee72016-04-22 02:21:13 +020034 sudo apt-get -qq update
Davide Pesaventob7e72c32020-10-02 20:00:03 -040035 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesavento69857c32020-04-05 16:36:26 -040036 libboost-all-dev libssl-dev libsqlite3-dev \
37 libpcap-dev libsystemd-dev
Davide Pesavento8d61c032017-04-29 20:06:33 -040038
Davide Pesavento8f0028d2021-07-27 20:01:06 -040039 case $JOB_NAME in
40 *code-coverage)
Davide Pesavento2c61bad2021-08-30 22:40:35 -040041 sudo apt-get -qy install lcov python3-pip
42 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.0'
Davide Pesavento8f0028d2021-07-27 20:01:06 -040043 ;;
44 *Docs)
45 sudo apt-get -qy install doxygen graphviz python3-pip
46 pip3 install --user --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
47 ;;
48 esac
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000049
Davide Pesavento8f290fc2020-04-12 13:20:07 -040050elif has CentOS-8 $NODE_LABELS; then
Davide Pesavento9ab43e62020-12-27 20:07:25 -050051 sudo dnf config-manager --enable powertools
Davide Pesavento8f290fc2020-04-12 13:20:07 -040052 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
53 boost-devel openssl-devel sqlite-devel \
54 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000055fi