Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 3 | |
Davide Pesavento | 8d6192a | 2024-02-09 21:23:50 -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-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 |
| 18 | pkg-config |
| 19 | python3-minimal |
| 20 | ) |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 21 | FORMULAE=(boost openssl pkg-config) |
| 22 | PIP_PKGS=() |
| 23 | case $JOB_NAME in |
| 24 | *code-coverage) |
| 25 | APT_PKGS+=(lcov python3-pip) |
| 26 | PIP_PKGS+=('gcovr~=5.2') |
| 27 | ;; |
| 28 | *Docs) |
| 29 | APT_PKGS+=(doxygen graphviz python3-pip) |
Davide Pesavento | 8dce194 | 2021-10-02 22:31:26 -0400 | [diff] [blame] | 30 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 31 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 32 | ;; |
| 33 | esac |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 34 | |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 35 | set -x |
| 36 | |
| 37 | if [[ $ID == macos ]]; then |
Davide Pesavento | 8dce194 | 2021-10-02 22:31:26 -0400 | [diff] [blame] | 38 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 36651f1 | 2023-01-02 17:07:21 -0500 | [diff] [blame] | 39 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 40 | fi |
| 41 | brew update |
| 42 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 43 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | 8d6192a | 2024-02-09 21:23:50 -0500 | [diff] [blame] | 44 | sudo apt-get update -qq |
| 45 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 46 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 8d6192a | 2024-02-09 21:23:50 -0500 | [diff] [blame] | 47 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | f278438 | 2022-07-09 19:58:53 -0400 | [diff] [blame] | 48 | boost-devel openssl-devel sqlite-devel |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 49 | fi |
Davide Pesavento | b68f284 | 2022-11-17 19:07:04 -0500 | [diff] [blame] | 50 | |
| 51 | if (( ${#PIP_PKGS[@]} )); then |
| 52 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 53 | fi |