-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild_dependencies.sh
More file actions
executable file
·90 lines (82 loc) · 3.53 KB
/
Copy pathbuild_dependencies.sh
File metadata and controls
executable file
·90 lines (82 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env bash
# build_dependencies.sh — install all build dependencies for firebolt-cpp-transport
#
# Installs to the system prefix (/usr/local) and is intentionally idempotent:
# running it multiple times is safe. Mirrors the dep set and versions pinned in
# .github/Dockerfile so that both the native CI image and the Coverity container
# end up with an identical build environment.
#
# Usage: sh build_dependencies.sh
# (run as root, or with sudo, from any directory)
set -x
set -e
DEPS_GOOGLETEST_V="1.15.2"
DEPS_NLOHMANN_JSON_V="3.11.3"
DEPS_JSON_SCHEMA_VALIDATOR_V="2.3.0"
DEPS_WEBSOCKETPP_V="0.8.2"
# ---------------------------------------------------------------------------
# 1. System packages
# ---------------------------------------------------------------------------
apt-get update
apt-get install -y --no-install-recommends --fix-missing \
build-essential ca-certificates \
cmake pkg-config clang-format \
libboost-all-dev \
curl wget git \
python3-pip
if python3 -m pip help install | grep -q -- '--break-system-packages'; then
python3 -m pip install --break-system-packages gcovr
else
python3 -m pip install gcovr
fi
# ---------------------------------------------------------------------------
# 2. googletest
# ---------------------------------------------------------------------------
WORK_DIR="$(mktemp -d)"
trap 'rm -rf "$WORK_DIR"' EXIT
dir="googletest-${DEPS_GOOGLETEST_V}"
curl -sL "https://github.com/google/googletest/releases/download/v${DEPS_GOOGLETEST_V}/${dir}.tar.gz" \
| tar xzf - -C "$WORK_DIR"
cmake -B "$WORK_DIR/build/${dir}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
"$WORK_DIR/${dir}"
cmake --build "$WORK_DIR/build/${dir}" --target install
# ---------------------------------------------------------------------------
# 3. nlohmann/json
# ---------------------------------------------------------------------------
dir="nlohmann-json-${DEPS_NLOHMANN_JSON_V}"
git clone --depth 1 --branch "v${DEPS_NLOHMANN_JSON_V}" \
"https://github.com/nlohmann/json" "$WORK_DIR/${dir}"
cmake -B "$WORK_DIR/build/${dir}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DJSON_BuildTests=OFF \
"$WORK_DIR/${dir}"
cmake --build "$WORK_DIR/build/${dir}" --target install
# ---------------------------------------------------------------------------
# 4. json-schema-validator
# ---------------------------------------------------------------------------
dir="json-schema-validator-${DEPS_JSON_SCHEMA_VALIDATOR_V}"
curl -sL "https://github.com/pboettch/json-schema-validator/archive/refs/tags/${DEPS_JSON_SCHEMA_VALIDATOR_V}.tar.gz" \
| tar xzf - -C "$WORK_DIR"
cmake -B "$WORK_DIR/build/${dir}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DJSON_VALIDATOR_BUILD_TESTS=OFF \
-DJSON_VALIDATOR_BUILD_EXAMPLES=OFF \
"$WORK_DIR/${dir}"
cmake --build "$WORK_DIR/build/${dir}" --target install
# ---------------------------------------------------------------------------
# 5. websocketpp (header-only, cmake install registers package config)
# ---------------------------------------------------------------------------
dir="websocketpp-${DEPS_WEBSOCKETPP_V}"
curl -sL "https://github.com/zaphoyd/websocketpp/archive/refs/tags/${DEPS_WEBSOCKETPP_V}.tar.gz" \
| tar xzf - -C "$WORK_DIR"
cmake -B "$WORK_DIR/build/${dir}" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
"$WORK_DIR/${dir}"
cmake --build "$WORK_DIR/build/${dir}" --target install