blob: 119f7b97a79994018fc0a15216e6c66b46aa8656 [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
Davide Pesaventobd3642f2022-08-12 18:19:31 -04002set -eo pipefail
Davide Pesavento956ac312016-09-20 19:11:30 +02003
Davide Pesavento1df2cff2024-02-09 19:40:03 -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 pkg-config
19 python3-minimal
20)
Davide Pesaventobd3642f2022-08-12 18:19:31 -040021FORMULAE=(boost openssl pkg-config)
22PIP_PKGS=()
23case $JOB_NAME in
24 *code-coverage)
25 APT_PKGS+=(lcov python3-pip)
26 PIP_PKGS+=('gcovr~=5.2')
27 ;;
28 *Docs)
29 APT_PKGS+=(python3-pip)
30 PIP_PKGS+=(sphinx)
31 ;;
32esac
Junxiao Shi439d9722015-03-20 15:08:44 -070033
Davide Pesaventobd3642f2022-08-12 18:19:31 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesavento2c8ec072021-09-30 00:04:23 -040037 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3b4ee2f2022-12-31 01:55:06 -050038 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventobd3642f2022-08-12 18:19:31 -040039 fi
40 brew update
41 brew install --formula "${FORMULAE[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040042elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento1df2cff2024-02-09 19:40:03 -050043 sudo apt-get update -qq
44 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040045elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento1df2cff2024-02-09 19:40:03 -050046 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventod8398822020-03-29 18:46:19 -040047 boost-devel openssl-devel sqlite-devel \
48 libpcap-devel
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000049fi
Davide Pesavento6f168562022-11-13 15:57:02 -050050
51if (( ${#PIP_PKGS[@]} )); then
52 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
53fi