Davide Pesavento | 0bd3731 | 2017-08-20 20:21:13 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Davide Pesavento | 0bd3731 | 2017-08-20 20:21:13 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | 543f2b6 | 2024-02-10 16:22:24 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
Davide Pesavento | 5021314 | 2024-04-22 03:44:05 -0400 | [diff] [blame] | 5 | dpkg-dev |
| 6 | g++ |
Davide Pesavento | 543f2b6 | 2024-02-10 16:22:24 -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 | 5021314 | 2024-04-22 03:44:05 -0400 | [diff] [blame] | 20 | python3 |
Davide Pesavento | 543f2b6 | 2024-02-10 16:22:24 -0500 | [diff] [blame] | 21 | ) |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -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 | ba8a4ed | 2021-10-13 21:28:43 -0400 | [diff] [blame] | 31 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -0400 | [diff] [blame] | 32 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 33 | ;; |
| 34 | esac |
Davide Pesavento | 0bd3731 | 2017-08-20 20:21:13 -0400 | [diff] [blame] | 35 | |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -0400 | [diff] [blame] | 36 | set -x |
| 37 | |
| 38 | if [[ $ID == macos ]]; then |
Davide Pesavento | bcd7683 | 2024-07-19 16:00:01 -0400 | [diff] [blame^] | 39 | export HOMEBREW_NO_ENV_HINTS=1 |
Davide Pesavento | ba8a4ed | 2021-10-13 21:28:43 -0400 | [diff] [blame] | 40 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 1b640fd | 2023-01-04 21:00:05 -0500 | [diff] [blame] | 41 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -0400 | [diff] [blame] | 42 | fi |
| 43 | brew update |
| 44 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -0400 | [diff] [blame] | 45 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 543f2b6 | 2024-02-10 16:22:24 -0500 | [diff] [blame] | 46 | sudo apt-get update -qq |
| 47 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -0400 | [diff] [blame] | 48 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 543f2b6 | 2024-02-10 16:22:24 -0500 | [diff] [blame] | 49 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | ede5963 | 2022-08-26 20:35:44 -0400 | [diff] [blame] | 50 | boost-devel openssl-devel sqlite-devel |
Davide Pesavento | 0bd3731 | 2017-08-20 20:21:13 -0400 | [diff] [blame] | 51 | fi |
Davide Pesavento | 65ee992 | 2022-11-16 00:21:43 -0500 | [diff] [blame] | 52 | |
| 53 | if (( ${#PIP_PKGS[@]} )); then |
| 54 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 55 | fi |