blob: 8ac68968218f90a151f102751490e7829ee4e443 [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 Pesavento8f0028d2021-07-27 20:01:06 -04006 if [[ $JOB_NAME == *"Docs" ]]; then
7 FORMULAE+=(doxygen graphviz)
8 fi
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08009
Davide Pesaventof28a0612021-09-29 23:13:32 -040010 if [[ -n $GITHUB_ACTIONS ]]; then
11 # GitHub Actions runners have a large number of pre-installed
12 # Homebrew packages. Don't waste time upgrading all of them.
Davide Pesavento69857c32020-04-05 16:36:26 -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 Pesavento8f0028d2021-07-27 20:01:06 -040026 if [[ $JOB_NAME == *"Docs" ]]; then
27 pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
28 fi
29
Davide Pesavento69857c32020-04-05 16:36:26 -040030elif has Ubuntu $NODE_LABELS; then
Davide Pesaventocc7bee72016-04-22 02:21:13 +020031 sudo apt-get -qq update
Davide Pesaventob7e72c32020-10-02 20:00:03 -040032 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesavento69857c32020-04-05 16:36:26 -040033 libboost-all-dev libssl-dev libsqlite3-dev \
34 libpcap-dev libsystemd-dev
Davide Pesavento8d61c032017-04-29 20:06:33 -040035
Davide Pesavento8f0028d2021-07-27 20:01:06 -040036 case $JOB_NAME in
37 *code-coverage)
Davide Pesavento2c61bad2021-08-30 22:40:35 -040038 sudo apt-get -qy install lcov python3-pip
39 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.0'
Davide Pesavento8f0028d2021-07-27 20:01:06 -040040 ;;
41 *Docs)
42 sudo apt-get -qy install doxygen graphviz python3-pip
43 pip3 install --user --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
44 ;;
45 esac
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000046
Davide Pesavento8f290fc2020-04-12 13:20:07 -040047elif has CentOS-8 $NODE_LABELS; then
Davide Pesavento9ab43e62020-12-27 20:07:25 -050048 sudo dnf config-manager --enable powertools
Davide Pesavento8f290fc2020-04-12 13:20:07 -040049 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
50 boost-devel openssl-devel sqlite-devel \
51 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000052fi