blob: df1e433872963a9f5fa6810f89956a05e501bb72 [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=(
5 build-essential
6 libboost-chrono-dev
7 libboost-date-time-dev
8 libboost-dev
9 libboost-filesystem-dev
10 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
20 python3-minimal
21)
Davide Pesavento72517b52022-08-13 18:50:55 -040022FORMULAE=(boost openssl pkg-config)
23PIP_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 Pesaventof28a0612021-09-29 23:13:32 -040039 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3bc8e192022-12-31 01:40:11 -050040 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento72517b52022-08-13 18:50:55 -040041 fi
42 brew update
43 brew install --formula "${FORMULAE[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040044elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoa1b15192024-02-09 19:27:34 -050045 sudo apt-get update -qq
46 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040047elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoa1b15192024-02-09 19:27:34 -050048 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento8f290fc2020-04-12 13:20:07 -040049 boost-devel openssl-devel sqlite-devel \
50 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000051fi
Davide Pesaventoa42efcb2022-11-15 02:43:16 -050052
53if (( ${#PIP_PKGS[@]} )); then
54 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
55fi