blob: f12feaae460d5b15dde928fef8114d6094f9bdca [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 Pesaventoa1480a72024-07-28 00:24:25 -040040 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesaventof28a0612021-09-29 23:13:32 -040041 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3bc8e192022-12-31 01:40:11 -050042 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento72517b52022-08-13 18:50:55 -040043 fi
44 brew update
45 brew install --formula "${FORMULAE[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040046elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoa1b15192024-02-09 19:27:34 -050047 sudo apt-get update -qq
48 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento72517b52022-08-13 18:50:55 -040049elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoa1b15192024-02-09 19:27:34 -050050 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento8f290fc2020-04-12 13:20:07 -040051 boost-devel openssl-devel sqlite-devel \
52 libpcap-devel systemd-devel
Md Ashiqur Rahman922330b2018-09-04 17:55:18 +000053fi
Davide Pesaventoa42efcb2022-11-15 02:43:16 -050054
55if (( ${#PIP_PKGS[@]} )); then
56 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
57fi