blob: 25e3b7764d0f9b2562497fdd28c732168658938c [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 Pesavento1d484532022-08-19 22:08:31 -040023 export HOMEBREW_NO_INSTALL_UPGRADE=1
24 fi
25 brew update
26 brew install --formula "${FORMULAE[@]}"
27
28 if (( ${#PIP_PKGS[@]} )); then
29 pip3 install --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040030 fi
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040031
Davide Pesavento1d484532022-08-19 22:08:31 -040032elif [[ $ID_LIKE == *debian* ]]; then
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040033 sudo apt-get -qq update
Davide Pesavento1d484532022-08-19 22:08:31 -040034 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento333e3eb2021-10-12 19:30:51 -040035
Davide Pesavento1d484532022-08-19 22:08:31 -040036 if (( ${#PIP_PKGS[@]} )); then
37 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
38 fi
39
40elif [[ $ID_LIKE == *fedora* ]]; then
41 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
42 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040043fi