blob: ff318f2c5ca291c344ac9e704ab3c3501c888874 [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=(
Davide Pesavento164414b2024-04-22 23:14:03 -04005 dpkg-dev
6 g++
Davide Pesavento1df2cff2024-02-09 19:40:03 -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 pkg-config
Davide Pesavento164414b2024-04-22 23:14:03 -040020 python3
Davide Pesavento1df2cff2024-02-09 19:40:03 -050021)
Davide Pesaventobd3642f2022-08-12 18:19:31 -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+=(python3-pip)
31 PIP_PKGS+=(sphinx)
32 ;;
33esac
Junxiao Shi439d9722015-03-20 15:08:44 -070034
Davide Pesaventobd3642f2022-08-12 18:19:31 -040035set -x
36
37if [[ $ID == macos ]]; then
Davide Pesavento2c8ec072021-09-30 00:04:23 -040038 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3b4ee2f2022-12-31 01:55:06 -050039 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventobd3642f2022-08-12 18:19:31 -040040 fi
41 brew update
42 brew install --formula "${FORMULAE[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040043elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento1df2cff2024-02-09 19:40:03 -050044 sudo apt-get update -qq
45 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040046elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento1df2cff2024-02-09 19:40:03 -050047 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventod8398822020-03-29 18:46:19 -040048 boost-devel openssl-devel sqlite-devel \
49 libpcap-devel
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000050fi
Davide Pesavento6f168562022-11-13 15:57:02 -050051
52if (( ${#PIP_PKGS[@]} )); then
53 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
54fi