-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.builder
210 lines (199 loc) · 5.69 KB
/
Dockerfile.builder
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
FROM linuxdeepin/deepin:beige-loong64-v1.4.0
ARG NODE_VERSION=20.16.0
RUN groupadd --gid 1000 builduser && \
useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
ENV TEMP=/tmp
RUN chmod a+rwx /tmp
# Omitted lighttpd, rpm, xcompmgr and xcb as deepin doesn't offer them. Fortunately we could compile without them somehow.
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'deb https://mirrors.ustc.edu.cn/deepin/beige beige main commercial community' > /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
file \
gdb \
gnupg \
locales \
lsb-release \
nano \
python3-pip \
sudo \
vim-nox \
wget \
lsof \
software-properties-common \
desktop-file-utils \
xvfb \
gperf \
bison \
python3-dbusmock \
openjdk-8-jre \
generate-ninja \
ninja-build \
build-essential \
clang-18 \
llvm-18 \
lld-18 \
llvm-18-dev \
libclang-18-dev \
libclang-rt-18-dev \
libnotify-bin \
libfuse2 \
libdbus-1-dev \
libgtk-3-dev \
libnotify-dev \
libasound2-dev \
libcap-dev \
libcups2-dev \
libxtst-dev \
libxss1 \
libnss3-dev \
# From https://chromium.googlesource.com/chromium/src/+/HEAD/build/install-build-deps.py
binutils \
bison \
bzip2 \
cdbs \
curl \
dbus-x11 \
devscripts \
dpkg-dev \
elfutils \
fakeroot \
flex \
git-core \
gperf \
libasound2-dev \
libatspi2.0-dev \
libbrlapi-dev \
libbz2-dev \
libc6-dev \
libcairo2-dev \
libcap-dev \
libcups2-dev \
libcurl4-gnutls-dev \
libdrm-dev \
libelf-dev \
libevdev-dev \
libffi-dev \
libfuse2 \
libgbm-dev \
libglib2.0-dev \
libglu1-mesa-dev \
libgtk-3-dev \
libkrb5-dev \
libnspr4-dev \
libnss3-dev \
libpam0g-dev \
libpci-dev \
libpulse-dev \
libsctp-dev \
libspeechd-dev \
libsqlite3-dev \
libssl-dev \
libsystemd-dev \
libudev-dev \
libudev1 \
libva-dev \
libwww-perl \
libxshmfence-dev \
libxslt1-dev \
libxss-dev \
libxt-dev \
libxtst-dev \
locales \
openbox \
p7zip \
patch \
perl \
pkgconf \
ruby \
uuid-dev \
wdiff \
x11-utils \
xz-utils \
zip \
libatk1.0-0 \
libatspi2.0-0 \
libc6 \
libcairo2 \
libcap2 \
libcgi-session-perl \
libcups2 \
libdrm2 \
libegl1 \
libevdev2 \
libexpat1 \
libfontconfig1 \
libfreetype6 \
libgbm1 \
libglib2.0-0 \
libgl1 \
libgtk-3-0 \
libpam0g \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libpci3 \
libpcre3 \
libpixman-1-0 \
libspeechd2 \
libstdc++6 \
libsqlite3-0 \
libuuid1 \
libwayland-egl1 \
libwayland-egl1-mesa \
libx11-6 \
libx11-xcb1 \
libxau6 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxdmcp6 \
libxext6 \
libxfixes3 \
libxi6 \
libxinerama1 \
libxrender1 \
libxtst6 \
x11-utils \
x11-xserver-utils \
xserver-xorg-core \
xserver-xorg-video-dummy \
xvfb \
zlib1g \
# From compilation errors
libx11-xcb-dev \
libxcb-xkb-dev \
libxkbcommon-x11-dev \
libdav1d-dev \
libyuv-dev \
mesa-common-dev
RUN curl -L -O https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-loong64.tar.gz && \
tar -xzf node-v${NODE_VERSION}-linux-loong64.tar.gz && \
cp -R node-v${NODE_VERSION}-linux-loong64/* /usr/local/ && \
rm -rf node-v${NODE_VERSION}-linux-loong64* && \
npm i -g yarn @esbuild/[email protected]
COPY libgcc.tar.gz libffi.tar.gz rustc.tar.gz .
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN mkdir libgcc libffi && \
tar -xzvf libgcc.tar.gz -C libgcc && \
# Replacing the crtbeginS.o is hacky, we might need to build the whole gcc instead
cp libgcc/gcc/loongarch64-unknown-linux-gnu/*/crtbeginS.o /usr/lib/gcc/loongarch64-linux-gnu/*/ && \
tar -xzvf libffi.tar.gz -C libffi && \
# Also hacky here
cp libffi/libffi_convenience.a /usr/lib/loongarch64-linux-gnu/libffi_pic.a && \
tar -xzvf rustc.tar.gz -C /usr && \
# Chromium seems to require that bindgen binary lives together with llvm
cargo install [email protected] --root /usr/lib/llvm-18
RUN echo 'builduser ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-builduser && \
echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 && \
update-alternatives --install /usr/bin/clang-cpp clang-cpp /usr/bin/clang-cpp-18 100 && \
update-alternatives --install /usr/bin/lld lld /usr/bin/lld-18 100 && \
update-alternatives --install /usr/bin/lld-link lld-link /usr/bin/lld-link-18 100 && \
update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-18 100
USER builduser
WORKDIR /home/builduser