blob: a677d9113957af4eeeea4aea1ef7767ff4b324f8 [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 Pesaventof5006be2022-08-19 17:36:36 -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 Pesavento29db0fd2017-08-29 13:32:00 -040018
Davide Pesaventof5006be2022-08-19 17:36:36 -040019set -x
20
21if [[ $ID == macos ]]; then
Davide Pesaventoab6ac5d2021-10-05 23:23:53 -040022 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventof5006be2022-08-19 17:36:36 -040023 export HOMEBREW_NO_INSTALL_UPGRADE=1
24 fi
25 brew update
26 brew install --formula "${FORMULAE[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040027elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento29db0fd2017-08-29 13:32:00 -040028 sudo apt-get -qq update
Davide Pesaventof5006be2022-08-19 17:36:36 -040029 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesaventof5006be2022-08-19 17:36:36 -040030elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventof855ec12022-11-16 16:08:35 -050031 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventof5006be2022-08-19 17:36:36 -040032 boost-devel openssl-devel sqlite-devel
Davide Pesavento29db0fd2017-08-29 13:32:00 -040033fi
Davide Pesaventof855ec12022-11-16 16:08:35 -050034
35if (( ${#PIP_PKGS[@]} )); then
36 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
37fi