@@ -34,11 +34,13 @@ RUN apt-get update && \
34
34
libncurses-dev \
35
35
libssl-dev \
36
36
libtool-bin \
37
+ lzip \
37
38
make \
38
39
ninja-build \
39
40
patch \
40
41
pkg-config \
41
42
python3 \
43
+ rsync \
42
44
sudo \
43
45
texinfo \
44
46
unzip \
@@ -50,6 +52,11 @@ RUN apt-get update && \
50
52
# Install crosstool-ng
51
53
RUN curl -Lf https://github.com/crosstool-ng/crosstool-ng/archive/{{ ct_ng_version }}.tar.gz | tar xzf - && \
52
54
cd crosstool-ng-{{ ct_ng_version }} && \
55
+ {% if target .startswith ('riscv64-' ) -%}
56
+ # Backport https://github.com/crosstool-ng/crosstool-ng/pull/{2315,2316} to fix build
57
+ curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2315.patch | patch -Np1 && \
58
+ curl -Lf https://github.com/crosstool-ng/crosstool-ng/pull/2316.patch | patch -Np1 && \
59
+ {% endif -%}
53
60
./bootstrap && \
54
61
./configure --prefix=/usr/local && \
55
62
make -j4 && \
@@ -87,8 +94,8 @@ ENV TARGET_CC={{ target }}-gcc \
87
94
TARGET_SYSROOT=/usr/{{ target }}/{{ target }}/sysroot/ \
88
95
TARGET_C_INCLUDE_PATH=/usr/{{ target }}/{{ target }}/sysroot/usr/include/
89
96
90
- ENV CARGO_BUILD_TARGET={{ target | replace('ibm', 'unknown') }}
91
- ENV CARGO_TARGET_{{ target | replace('ibm', 'unknown') | replace('-', '_') | upper }}_LINKER={{ target }}-gcc
97
+ ENV CARGO_BUILD_TARGET={{ target | replace('ibm', 'unknown') | replace('riscv64', 'riscv64gc') }}
98
+ ENV CARGO_TARGET_{{ target | replace('ibm', 'unknown') | replace('-', '_') | replace('riscv64', 'riscv64gc') | upper }}_LINKER={{ target }}-gcc
92
99
RUN echo "set(CMAKE_SYSTEM_NAME Linux)\nset(CMAKE_SYSTEM_PROCESSOR {{ cmake_arch | default(arch) }})\nset(CMAKE_SYSROOT /usr/{{ target }}/{{ target }}/sysroot/)\nset(CMAKE_C_COMPILER {{ target }}-gcc)\nset(CMAKE_CXX_COMPILER {{ target }}-g++)" > /usr/{{ target }}/cmake-toolchain.cmake
93
100
ENV TARGET_CMAKE_TOOLCHAIN_FILE_PATH=/usr/{{ target }}/cmake-toolchain.cmake
94
101
{% endif %}
@@ -150,7 +157,11 @@ RUN cd /tmp && \
150
157
VERS=3.7.17 && PREFIX=/opt/python/cp37-cp37m && \
151
158
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
152
159
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
153
- ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
160
+ {% if target .startswith ('loongarch64-' ) -%}
161
+ curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \
162
+ curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \
163
+ {% endif -%}
164
+ ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
154
165
{% if target .startswith ('armv7-' ) -%}
155
166
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
156
167
{% endif -%}
@@ -167,7 +178,11 @@ RUN cd /tmp && \
167
178
VERS=3.8.20 && PREFIX=/opt/python/cp38-cp38 && \
168
179
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
169
180
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
170
- ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
181
+ {% if target .startswith ('loongarch64-' ) -%}
182
+ curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub' && \
183
+ curl -LO 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' && \
184
+ {% endif -%}
185
+ ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ 'linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
171
186
{% if target .startswith ('armv7-' ) -%}
172
187
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
173
188
{% endif -%}
@@ -181,10 +196,10 @@ RUN cd /tmp && \
181
196
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
182
197
183
198
RUN cd /tmp && \
184
- VERS=3.9.20 && PREFIX=/opt/python/cp39-cp39 && \
199
+ VERS=3.9.22 && PREFIX=/opt/python/cp39-cp39 && \
185
200
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
186
201
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
187
- ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
202
+ ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ ' linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
188
203
{% if target .startswith ('armv7-' ) -%}
189
204
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
190
205
{% endif -%}
@@ -198,10 +213,10 @@ RUN cd /tmp && \
198
213
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
199
214
200
215
RUN cd /tmp && \
201
- VERS=3.10.15 && PREFIX=/opt/python/cp310-cp310 && \
216
+ VERS=3.10.17 && PREFIX=/opt/python/cp310-cp310 && \
202
217
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
203
218
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
204
- ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
219
+ ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-ensurepip=no --build=$(uname -m)-{{ ' linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
205
220
{% if target .startswith ('armv7-' ) -%}
206
221
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
207
222
{% endif -%}
@@ -215,10 +230,10 @@ RUN cd /tmp && \
215
230
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
216
231
217
232
RUN cd /tmp && \
218
- VERS=3.11.10 && PREFIX=/opt/python/cp311-cp311 && \
233
+ VERS=3.11.12 && PREFIX=/opt/python/cp311-cp311 && \
219
234
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
220
235
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
221
- ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.11 --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
236
+ ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.11 --with-ensurepip=no --build=$(uname -m)-{{ ' linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
222
237
{% if target .startswith ('armv7-' ) -%}
223
238
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
224
239
{% endif -%}
@@ -232,10 +247,10 @@ RUN cd /tmp && \
232
247
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
233
248
234
249
RUN cd /tmp && \
235
- VERS=3.12.7 && PREFIX=/opt/python/cp312-cp312 && \
250
+ VERS=3.12.10 && PREFIX=/opt/python/cp312-cp312 && \
236
251
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
237
252
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
238
- ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.12 --with-ensurepip=no --build=$(uname -m)-linux-gnu --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
253
+ ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.12 --with-ensurepip=no --build=$(uname -m)-{{ ' linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} --disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
239
254
{% if target .startswith ('armv7-' ) -%}
240
255
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
241
256
{% endif -%}
@@ -249,10 +264,10 @@ RUN cd /tmp && \
249
264
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
250
265
251
266
RUN cd /tmp && \
252
- VERS=3.13.0 && PREFIX=/opt/python/cp313-cp313 && \
267
+ VERS=3.13.3 && PREFIX=/opt/python/cp313-cp313 && \
253
268
curl -LO https://www.python.org/ftp/python/$VERS/Python-$VERS.tgz && \
254
269
tar xzf Python-$VERS.tgz && cd Python-$VERS && \
255
- ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --with-ensurepip=no --build=$(uname -m)-linux-gnu -- disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no && \
270
+ ./configure CC=$TARGET_CC AR=$TARGET_AR READELF=$TARGET_READELF --host={{ python_target }} --target={{ python_target }} --prefix=$PREFIX --disable-shared --with-build-python=python3.13 --with-ensurepip=no --build=$(uname -m)-{{ ' linux-gnu' if platform.startswith('manylinux') else 'linux-musl' }} -- disable-ipv6 ac_cv_have_long_long_format=yes ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no {{ 'ac_cv_libatomic_needed=yes' if 'riscv64' in target or 'loongarch64' in target }} && \
256
271
{% if target .startswith ('armv7-' ) -%}
257
272
sed -i 's/_PYTHON_HOST_PLATFORM=linux-arm/_PYTHON_HOST_PLATFORM=linux-armv7l/' Makefile && \
258
273
{% endif -%}
@@ -265,11 +280,23 @@ RUN cd /tmp && \
265
280
# We do not need precompiled .pyc and .pyo files.
266
281
find $PREFIX -type f -a \( -name '*.pyc' -o -name '*.pyo' \) -delete
267
282
{% - endif %}
268
- RUN curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "python3.7" && \
269
- for VER in 3.13 3.12 3.11 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done && \
270
- curl -sS https://bootstrap.pypa.io/pip/3.7/get-pip.py | "pypy3.7" && \
271
- for VER in 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; done && \
272
- for VER in 3.13 3.12 3.11 3.7 3.8 3.9 3.10; do "python$VER" -m pip install --no-cache-dir cffi; done && \
283
+ RUN for VER in 3.7 3.8 3.9 3.10 3.11 3.12 3.13; do \
284
+ case $VER in \
285
+ 3.7|3.8) \
286
+ curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "python$VER"; \
287
+ curl -sS https://bootstrap.pypa.io/pip/$VER/get-pip.py | "pypy$VER"; \
288
+ ;; \
289
+ 3.9|3.10) \
290
+ curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \
291
+ curl -sS https://bootstrap.pypa.io/get-pip.py | "pypy$VER"; \
292
+ ;; \
293
+ 3.11|3.12|3.13) \
294
+ curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; \
295
+ ;; \
296
+ esac && \
297
+ "python$VER" -m pip install --no-cache-dir cffi; \
298
+ done && \
273
299
python3 -m pip --version && \
274
300
python3 -m pip install --no-cache-dir auditwheel patchelf build && \
275
301
python3 -m pip install --no-cache-dir auditwheel-symbols
302
+
0 commit comments