2019-12-23 05:52:25 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-05-25 09:07:08 +03:00
|
|
|
# Copyright The OpenTelemetry Authors
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2019-12-23 05:52:25 +03:00
|
|
|
set -e
|
|
|
|
|
2020-08-26 05:31:17 +03:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
apt-get update
|
2020-08-31 21:12:34 +03:00
|
|
|
|
2021-01-18 11:40:24 +03:00
|
|
|
export CMAKE_VERSION=3.15.2
|
2021-03-25 08:54:28 +03:00
|
|
|
export GOOGLETEST_VERSION=1.10.0
|
2021-01-18 11:40:24 +03:00
|
|
|
|
2021-03-25 08:54:28 +03:00
|
|
|
cmake_install() {
|
|
|
|
tmp_dir=$(mktemp -d)
|
|
|
|
pushd $tmp_dir
|
|
|
|
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh
|
|
|
|
chmod +x cmake-${CMAKE_VERSION}-Linux-x86_64.sh
|
|
|
|
./cmake-${CMAKE_VERSION}-Linux-x86_64.sh --prefix=/usr/local --skip-license
|
|
|
|
rm cmake-${CMAKE_VERSION}-Linux-x86_64.sh
|
|
|
|
popd
|
|
|
|
}
|
|
|
|
|
|
|
|
googletest_install() {
|
|
|
|
# Follows these instructions
|
|
|
|
# https://gist.github.com/dlime/313f74fd23e4267c4a915086b84c7d3d
|
|
|
|
tmp_dir=$(mktemp -d)
|
|
|
|
pushd $tmp_dir
|
|
|
|
wget https://github.com/google/googletest/archive/release-${GOOGLETEST_VERSION}.tar.gz
|
|
|
|
tar -xf release-${GOOGLETEST_VERSION}.tar.gz
|
|
|
|
cd googletest-release-${GOOGLETEST_VERSION}/
|
|
|
|
mkdir build && cd build
|
|
|
|
cmake .. -DBUILD_SHARED_LIBS=ON -DINSTALL_GTEST=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr
|
|
|
|
make -j $(nproc)
|
|
|
|
make install
|
|
|
|
ldconfig
|
|
|
|
popd
|
|
|
|
}
|
|
|
|
|
|
|
|
cmake_install
|
2021-01-18 11:40:24 +03:00
|
|
|
|
2020-08-31 21:12:34 +03:00
|
|
|
set +e
|
|
|
|
echo \
|
2020-01-29 08:33:05 +03:00
|
|
|
libbenchmark-dev \
|
2020-08-26 05:31:17 +03:00
|
|
|
zlib1g-dev \
|
|
|
|
sudo \
|
2020-08-31 21:12:34 +03:00
|
|
|
libcurl4-openssl-dev \
|
|
|
|
nlohmann-json-dev \
|
|
|
|
nlohmann-json3 \
|
|
|
|
nlohmann-json3-dev | xargs -n 1 apt-get install --ignore-missing --no-install-recommends --no-install-suggests -y
|
|
|
|
set -e
|
2019-12-23 05:52:25 +03:00
|
|
|
|
2021-03-25 08:54:28 +03:00
|
|
|
googletest_install
|