blob: 133a3731fbb0a72cc0b2ae7ccc63030625585919 [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
10 libboost-filesystem-dev
11 libboost-log-dev
12 libboost-program-options-dev
13 libboost-stacktrace-dev
14 libboost-test-dev
15 libboost-thread-dev
16 libsqlite3-dev
17 libssl-dev
18 pkg-config
Davide Pesavento9bec15a2024-04-22 23:00:03 -040019 python3
Davide Pesavento7227d642024-02-10 01:58:15 -050020)
Davide Pesaventoc12f9152024-12-11 18:42:03 -050021FORMULAE=(boost openssl pkgconf)
Davide Pesaventof5006be2022-08-19 17:36:36 -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
Davide Pesavento29db0fd2017-08-29 13:32:00 -040033
Davide Pesaventof5006be2022-08-19 17:36:36 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesaventoc12f9152024-12-11 18:42:03 -050037 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesaventoab6ac5d2021-10-05 23:23:53 -040038 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento665f89c2023-02-14 16:45:07 -050039 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventof5006be2022-08-19 17:36:36 -040040 fi
41 brew update
42 brew install --formula "${FORMULAE[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040043elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento7227d642024-02-10 01:58:15 -050044 sudo apt-get update -qq
45 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040046elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento7227d642024-02-10 01:58:15 -050047 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventof5006be2022-08-19 17:36:36 -040048 boost-devel openssl-devel sqlite-devel
Davide Pesavento29db0fd2017-08-29 13:32:00 -040049fi
Davide Pesaventof855ec12022-11-16 16:08:35 -050050
51if (( ${#PIP_PKGS[@]} )); then
52 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
53fi