File tree Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1515 - lc3
1616 - misc
1717 - nasm
18+ - python
1819 - pythran
1920 - rocm
2021 - rust-cg-gcc
Original file line number Diff line number Diff line change 1+ FROM ubuntu:20.04
2+
3+ # Enable source repositories so we can use `apt build-dep` to get all the
4+ # build dependencies for Python 3.5+.
5+ RUN sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list && \
6+ sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list
7+
8+ ARG DEBIAN_FRONTEND=noninteractive
9+ RUN apt update -y -q && apt upgrade -y -q && apt update -y -q && \
10+ apt -q build-dep -y python3.8 && \
11+ apt -q install -y \
12+ curl \
13+ git \
14+ libssl-dev \
15+ unzip \
16+ xz-utils
17+
18+ RUN mkdir -p /root
19+ COPY python /root/
20+ COPY common.sh /root/
21+
22+ WORKDIR /root
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -exu
4+ source common.sh
5+
6+ ROOT=$( pwd)
7+ VERSION=$1
8+ FULLNAME=python-${VERSION}
9+ OUTPUT=${ROOT} /${FULLNAME} .tar.xz
10+ LAST_REVISION=" ${3:- } "
11+
12+ if [[ -d " ${2} " ]]; then
13+ OUTPUT=$2 /${FULLNAME} .tar.xz
14+ else
15+ OUTPUT=${2-$OUTPUT }
16+ fi
17+
18+ REVISION=" python-${VERSION} "
19+ initialise " ${REVISION} " " ${OUTPUT} " " ${LAST_REVISION} "
20+
21+ DEST=/root/built
22+
23+ curl -sL https://www.python.org/ftp/python/${VERSION} /Python-${VERSION} .tgz | tar zxf -
24+ pushd Python-${VERSION}
25+ ./configure \
26+ --prefix=${DEST} \
27+ --enable-optimizations \
28+ --without-pymalloc
29+
30+ make -j$( nproc)
31+ make install
32+ popd
33+
34+ # strip executables
35+ find ${DEST} -type f -perm /u+x -exec strip -d {} \;
36+
37+ # delete tests and static libraries to save disk space
38+ find ${DEST} -type d -name test -exec rm -rf {} +
39+ find ${DEST} -type f -name * .a -delete
40+
41+ complete " ${DEST} " " ${FULLNAME} " " ${OUTPUT} "
You can’t perform that action at this time.
0 commit comments