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 |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 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 |
Davide Pesavento | 8a8afa2 | 2025-03-12 17:42:20 -0400 | [diff] [blame] | 17 | pkgconf |
Davide Pesavento | 2d08539 | 2024-03-24 02:12:42 -0400 | [diff] [blame] | 18 | python3 |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 19 | ) |
Davide Pesavento | 8a8afa2 | 2025-03-12 17:42:20 -0400 | [diff] [blame] | 20 | DNF_PKGS=( |
| 21 | boost-devel |
| 22 | gcc-c++ |
| 23 | libasan |
| 24 | lld |
| 25 | openssl-devel |
| 26 | pkgconf |
| 27 | python3 |
| 28 | sqlite-devel |
| 29 | ) |
Davide Pesavento | 5afb1fb | 2024-12-10 15:15:42 -0500 | [diff] [blame] | 30 | FORMULAE=(boost openssl pkgconf) |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 31 | case $JOB_NAME in |
| 32 | *code-coverage) |
Davide Pesavento | ee3ebeb | 2025-03-21 22:08:02 -0400 | [diff] [blame^] | 33 | APT_PKGS+=(lcov) |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 34 | ;; |
| 35 | *Docs) |
Davide Pesavento | ee3ebeb | 2025-03-21 22:08:02 -0400 | [diff] [blame^] | 36 | APT_PKGS+=(doxygen graphviz) |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame] | 37 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 38 | ;; |
| 39 | esac |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 40 | |
Davide Pesavento | ee3ebeb | 2025-03-21 22:08:02 -0400 | [diff] [blame^] | 41 | install_uv() { |
| 42 | if [[ -z $GITHUB_ACTIONS && $ID_LIKE == *debian* ]]; then |
| 43 | sudo apt-get install -qy --no-install-recommends pipx |
| 44 | pipx upgrade uv || pipx install uv |
| 45 | fi |
| 46 | } |
| 47 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 48 | set -x |
| 49 | |
| 50 | if [[ $ID == macos ]]; then |
Davide Pesavento | ee3ebeb | 2025-03-21 22:08:02 -0400 | [diff] [blame^] | 51 | export HOMEBREW_COLOR=1 |
Davide Pesavento | 0751bba | 2024-07-27 20:20:24 -0400 | [diff] [blame] | 52 | export HOMEBREW_NO_ENV_HINTS=1 |
Davide Pesavento | 83f8d16 | 2021-09-26 21:58:36 -0400 | [diff] [blame] | 53 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 81de5d9 | 2022-12-30 01:08:05 -0500 | [diff] [blame] | 54 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 55 | fi |
| 56 | brew update |
| 57 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 58 | elif [[ $ID_LIKE == *debian* ]]; then |
Davide Pesavento | e371003 | 2024-02-05 19:57:05 -0500 | [diff] [blame] | 59 | sudo apt-get update -qq |
| 60 | sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}" |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame] | 61 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 8a8afa2 | 2025-03-12 17:42:20 -0400 | [diff] [blame] | 62 | sudo dnf install -y "${DNF_PKGS[@]}" |
Md Ashiqur Rahman | 8bd3b8a | 2018-09-01 23:43:51 +0000 | [diff] [blame] | 63 | fi |
Davide Pesavento | 83faec7 | 2022-11-14 19:44:41 -0500 | [diff] [blame] | 64 | |
Davide Pesavento | ee3ebeb | 2025-03-21 22:08:02 -0400 | [diff] [blame^] | 65 | case $JOB_NAME in |
| 66 | *code-coverage) |
| 67 | install_uv |
| 68 | ;; |
| 69 | *Docs) |
| 70 | install_uv |
| 71 | export FORCE_COLOR=1 |
| 72 | export UV_NO_MANAGED_PYTHON=1 |
| 73 | uv tool install sphinx --upgrade --with-requirements docs/requirements.txt |
| 74 | ;; |
| 75 | esac |