blob: 21becbc81a6114f15d8edac337998e544738bc92 [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
Davide Pesavento8d6192a2024-02-09 21:23:50 -050010 libboost-iostreams-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
Davide Pesavento35488922025-03-21 00:33:34 -040018 pkgconf
Davide Pesavento6a562f02024-04-22 01:11:31 -040019 python3
Davide Pesavento8d6192a2024-02-09 21:23:50 -050020)
Davide Pesavento35488922025-03-21 00:33:34 -040021DNF_PKGS=(
22 boost-devel
23 gcc-c++
24 libasan
25 lld
26 openssl-devel
27 pkgconf
28 python3
29 sqlite-devel
30)
Davide Pesaventof4571e82024-12-14 15:15:34 -050031FORMULAE=(boost openssl pkgconf)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040032PIP_PKGS=()
33case $JOB_NAME in
34 *code-coverage)
35 APT_PKGS+=(lcov python3-pip)
36 PIP_PKGS+=('gcovr~=5.2')
37 ;;
38 *Docs)
39 APT_PKGS+=(doxygen graphviz python3-pip)
Davide Pesavento8dce1942021-10-02 22:31:26 -040040 FORMULAE+=(doxygen graphviz)
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040041 PIP_PKGS+=(sphinx sphinxcontrib-doxylink)
42 ;;
43esac
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050044
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040045set -x
46
47if [[ $ID == macos ]]; then
awlane880e7152024-07-26 18:48:05 -050048 export HOMEBREW_NO_ENV_HINTS=1
Davide Pesavento8dce1942021-10-02 22:31:26 -040049 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesavento36651f12023-01-02 17:07:21 -050050 export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040051 fi
52 brew update
53 brew install --formula "${FORMULAE[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040054elif [[ $ID_LIKE == *debian* ]]; then
Davide Pesavento8d6192a2024-02-09 21:23:50 -050055 sudo apt-get update -qq
56 sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
Davide Pesaventoda1a4d32022-08-19 19:03:24 -040057elif [[ $ID_LIKE == *fedora* ]]; then
Davide Pesavento35488922025-03-21 00:33:34 -040058 sudo dnf install -y "${DNF_PKGS[@]}"
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050059fi
Davide Pesaventob68f2842022-11-17 19:07:04 -050060
61if (( ${#PIP_PKGS[@]} )); then
62 pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}"
63fi