-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathaarch64-unknown-linux-gnu-python.Dockerfile
More file actions
34 lines (30 loc) · 1.33 KB
/
aarch64-unknown-linux-gnu-python.Dockerfile
File metadata and controls
34 lines (30 loc) · 1.33 KB
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
FROM base
ARG PYTHON_VERSION
ARG PYTHON_VERSION_SUFFIX
ARG PYTHON_RELEASE
# python is required for cross compiling python :D
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y python${PYTHON_RELEASE} \
&& rm -rf /var/lib/apt/lists/*;
# --enable-optimizations is disabled, because it's not supported with CROSS
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}${PYTHON_VERSION_SUFFIX}.tgz -O - | tar -xz \
&& cd Python-${PYTHON_VERSION}${PYTHON_VERSION_SUFFIX} \
&& touch config.site-aarch64 \
&& echo "ac_cv_buggy_getaddrinfo=no" >> config.site-aarch64 \
&& echo "ac_cv_file__dev_ptmx=no" >> config.site-aarch64 \
&& echo "ac_cv_file__dev_ptc=no" >> config.site-aarch64 \
&& CONFIG_SITE=config.site-aarch64 ./configure \
--enable-shared \
--disable-ipv6 \
--prefix=/usr/aarch64-linux-gnu \
--build=aarch64-unknown-linux-gnu \
--host=x86_64-linux-gnu \
--with-build-python=/usr/bin/python${PYTHON_RELEASE} \
&& make -j $(nproc) \
&& make install \
&& cd .. && rm -rf Python-${PYTHON_VERSION} \
&& rm -rf /var/lib/apt/lists/*;
ENV PYO3_CROSS_PYTHON_VERSION=${PYTHON_RELEASE} \
PYO3_CROSS_INCLUDE_DIR=/usr/aarch64-linux-gnu/include \
PYO3_CROSS_LIB_DIR=/usr/aarch64-linux-gnu/lib
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8