Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 3 | |
Davide Pesavento | 16479f3 | 2024-02-10 17:10:35 -0500 | [diff] [blame^] | 4 | APT_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 Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 20 | FORMULAE=(boost openssl pkg-config) |
| 21 | PIP_PKGS=() |
| 22 | case $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 python3-pip) |
Davide Pesavento | 90a632b | 2021-10-04 01:05:24 -0400 | [diff] [blame] | 29 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 30 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 31 | ;; |
| 32 | esac |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 33 | |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 34 | set -x |
| 35 | |
| 36 | if [[ $ID == macos ]]; then |
Davide Pesavento | 90a632b | 2021-10-04 01:05:24 -0400 | [diff] [blame] | 37 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | dadbc3e | 2023-02-14 02:32:36 -0500 | [diff] [blame] | 38 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 39 | fi |
| 40 | brew update |
| 41 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 42 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 16479f3 | 2024-02-10 17:10:35 -0500 | [diff] [blame^] | 43 | sudo apt-get update -qq |
| 44 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 45 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 16479f3 | 2024-02-10 17:10:35 -0500 | [diff] [blame^] | 46 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | 423553e | 2022-08-19 20:46:06 -0400 | [diff] [blame] | 47 | boost-devel openssl-devel sqlite-devel |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 48 | fi |
Davide Pesavento | b2034db | 2022-11-16 17:21:22 -0500 | [diff] [blame] | 49 | |
| 50 | if (( ${#PIP_PKGS[@]} )); then |
| 51 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 52 | fi |