blob: c114f8dda7b482426904d2ce51d8d17d1161a087 [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 Pesavento81de5d92022-12-30 01:08:05 -050024 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento73e946e2022-08-06 16:44:54 -040025 fi
26 brew update
27 brew install --formula "${FORMULAE[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040028elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoe11c8d82016-04-16 14:32:07 +020029 sudo apt-get -qq update
Davide Pesavento73e946e2022-08-06 16:44:54 -040030 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040031elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoea5ce492022-09-30 20:25:25 -040032 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento2349e282020-03-24 14:28:03 -040033 boost-devel openssl-devel sqlite-devel
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000034fi
Davide Pesavento83faec72022-11-14 19:44:41 -050035
36if (( ${#PIP_PKGS[@]} )); then
37 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
38fi