blob: a6c00543415d64faed1dbb7f392e614426516128 [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 Pesaventoe3710032024-02-05 19:57:05 -05004APT_PKGS=(
Davide Pesavento2d085392024-03-24 02:12:42 -04005 dpkg-dev
6 g++
Davide Pesaventoe3710032024-02-05 19:57:05 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
Davide Pesaventoe3710032024-02-05 19:57:05 -050010 libboost-log-dev
11 libboost-program-options-dev
12 libboost-stacktrace-dev
13 libboost-test-dev
14 libboost-thread-dev
15 libsqlite3-dev
16 libssl-dev
17 pkg-config
Davide Pesavento2d085392024-03-24 02:12:42 -040018 python3
Davide Pesaventoe3710032024-02-05 19:57:05 -050019)
Davide Pesavento5afb1fb2024-12-10 15:15:42 -050020FORMULAE=(boost openssl pkgconf)
Davide Pesavento73e946e2022-08-06 16:44:54 -040021PIP_PKGS=()
22case $JOB_NAME in
23 *code-coverage)
24 APT_PKGS+=(lcov python3-pip)
Davide Pesavento87208f92022-08-30 19:51:23 -040025 PIP_PKGS+=('gcovr~=5.2')
Davide Pesavento73e946e2022-08-06 16:44:54 -040026 ;;
27 *Docs)
28 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento30ed6282021-07-25 20:05:06 -040029 FORMULAE+=(doxygen graphviz)
Davide Pesavento73e946e2022-08-06 16:44:54 -040030 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
31 ;;
32esac
Davide Pesaventod776a932020-03-20 18:42:36 -040033
Davide Pesavento73e946e2022-08-06 16:44:54 -040034set -x
35
36if [[ $ID == macos ]]; then
Davide Pesavento0751bba2024-07-27 20:20:24 -040037 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento83f8d162021-09-26 21:58:36 -040038 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento81de5d92022-12-30 01:08:05 -050039 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento73e946e2022-08-06 16:44:54 -040040 fi
41 brew update
42 brew install --formula "${FORMULAE[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040043elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoe3710032024-02-05 19:57:05 -050044 sudo apt-get update -qq
45 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040046elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoe3710032024-02-05 19:57:05 -050047 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento2349e282020-03-24 14:28:03 -040048 boost-devel openssl-devel sqlite-devel
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000049fi
Davide Pesavento83faec72022-11-14 19:44:41 -050050
51if (( ${#PIP_PKGS[@]} )); then
52 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
53fi