build: update python

This commit is contained in:
Baptiste Augrain 2022-04-19 16:39:44 +02:00
parent d6a16d6914
commit 559d5e347d
3 changed files with 78 additions and 4 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

View File

@ -7,18 +7,50 @@ RUN apt-get update && apt-get install -y -t stretch-backports git git-man
RUN dpkg --add-architecture arm64 RUN dpkg --add-architecture arm64
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
crossbuild-essential-arm64 \ crossbuild-essential-arm64 \
python \
git \ git \
pkg-config \ pkg-config \
fakeroot \ fakeroot \
rpm \ rpm \
sudo \
apt-transport-https \
ca-certificates \ ca-certificates \
libx11-dev:arm64 \ libx11-dev:arm64 \
libx11-xcb-dev:arm64 \ libx11-xcb-dev:arm64 \
libxkbfile-dev:arm64 \ libxkbfile-dev:arm64 \
libsecret-1-dev:arm64 \ libsecret-1-dev:arm64 \
curl \ curl \
jq jq \
gnupg \
unzip \
# Dependencies for building python from source
build-essential \
libreadline-gplv2-dev \
libncursesw5-dev \
libssl-dev \
libsqlite3-dev \
tk-dev \
libgbm-dev \
libc6-dev \
libbz2-dev \
libffi-dev \
zlib1g-dev
# Compile python3.9 from source
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
RUN tar -xf Python-3.9.4.tar.xz
RUN cd Python-3.9.4 && ./configure --enable-optimizations && make altinstall
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
RUN python --version
# Remove expired CA cert for openSSL 1.0.2
# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
RUN update-ca-certificates --fresh
# Yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
ENV AS=/usr/bin/aarch64-linux-gnu-as \ ENV AS=/usr/bin/aarch64-linux-gnu-as \
AR=/usr/bin/aarch64-linux-gnu-ar \ AR=/usr/bin/aarch64-linux-gnu-ar \

View File

@ -7,18 +7,50 @@ RUN apt-get update && apt-get install -y -t stretch-backports git git-man
RUN dpkg --add-architecture armhf RUN dpkg --add-architecture armhf
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
crossbuild-essential-armhf \ crossbuild-essential-armhf \
python \
git \ git \
pkg-config \ pkg-config \
fakeroot \ fakeroot \
rpm \ rpm \
sudo \
apt-transport-https \
ca-certificates \ ca-certificates \
libx11-dev:armhf \ libx11-dev:armhf \
libx11-xcb-dev:armhf \ libx11-xcb-dev:armhf \
libxkbfile-dev:armhf \ libxkbfile-dev:armhf \
libsecret-1-dev:armhf \ libsecret-1-dev:armhf \
curl \ curl \
jq jq \
gnupg \
unzip \
# Dependencies for building python from source
build-essential \
libreadline-gplv2-dev \
libncursesw5-dev \
libssl-dev \
libsqlite3-dev \
tk-dev \
libgbm-dev \
libc6-dev \
libbz2-dev \
libffi-dev \
zlib1g-dev
# Compile python3.9 from source
RUN curl -O https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
RUN tar -xf Python-3.9.4.tar.xz
RUN cd Python-3.9.4 && ./configure --enable-optimizations && make altinstall
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
RUN python --version
# Remove expired CA cert for openSSL 1.0.2
# https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
RUN rm -f /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
RUN update-ca-certificates --fresh
# Yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
ENV AS=/usr/bin/arm-linux-gnueabihf-as \ ENV AS=/usr/bin/arm-linux-gnueabihf-as \
AR=/usr/bin/arm-linux-gnueabihf-ar \ AR=/usr/bin/arm-linux-gnueabihf-ar \