blob: 7fc1c3a1c6c919ffc3123d19c3b75dc900780437 [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento1d484532022-08-19 22:08:31 -04002set -eo pipefail
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
Davide Pesavento4fb84302024-02-10 15:45:06 -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 libsqlite3-dev
16 libssl-dev
17 pkg-config
18 python3-minimal
19)
Davide Pesavento1d484532022-08-19 22:08:31 -040020FORMULAE=(boost openssl pkg-config)
21PIP_PKGS=()
22case $JOB_NAME in
23 *code-coverage)
24 APT_PKGS+=(lcov python3-pip)
25 PIP_PKGS+=('gcovr~=5.2')
26 ;;
27 *Docs)
28 APT_PKGS+=(python3-pip)
29 PIP_PKGS+=(sphinx)
30 ;;
31esac
Davide Pesavento4a160042020-04-13 16:50:02 -040032
Davide Pesavento1d484532022-08-19 22:08:31 -040033set -x
34
35if [[ $ID == macos ]]; then
Davide Pesavento333e3eb2021-10-12 19:30:51 -040036 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventoe9b09b82023-01-19 13:30:07 -050037 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento1d484532022-08-19 22:08:31 -040038 fi
39 brew update
40 brew install --formula "${FORMULAE[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040041elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050042 sudo apt-get update -qq
43 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040044elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050045 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento1d484532022-08-19 22:08:31 -040046 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040047fi
Davide Pesaventoc2414752022-11-16 16:56:45 -050048
49if (( ${#PIP_PKGS[@]} )); then
50 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
51fi