blob: b0e54a0867747f5786918dd747908d7d8ec639b6 [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
10 libboost-filesystem-dev
11 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
Davide Pesavento2d085392024-03-24 02:12:42 -040019 python3
Davide Pesaventoe3710032024-02-05 19:57:05 -050020)
Davide Pesavento73e946e2022-08-06 16:44:54 -040021FORMULAE=(boost openssl pkg-config)
22PIP_PKGS=()
23case $JOB_NAME in
24 *code-coverage)
25 APT_PKGS+=(lcov python3-pip)
Davide Pesavento87208f92022-08-30 19:51:23 -040026 PIP_PKGS+=('gcovr~=5.2')
Davide Pesavento73e946e2022-08-06 16:44:54 -040027 ;;
28 *Docs)
29 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento30ed6282021-07-25 20:05:06 -040030 FORMULAE+=(doxygen graphviz)
Davide Pesavento73e946e2022-08-06 16:44:54 -040031 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
32 ;;
33esac
Davide Pesaventod776a932020-03-20 18:42:36 -040034
Davide Pesavento73e946e2022-08-06 16:44:54 -040035set -x
36
37if [[ $ID == macos ]]; then
Davide Pesavento0751bba2024-07-27 20:20:24 -040038 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento83f8d162021-09-26 21:58:36 -040039 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento81de5d92022-12-30 01:08:05 -050040 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento73e946e2022-08-06 16:44:54 -040041 fi
42 brew update
43 brew install --formula "${FORMULAE[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040044elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesaventoe3710032024-02-05 19:57:05 -050045 sudo apt-get update -qq
46 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento73e946e2022-08-06 16:44:54 -040047elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesaventoe3710032024-02-05 19:57:05 -050048 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento2349e282020-03-24 14:28:03 -040049 boost-devel openssl-devel sqlite-devel
Md Ashiqur Rahman8bd3b8a2018-09-01 23:43:51 +000050fi
Davide Pesavento83faec72022-11-14 19:44:41 -050051
52if (( ${#PIP_PKGS[@]} )); then
53 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
54fi