blob: c114f8dda7b482426904d2ce51d8d17d1161a087 [file] [log] [blame]
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05001#!/usr/bin/env bash
Davide Pesaventoda1a4d32022-08-19 19:03:24 -04002set -eo pipefail
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05003
Davide Pesaventoda1a4d32022-08-19 19:03:24 -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 Pesavento8dce1942021-10-02 22:31:26 -040015 FORMULAE+=(doxygen graphviz)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040016 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
17 ;;
18esac
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050019
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040020set -x
21
22if [[ $ID == macos ]]; then
Davide Pesavento8dce1942021-10-02 22:31:26 -040023 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento36651f12023-01-02 17:07:21 -050024 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040025 fi
26 brew update
27 brew install --formula "${FORMULAE[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040028elif [[ $ID_LIKE == *debian* ]]; then
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050029 sudo apt-get -qq update
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040030 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040031elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventob68f2842022-11-17 19:07:04 -050032 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventof2784382022-07-09 19:58:53 -040033 boost-devel openssl-devel sqlite-devel
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050034fi
Davide Pesaventob68f2842022-11-17 19:07:04 -050035
36if (( ${#PIP_PKGS[@]} )); then
37 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
38fi