blob: 5c672b0e57568d74b5c574b77927f4dd16c8109b [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
Davide Pesavento6153eaf2022-04-19 19:45:03 -040039 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.1'
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 Pesavento2150da82022-07-08 18:18:51 -040047elif has CentOS $NODE_LABELS; then
Davide Pesavento8f290fc2020-04-12 13:20:07 -040048 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
49 boost-devel openssl-devel sqlite-devel \
50 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000051fi