blob: 2cda8fc004c555f34be76e142fdf0fec2bb58111 [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento1d484532022-08-19 22:08:31 -04002set -eo pipefail
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
Davide Pesavento4fb84302024-02-10 15:45:06 -05004APT_PKGS=(
5 build-essential
6 libboost-chrono-dev
7 libboost-date-time-dev
8 libboost-dev
9 libboost-filesystem-dev
Davide Pesavento43cf7c42024-02-10 18:28:36 -050010 libboost-iostreams-dev
Davide Pesavento4fb84302024-02-10 15:45:06 -050011 libboost-log-dev
12 libboost-program-options-dev
13 libboost-stacktrace-dev
14 libboost-test-dev
15 libboost-thread-dev
16 libsqlite3-dev
17 libssl-dev
18 pkg-config
19 python3-minimal
20)
Davide Pesavento1d484532022-08-19 22:08:31 -040021FORMULAE=(boost openssl pkg-config)
22PIP_PKGS=()
23case $JOB_NAME in
24 *code-coverage)
25 APT_PKGS+=(lcov python3-pip)
26 PIP_PKGS+=('gcovr~=5.2')
27 ;;
28 *Docs)
29 APT_PKGS+=(python3-pip)
30 PIP_PKGS+=(sphinx)
31 ;;
32esac
Davide Pesavento4a160042020-04-13 16:50:02 -040033
Davide Pesavento1d484532022-08-19 22:08:31 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesavento333e3eb2021-10-12 19:30:51 -040037 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventoe9b09b82023-01-19 13:30:07 -050038 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento1d484532022-08-19 22:08:31 -040039 fi
40 brew update
41 brew install --formula "${FORMULAE[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040042elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050043 sudo apt-get update -qq
44 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento1d484532022-08-19 22:08:31 -040045elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento4fb84302024-02-10 15:45:06 -050046 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento1d484532022-08-19 22:08:31 -040047 boost-devel openssl-devel sqlite-devel
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040048fi
Davide Pesaventoc2414752022-11-16 16:56:45 -050049
50if (( ${#PIP_PKGS[@]} )); then
51 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
52fi