blob: 299b0525f8460603b6138050bf68313ea6940a6c [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 Pesavento1d484532022-08-19 22:08:31 -04004APT_PKGS=(build-essential pkg-config python3-minimal
5 libboost-all-dev libssl-dev libsqlite3-dev)
6FORMULAE=(boost openssl pkg-config)
7PIP_PKGS=()
8case $JOB_NAME in
9 *code-coverage)
10 APT_PKGS+=(lcov python3-pip)
11 PIP_PKGS+=('gcovr~=5.2')
12 ;;
13 *Docs)
14 APT_PKGS+=(python3-pip)
15 PIP_PKGS+=(sphinx)
16 ;;
17esac
Davide Pesavento4a160042020-04-13 16:50:02 -040018
Davide Pesavento1d484532022-08-19 22:08:31 -040019set -x
20
21if [[ $ID == macos ]]; then
Davide Pesavento333e3eb2021-10-12 19:30:51 -040022 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventoe9b09b82023-01-19 13:30:07 -050023 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento1d484532022-08-19 22:08:31 -040024 fi
25 brew update
26 brew install --formula "${FORMULAE[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040027elif [[ $ID_LIKE == *debian* ]]; then
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040028 sudo apt-get -qq update
Davide Pesavento1d484532022-08-19 22:08:31 -040029 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040030elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoc2414752022-11-16 16:56:45 -050031 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento1d484532022-08-19 22:08:31 -040032 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040033fi
Davide Pesaventoc2414752022-11-16 16:56:45 -050034
35if (( ${#PIP_PKGS[@]} )); then
36 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
37fi