blob: a7798ff227c614f6076489eb53b856792289738e [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 Pesaventobd3642f2022-08-12 18:19:31 -04004APT_PKGS=(build-essential pkg-config python3-minimal
5 libboost-all-dev libssl-dev libsqlite3-dev
6 libpcap-dev)
7FORMULAE=(boost openssl pkg-config)
8PIP_PKGS=()
9case $JOB_NAME in
10 *code-coverage)
11 APT_PKGS+=(lcov python3-pip)
12 PIP_PKGS+=('gcovr~=5.2')
13 ;;
14 *Docs)
15 APT_PKGS+=(python3-pip)
16 PIP_PKGS+=(sphinx)
17 ;;
18esac
Junxiao Shi439d9722015-03-20 15:08:44 -070019
Davide Pesaventobd3642f2022-08-12 18:19:31 -040020set -x
21
22if [[ $ID == macos ]]; then
Davide Pesavento2c8ec072021-09-30 00:04:23 -040023 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventobd3642f2022-08-12 18:19:31 -040024 export HOMEBREW_NO_INSTALL_UPGRADE=1
25 fi
26 brew update
27 brew install --formula "${FORMULAE[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040028elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento0e8edde2016-05-03 18:08:39 +020029 sudo apt-get -qq update
Davide Pesaventobd3642f2022-08-12 18:19:31 -040030 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040031elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento6f168562022-11-13 15:57:02 -050032 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventod8398822020-03-29 18:46:19 -040033 boost-devel openssl-devel sqlite-devel \
34 libpcap-devel
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000035fi
Davide Pesavento6f168562022-11-13 15:57:02 -050036
37if (( ${#PIP_PKGS[@]} )); then
38 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
39fi