blob: 6d8923f8acf1fcc0dc5be25878ba766ecf2eb384 [file] [log] [blame]
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08001#!/usr/bin/env bash
Davide Pesavento72517b52022-08-13 18:50:55 -04002set -eo pipefail
Alexander Afanasyevb81cff92015-07-09 09:45:09 +08003
Davide Pesaventoa1b15192024-02-09 19:27:34 -05004APT_PKGS=(
Davide Pesaventoe76d7b52024-04-09 16:54:01 -04005 dpkg-dev
6 g++
Davide Pesaventoa1b15192024-02-09 19:27:34 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
Davide Pesaventoa1b15192024-02-09 19:27:34 -050010 libboost-log-dev
11 libboost-program-options-dev
12 libboost-stacktrace-dev
13 libboost-test-dev
14 libboost-thread-dev
15 libpcap-dev
16 libsqlite3-dev
17 libssl-dev
18 libsystemd-dev
19 pkg-config
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040020 python3
Davide Pesaventoa1b15192024-02-09 19:27:34 -050021)
Davide Pesavento914eb282024-12-10 15:33:26 -050022FORMULAE=(boost openssl pkgconf)
Davide Pesavento72517b52022-08-13 18:50:55 -040023PIP_PKGS=()
24case $JOB_NAME in
25 *code-coverage)
26 APT_PKGS+=(lcov python3-pip)
27 PIP_PKGS+=('gcovr~=5.2')
28 ;;
29 *Docs)
30 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento8f0028d2021-07-27 20:01:06 -040031 FORMULAE+=(doxygen graphviz)
Davide Pesavento72517b52022-08-13 18:50:55 -040032 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
33 ;;
34esac
Alexander Afanasyevb81cff92015-07-09 09:45:09 +080035
Davide Pesavento72517b52022-08-13 18:50:55 -040036set -x
37
38if [[ $ID == macos ]]; then
Davide Pesaventoa1480a72024-07-28 00:24:25 -040039 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesaventof28a0612021-09-29 23:13:32 -040040 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3bc8e192022-12-31 01:40:11 -050041 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento72517b52022-08-13 18:50:55 -040042 fi
43 brew update
44 brew install --formula "${FORMULAE[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040045elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoa1b15192024-02-09 19:27:34 -050046 sudo apt-get update -qq
47 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040048elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoa1b15192024-02-09 19:27:34 -050049 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento8f290fc2020-04-12 13:20:07 -040050 boost-devel openssl-devel sqlite-devel \
51 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000052fi
Davide Pesaventoa42efcb2022-11-15 02:43:16 -050053
54if (( ${#PIP_PKGS[@]} )); then
55 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
56fi