blob: 1a4bfc1515b95da20a84d3344f04e72ba7296148 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
Davide Pesavento6d1b6722022-08-20 17:54:05 -04002set -eo pipefail
Zhiyi Zhang8617a792017-01-17 16:45:56 -08003
Davide Pesavento526d4c82024-02-09 18:56:05 -05004APT_PKGS=(
5 build-essential
6 libboost-chrono-dev
7 libboost-date-time-dev
8 libboost-dev
9 libboost-filesystem-dev
10 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
18 python3-minimal
19)
Davide Pesavento6d1b6722022-08-20 17:54:05 -040020FORMULAE=(boost openssl pkg-config)
21PIP_PKGS=()
22case $JOB_NAME in
23 *code-coverage)
24 APT_PKGS+=(lcov python3-pip)
25 PIP_PKGS+=('gcovr~=5.2')
26 ;;
27 *Docs)
28 APT_PKGS+=(doxygen graphviz)
Davide Pesavento725d3fc2021-11-19 23:37:03 -050029 FORMULAE+=(doxygen graphviz)
Davide Pesavento6d1b6722022-08-20 17:54:05 -040030 ;;
31esac
Zhiyi Zhang8617a792017-01-17 16:45:56 -080032
Davide Pesavento6d1b6722022-08-20 17:54:05 -040033set -x
34
35if [[ $ID == macos ]]; then
Davide Pesavento725d3fc2021-11-19 23:37:03 -050036 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventod78e77e2022-12-31 17:01:32 -050037 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesavento6d1b6722022-08-20 17:54:05 -040038 fi
39 brew update
40 brew install --formula "${FORMULAE[@]}"
Davide Pesavento6d1b6722022-08-20 17:54:05 -040041elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento526d4c82024-02-09 18:56:05 -050042 sudo apt-get update -qq
43 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesavento6d1b6722022-08-20 17:54:05 -040044elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento526d4c82024-02-09 18:56:05 -050045 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesavento573a6212022-07-09 21:56:41 -040046 boost-devel openssl-devel sqlite-devel
Zhiyi Zhang8617a792017-01-17 16:45:56 -080047fi
Davide Pesaventof8fe6852022-11-15 13:55:07 -050048
49if (( ${#PIP_PKGS[@]} )); then
50 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
51fi