-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.2022-01-01
97 lines (82 loc) · 2.94 KB
/
Dockerfile.2022-01-01
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
91
92
93
94
95
96
97
# Linux and Android build environment for CI
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
ARG LLVM_GPG_KEY="6084 F3CF 814B 57C1 CF12 EFD5 15CF 4D18 AF4F 7421"
ENV ANDROID_NDK_ROOT=/opt/android-ndk
ENV ANDROID_NDK_VERSION=r23b
ARG ANDROID_NDK_SHA1=f47ec4c4badd11e9f593a8450180884a927c330d
#
# GCC & Clang
#
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
git \
gnupg \
python3 \
wget \
# clang \
g++ \
# clang-format \
cmake \
# llvm \
valgrind \
libc++-dev \
libc++abi-dev \
libgtk-3-dev \
liblz4-dev \
libpthread-stubs0-dev \
libsdl2-dev \
libvulkan-dev \
libx11-dev \
libx11-xcb-dev \
; \
rm -rf /var/lib/apt/lists/*
RUN set -eux; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver keyserver.ubuntu.com --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/llvm.gpg --recv-keys "${LLVM_GPG_KEY}"; \
chmod +r /etc/apt/trusted.gpg.d/llvm.gpg; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME"; \
\
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" > /etc/apt/sources.list.d/llvm.list; \
apt-get update; \
apt-get install -y --no-install-recommends \
clang-13 \
clang-format-13 \
llvm-13 \
; \
rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/clang-format-13 /usr/local/bin/clang-format
RUN set -eux; \
{ \
echo 'CC=clang-13'; \
echo 'CXX=clang++-13'; \
echo 'AR=llvm-ar-13'; \
} > /clang.env
RUN set -eux; \
{ \
echo 'CC=gcc'; \
echo 'CXX=g++'; \
} > /gcc.env
#
# Android NDK
#
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
file \
unzip \
; \
rm -rf /var/lib/apt/lists/*
RUN mkdir /tmp/android-ndk && \
cd /tmp/android-ndk && \
\
wget -q -O android-ndk.zip https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip && \
echo "${ANDROID_NDK_SHA1} android-ndk.zip" | sha1sum -c - && \
\
unzip -q android-ndk.zip && \
mv ./android-ndk-${ANDROID_NDK_VERSION} ${ANDROID_NDK_ROOT}
RUN rm -rf /tmp/android-ndk