blob: 7fc1c3a1c6c919ffc3123d19c3b75dc900780437 [file] [log] [blame]
Davide Pesavento29db0fd2017-08-29 13:32:00 -04001#!/usr/bin/env bash
Davide Pesaventof5006be2022-08-19 17:36:36 -04002set -eo pipefail
Davide Pesavento29db0fd2017-08-29 13:32:00 -04003
Davide Pesavento7227d642024-02-10 01:58:15 -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 Pesaventof5006be2022-08-19 17:36:36 -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 Pesavento29db0fd2017-08-29 13:32:00 -040032
Davide Pesaventof5006be2022-08-19 17:36:36 -040033set -x
34
35if [[ $ID == macos ]]; then
Davide Pesaventoab6ac5d2021-10-05 23:23:53 -040036 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento665f89c2023-02-14 16:45:07 -050037 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventof5006be2022-08-19 17:36:36 -040038 fi
39 brew update
40 brew install --formula "${FORMULAE[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040041elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento7227d642024-02-10 01:58:15 -050042 sudo apt-get update -qq
43 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040044elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento7227d642024-02-10 01:58:15 -050045 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventof5006be2022-08-19 17:36:36 -040046 boost-devel openssl-devel sqlite-devel
Davide Pesavento29db0fd2017-08-29 13:32:00 -040047fi
Davide Pesaventof855ec12022-11-16 16:08:35 -050048
49if (( ${#PIP_PKGS[@]} )); then
50 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
51fi