blob: 9b1e073a94eaf94046d2328230936e165f53c769 [file] [log] [blame]
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07001#!/usr/bin/env bash
Davide Pesavento423553e2022-08-19 20:46:06 -04002set -eo pipefail
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07003
Davide Pesavento423553e2022-08-19 20:46:06 -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 Pesavento90a632b2021-10-04 01:05:24 -040015 FORMULAE+=(doxygen graphviz)
Davide Pesavento423553e2022-08-19 20:46:06 -040016 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
17 ;;
18esac
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070019
Davide Pesavento423553e2022-08-19 20:46:06 -040020set -x
21
22if [[ $ID == macos ]]; then
Davide Pesavento90a632b2021-10-04 01:05:24 -040023 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento423553e2022-08-19 20:46:06 -040024 export HOMEBREW_NO_INSTALL_UPGRADE=1
25 fi
26 brew update
27 brew install --formula "${FORMULAE[@]}"
Davide Pesavento423553e2022-08-19 20:46:06 -040028elif [[ $ID_LIKE == *debian* ]]; then
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080029 sudo apt-get -qq update
Davide Pesavento423553e2022-08-19 20:46:06 -040030 sudo apt-get -qy install "${APT_PKGS[@]}"
Davide Pesavento423553e2022-08-19 20:46:06 -040031elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventob2034db2022-11-16 17:21:22 -050032 sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento423553e2022-08-19 20:46:06 -040033 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070034fi
Davide Pesaventob2034db2022-11-16 17:21:22 -050035
36if (( ${#PIP_PKGS[@]} )); then
37 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
38fi