blob: 12b5de33765bc61007d7b9f20bf234a9ea5de9ba [file] [log] [blame]
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04001#!/usr/bin/env bash
Davide Pesavento27dd70c2022-08-19 16:24:28 -04002set -eo pipefail
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04003
Davide Pesavento27dd70c2022-08-19 16:24:28 -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+=(doxygen graphviz python3-pip)
Davide Pesavento3c7f6452021-10-02 04:06:26 -040015 FORMULAE+=(doxygen graphviz)
Davide Pesavento27dd70c2022-08-19 16:24:28 -040016 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
17 ;;
18esac
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040019
Davide Pesavento27dd70c2022-08-19 16:24:28 -040020set -x
21
22if [[ $ID == macos ]]; then
Davide Pesavento3c7f6452021-10-02 04:06:26 -040023 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento27dd70c2022-08-19 16:24:28 -040024 export HOMEBREW_NO_INSTALL_UPGRADE=1
25 fi
26 brew update
27 brew install --formula "${FORMULAE[@]}"
28
29 if (( ${#PIP_PKGS[@]} )); then
30 pip3 install --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
Davide Pesaventoec61b742020-04-18 01:00:12 -040031 fi
32
Davide Pesavento27dd70c2022-08-19 16:24:28 -040033elif [[ $ID_LIKE == *debian* ]]; then
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040034 sudo apt-get -qq update
Davide Pesavento27dd70c2022-08-19 16:24:28 -040035 sudo apt-get -qy install "${APT_PKGS[@]}"
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040036
Davide Pesavento27dd70c2022-08-19 16:24:28 -040037 if (( ${#PIP_PKGS[@]} )); then
38 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
39 fi
Davide Pesavento7e7bd892022-07-10 00:30:06 -040040
Davide Pesavento27dd70c2022-08-19 16:24:28 -040041elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento7e7bd892022-07-10 00:30:06 -040042 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
43 boost-devel openssl-devel sqlite-devel
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040044fi