blob: ad3828ebaeb54b3062f2e2300be0f4a53a47e917 [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
10 libboost-filesystem-dev
11 libboost-log-dev
12 libboost-program-options-dev
13 libboost-stacktrace-dev
14 libboost-test-dev
15 libboost-thread-dev
16 libpcap-dev
17 libsqlite3-dev
18 libssl-dev
19 libsystemd-dev
20 pkg-config
Davide Pesaventoe76d7b52024-04-09 16:54:01 -040021 python3
Davide Pesaventoa1b15192024-02-09 19:27:34 -050022)
Davide Pesavento72517b52022-08-13 18:50:55 -040023FORMULAE=(boost openssl pkg-config)
24PIP_PKGS=()
25case $JOB_NAME in
26 *code-coverage)
27 APT_PKGS+=(lcov python3-pip)
28 PIP_PKGS+=('gcovr~=5.2')
29 ;;
30 *Docs)
31 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento8f0028d2021-07-27 20:01:06 -040032 FORMULAE+=(doxygen graphviz)
Davide Pesavento72517b52022-08-13 18:50:55 -040033 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
34 ;;
35esac
Alexander Afanasyevb81cff92015-07-09 09:45:09 +080036
Davide Pesavento72517b52022-08-13 18:50:55 -040037set -x
38
39if [[ $ID == macos ]]; then
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