This repository has been archived by the owner on Mar 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
83 lines (79 loc) · 3.8 KB
/
Dockerfile
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
FROM ubuntu:14.04
ENV LIBSODIUM_VERSION=1.0.16
ENV SPDLOG_VERSION=1.1.0
ENV OLM_VERSION=2.2.2
ENV CMAKE_VERSION=3.12.1
ENV CMAKE_SHORT_VERSION=3.12
RUN \
apt-get update -qq && \
apt-get install -y --no-install-recommends apt-transport-https software-properties-common curl && \
# cmake
curl https://cmake.org/files/v${CMAKE_SHORT_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh -o cmake-install.sh && \
bash cmake-install.sh --skip-license --prefix=/usr/local && \
export PATH="/usr/local/bin:$PATH" && \
rm -f /*.sh && \
# Toolchains
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-add-repository "deb https://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main" && \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
ninja-build \
pkg-config \
curl \
make \
clang++-6.0 \
clang-6.0 \
g++-8 \
g++-5 \
unzip git lcov \
libssl-dev \
openssl && \
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10 && \
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 10 && \
sudo update-alternatives --set gcc "/usr/bin/gcc-8" && \
sudo update-alternatives --set g++ "/usr/bin/g++-8" && \
# libsodium
mkdir -p /build/libsodium && cd /build/libsodium && \
curl -L https://download.libsodium.org/libsodium/releases/libsodium-${LIBSODIUM_VERSION}.tar.gz -o libsodium-${LIBSODIUM_VERSION}.tar.gz && \
tar xfz libsodium-${LIBSODIUM_VERSION}.tar.gz && cd /build/libsodium/libsodium-${LIBSODIUM_VERSION}/ && \
./configure && make && make check && make install && \
# spdlog
mkdir -p /build/spdlog && cd /build/spdlog && \
curl -L https://github.com/gabime/spdlog/archive/v${SPDLOG_VERSION}.tar.gz -o spdlog-${SPDLOG_VERSION}.tar.gz && \
tar xfz spdlog-${SPDLOG_VERSION}.tar.gz && cd /build/spdlog/spdlog-${SPDLOG_VERSION}/ && \
cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release \
-DSPDLOG_BUILD_EXAMPLES=0 \
-DSPDLOG_BUILD_BENCH=0 \
-DSPDLOG_BUILD_TESTING=0 && \
cmake --build build --target install && \
# boost
mkdir -p /build/boost && cd /build/boost && \
curl -L https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz -o boost_1_68_0.tar.gz && \
tar xfz boost_1_68_0.tar.gz && cd /build/boost/boost_1_68_0/ && \
./bootstrap.sh --with-libraries=random,thread,system,iostreams,atomic,chrono,date_time,regex && \
./b2 -d0 cxxstd=14 variant=release link=static threading=multi --layout=system && \
./b2 -d0 install && \
# Gtest
mkdir -p /build/gtest && cd /build/gtest && \
curl -L https://github.com/google/googletest/archive/release-1.8.1.tar.gz -o release-1.8.1.tar.gz && \
tar xfz release-1.8.1.tar.gz && cd /build/gtest/googletest-release-1.8.1/ && \
cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release && \
cmake --build build --target install && \
# libolm
mkdir -p /build/olm && cd /build/olm && \
git clone https://git.matrix.org/git/olm.git && \
cd olm && mkdir -p cmake && \
git checkout ${OLM_VERSION} && \
curl -L https://raw.githubusercontent.com/mujx/mtxclient/master/deps/cmake/OlmCMakeLists.txt -o CMakeLists.txt && \
curl -L https://raw.githubusercontent.com/mujx/mtxclient/master/deps/cmake/OlmConfig.cmake.in -o cmake/OlmConfig.cmake.in && \
cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release && \
cmake --build build --target install && \
# json.hpp
curl -L https://github.com/nlohmann/json/releases/download/v3.2.0/json.hpp -o /usr/local/include/json.hpp && \
rm -rf /build/* && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
apt-get autoclean && \
apt-get autoremove
WORKDIR /build