blob: deb3219e99a616b4b40a6e7be8900b44c8530772 [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=(
Davide Pesavento9bec15a2024-04-22 23:00:03 -04005 dpkg-dev
6 g++
Davide Pesavento7227d642024-02-10 01:58:15 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
Davide Pesavento7227d642024-02-10 01:58:15 -050010 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
Davide Pesavento9bec15a2024-04-22 23:00:03 -040018 python3
Davide Pesavento7227d642024-02-10 01:58:15 -050019)
Davide Pesaventoc12f9152024-12-11 18:42:03 -050020FORMULAE=(boost openssl pkgconf)
Davide Pesaventof5006be2022-08-19 17:36:36 -040021PIP_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 Pesaventoc12f9152024-12-11 18:42:03 -050036 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesaventoab6ac5d2021-10-05 23:23:53 -040037 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento665f89c2023-02-14 16:45:07 -050038 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventof5006be2022-08-19 17:36:36 -040039 fi
40 brew update
41 brew install --formula "${FORMULAE[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040042elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento7227d642024-02-10 01:58:15 -050043 sudo apt-get update -qq
44 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040045elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento7227d642024-02-10 01:58:15 -050046 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventof5006be2022-08-19 17:36:36 -040047 boost-devel openssl-devel sqlite-devel
Davide Pesavento29db0fd2017-08-29 13:32:00 -040048fi
Davide Pesaventof855ec12022-11-16 16:08:35 -050049
50if (( ${#PIP_PKGS[@]} )); then
51 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
52fi