blob: c20d217daafa643f7a8a35d34635d5eae763a8a3 [file] [log] [blame]
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05001#!/usr/bin/env bash
Davide Pesaventoda1a4d32022-08-19 19:03:24 -04002set -eo pipefail
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05003
Davide Pesavento8d6192a2024-02-09 21:23:50 -05004APT_PKGS=(
Davide Pesavento6a562f02024-04-22 01:11:31 -04005 dpkg-dev
6 g++
Davide Pesavento8d6192a2024-02-09 21:23:50 -05007 libboost-chrono-dev
8 libboost-date-time-dev
9 libboost-dev
10 libboost-filesystem-dev
11 libboost-iostreams-dev
12 libboost-log-dev
13 libboost-program-options-dev
14 libboost-stacktrace-dev
15 libboost-test-dev
16 libboost-thread-dev
17 libsqlite3-dev
18 libssl-dev
19 pkg-config
Davide Pesavento6a562f02024-04-22 01:11:31 -040020 python3
Davide Pesavento8d6192a2024-02-09 21:23:50 -050021)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040022FORMULAE=(boost openssl pkg-config)
23PIP_PKGS=()
24case $JOB_NAME in
25 *code-coverage)
26 APT_PKGS+=(lcov python3-pip)
27 PIP_PKGS+=('gcovr~=5.2')
28 ;;
29 *Docs)
30 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento8dce1942021-10-02 22:31:26 -040031 FORMULAE+=(doxygen graphviz)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040032 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
33 ;;
34esac
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050035
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040036set -x
37
38if [[ $ID == macos ]]; then
awlane880e7152024-07-26 18:48:05 -050039 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento8dce1942021-10-02 22:31:26 -040040 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento36651f12023-01-02 17:07:21 -050041 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040042 fi
43 brew update
44 brew install --formula "${FORMULAE[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040045elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento8d6192a2024-02-09 21:23:50 -050046 sudo apt-get update -qq
47 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040048elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento8d6192a2024-02-09 21:23:50 -050049 sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
Davide Pesaventof2784382022-07-09 19:58:53 -040050 boost-devel openssl-devel sqlite-devel
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050051fi
Davide Pesaventob68f2842022-11-17 19:07:04 -050052
53if (( ${#PIP_PKGS[@]} )); then
54 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
55fi