Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 3 | |
Davide Pesavento | c6cfed6 | 2024-02-09 21:18:06 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
Davide Pesavento | 34a0b3f | 2024-04-21 19:01:26 -0400 | [diff] [blame] | 5 | dpkg-dev |
| 6 | g++ |
Davide Pesavento | c6cfed6 | 2024-02-09 21:18:06 -0500 | [diff] [blame] | 7 | 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 Pesavento | 34a0b3f | 2024-04-21 19:01:26 -0400 | [diff] [blame] | 20 | python3 |
Davide Pesavento | c6cfed6 | 2024-02-09 21:18:06 -0500 | [diff] [blame] | 21 | ) |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 22 | FORMULAE=(boost openssl pkg-config) |
| 23 | PIP_PKGS=() |
| 24 | case $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 Pesavento | 22eeb29 | 2021-10-01 21:20:53 -0400 | [diff] [blame] | 31 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 32 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 33 | ;; |
| 34 | esac |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 35 | |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 36 | set -x |
| 37 | |
| 38 | if [[ $ID == macos ]]; then |
Davide Pesavento | 22eeb29 | 2021-10-01 21:20:53 -0400 | [diff] [blame] | 39 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 3fb27eb | 2022-12-31 14:00:51 -0500 | [diff] [blame] | 40 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 41 | fi |
| 42 | brew update |
| 43 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 44 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | c6cfed6 | 2024-02-09 21:18:06 -0500 | [diff] [blame] | 45 | sudo apt-get update -qq |
| 46 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 47 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | c6cfed6 | 2024-02-09 21:18:06 -0500 | [diff] [blame] | 48 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | 9c4bd6d | 2022-07-26 15:28:08 -0400 | [diff] [blame] | 49 | boost-devel openssl-devel sqlite-devel |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 50 | fi |
Davide Pesavento | cda4489 | 2022-11-15 13:40:33 -0500 | [diff] [blame] | 51 | |
| 52 | if (( ${#PIP_PKGS[@]} )); then |
| 53 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 54 | fi |