blob: b78b89924c6a8fb9e086a3c0f3a1ce71ae74b395 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
Davide Pesavento6d1b6722022-08-20 17:54:05 -04002set -eo pipefail
Zhiyi Zhang8617a792017-01-17 16:45:56 -08003
Davide Pesavento6d1b6722022-08-20 17:54:05 -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)
Davide Pesavento725d3fc2021-11-19 23:37:03 -050015 FORMULAE+=(doxygen graphviz)
Davide Pesavento6d1b6722022-08-20 17:54:05 -040016 ;;
17esac
Zhiyi Zhang8617a792017-01-17 16:45:56 -080018
Davide Pesavento6d1b6722022-08-20 17:54:05 -040019set -x
20
21if [[ $ID == macos ]]; then
Davide Pesavento725d3fc2021-11-19 23:37:03 -050022 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventod78e77e2022-12-31 17:01:32 -050023 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento6d1b6722022-08-20 17:54:05 -040024 fi
25 brew update
26 brew install --formula "${FORMULAE[@]}"
Davide Pesavento6d1b6722022-08-20 17:54:05 -040027elif [[ $ID_LIKE == *debian* ]]; then
Zhiyi Zhang8617a792017-01-17 16:45:56 -080028 sudo apt-get -qq update
Davide Pesavento6d1b6722022-08-20 17:54:05 -040029 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento6d1b6722022-08-20 17:54:05 -040030elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventof8fe6852022-11-15 13:55:07 -050031 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento573a6212022-07-09 21:56:41 -040032 boost-devel openssl-devel sqlite-devel
Zhiyi Zhang8617a792017-01-17 16:45:56 -080033fi
Davide Pesaventof8fe6852022-11-15 13:55:07 -050034
35if (( ${#PIP_PKGS[@]} )); then
36 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
37fi