blob: 12b5de33765bc61007d7b9f20bf234a9ea5de9ba [file] [log] [blame]
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04001#!/usr/bin/env bash
Davide Pesavento73e946e2022-08-06 16:44:54 -04002set -eo pipefail
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04003
Davide Pesavento73e946e2022-08-06 16:44:54 -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)
Davide Pesavento87208f92022-08-30 19:51:23 -040011 PIP_PKGS+=('gcovr~=5.2')
Davide Pesavento73e946e2022-08-06 16:44:54 -040012 ;;
13 *Docs)
14 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento30ed6282021-07-25 20:05:06 -040015 FORMULAE+=(doxygen graphviz)
Davide Pesavento73e946e2022-08-06 16:44:54 -040016 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
17 ;;
18esac
Davide Pesaventod776a932020-03-20 18:42:36 -040019
Davide Pesavento73e946e2022-08-06 16:44:54 -040020set -x
21
22if [[ $ID == macos ]]; then
Davide Pesavento83f8d162021-09-26 21:58:36 -040023 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento73e946e2022-08-06 16:44:54 -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 Pesaventod776a932020-03-20 18:42:36 -040031 fi
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040032
Davide Pesavento73e946e2022-08-06 16:44:54 -040033elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoe11c8d82016-04-16 14:32:07 +020034 sudo apt-get -qq update
Davide Pesavento73e946e2022-08-06 16:44:54 -040035 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesaventoc44cc832017-04-03 22:11:48 -040036
Davide Pesavento73e946e2022-08-06 16:44:54 -040037 if (( ${#PIP_PKGS[@]} )); then
38 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
39 fi
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000040
Davide Pesavento73e946e2022-08-06 16:44:54 -040041elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento2349e282020-03-24 14:28:03 -040042 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
43 boost-devel openssl-devel sqlite-devel
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000044fi