Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 4 | APT_PKGS=( |
Davide Pesavento | 2d08539 | 2024-03-24 02:12:42 -0400 | [diff] [blame] | 5 | dpkg-dev |
| 6 | g++ |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 7 | libboost-chrono-dev |
| 8 | libboost-date-time-dev |
| 9 | libboost-dev |
| 10 | libboost-filesystem-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 |
Davide Pesavento | 2d08539 | 2024-03-24 02:12:42 -0400 | [diff] [blame] | 19 | python3 |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 20 | ) |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -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) |
Davide Pesavento | 87208f9 | 2022-08-30 19:51:23 -0400 | [diff] [blame] | 26 | PIP_PKGS+=('gcovr~=5.2') |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 27 | ;; |
| 28 | *Docs) |
| 29 | APT_PKGS+=(doxygen graphviz python3-pip) |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame] | 30 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 31 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 32 | ;; |
| 33 | esac |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 34 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 35 | set -x |
| 36 | |
| 37 | if [[ $ID == macos ]]; then |
Davide Pesavento | 83f8d16 | 2021-09-26 21:58:36 -0400 | [diff] [blame] | 38 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 81de5d9 | 2022-12-30 01:08:05 -0500 | [diff] [blame] | 39 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 40 | fi |
| 41 | brew update |
| 42 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 43 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 44 | sudo apt-get update -qq |
| 45 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 46 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 47 | sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 48 | boost-devel openssl-devel sqlite-devel |
Md Ashiqur Rahman | 8bd3b8a | 2018-09-01 23:43:51 +0000 | [diff] [blame] | 49 | fi |
Davide Pesavento | 83faec7 | 2022-11-14 19:44:41 -0500 | [diff] [blame] | 50 | |
| 51 | if (( ${#PIP_PKGS[@]} )); then |
| 52 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 53 | fi |