blob: 4773bbe86b6338e0c79610d715f5c206f4b0e287 [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
Davide Pesavento1df2cff2024-02-09 19:40:03 -050010 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
Davide Pesavento164414b2024-04-22 23:14:03 -040019 python3
Davide Pesavento1df2cff2024-02-09 19:40:03 -050020)
Davide Pesavento32531522024-12-10 15:42:44 -050021FORMULAE=(boost openssl pkgconf)
Davide Pesaventobd3642f2022-08-12 18:19:31 -040022PIP_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 Pesavento435d2012024-07-28 01:24:25 -040037 export HOMEBREW_NO_ENV_HINTS=1
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