blob: f6a3419e55339669ef6da3fd0e87316fb20b11ba [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
Davide Pesavento4b465b52025-03-18 02:20:32 -040018 pkgconf
Davide Pesavento164414b2024-04-22 23:14:03 -040019 python3
Davide Pesavento1df2cff2024-02-09 19:40:03 -050020)
Davide Pesavento4b465b52025-03-18 02:20:32 -040021DNF_PKGS=(
22 boost-devel
23 gcc-c++
24 libasan
25 libpcap-devel
26 lld
27 openssl-devel
28 pkgconf
29 python3
30 sqlite-devel
31)
Davide Pesavento32531522024-12-10 15:42:44 -050032FORMULAE=(boost openssl pkgconf)
Davide Pesaventobd3642f2022-08-12 18:19:31 -040033PIP_PKGS=()
34case $JOB_NAME in
35 *code-coverage)
36 APT_PKGS+=(lcov python3-pip)
37 PIP_PKGS+=('gcovr~=5.2')
38 ;;
39 *Docs)
40 APT_PKGS+=(python3-pip)
41 PIP_PKGS+=(sphinx)
42 ;;
43esac
Junxiao Shi439d9722015-03-20 15:08:44 -070044
Davide Pesaventobd3642f2022-08-12 18:19:31 -040045set -x
46
47if [[ $ID == macos ]]; then
Davide Pesavento435d2012024-07-28 01:24:25 -040048 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento2c8ec072021-09-30 00:04:23 -040049 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento3b4ee2f2022-12-31 01:55:06 -050050 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventobd3642f2022-08-12 18:19:31 -040051 fi
52 brew update
53 brew install --formula "${FORMULAE[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040054elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento1df2cff2024-02-09 19:40:03 -050055 sudo apt-get update -qq
56 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventobd3642f2022-08-12 18:19:31 -040057elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento4b465b52025-03-18 02:20:32 -040058 sudo dnf install -y "${DNF_PKGS[@]}"
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000059fi
Davide Pesavento6f168562022-11-13 15:57:02 -050060
61if (( ${#PIP_PKGS[@]} )); then
62 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
63fi