-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f454e54
commit 47a2b72
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ jobs: | |
- lc3 | ||
- misc | ||
- nasm | ||
- python | ||
- pythran | ||
- rocm | ||
- rust-cg-gcc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM ubuntu:20.04 | ||
|
||
# Enable source repositories so we can use `apt build-dep` to get all the | ||
# build dependencies for Python 3.5+. | ||
RUN sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list && \ | ||
sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt update -y -q && apt upgrade -y -q && apt update -y -q && \ | ||
apt -q build-dep -y python3.8 && \ | ||
apt -q install -y \ | ||
curl \ | ||
git \ | ||
libssl-dev \ | ||
unzip \ | ||
xz-utils | ||
|
||
RUN mkdir -p /root | ||
COPY python /root/ | ||
COPY common.sh /root/ | ||
|
||
WORKDIR /root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
set -exu | ||
source common.sh | ||
|
||
ROOT=$(pwd) | ||
VERSION=$1 | ||
FULLNAME=python-${VERSION} | ||
OUTPUT=${ROOT}/${FULLNAME}.tar.xz | ||
LAST_REVISION="${3:-}" | ||
|
||
if [[ -d "${2}" ]]; then | ||
OUTPUT=$2/${FULLNAME}.tar.xz | ||
else | ||
OUTPUT=${2-$OUTPUT} | ||
fi | ||
|
||
REVISION="python-${VERSION}" | ||
initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}" | ||
|
||
DEST=/root/built | ||
|
||
curl -sL https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz | tar zxf - | ||
pushd Python-${VERSION} | ||
./configure \ | ||
--prefix=${DEST} \ | ||
--enable-optimizations \ | ||
--without-pymalloc | ||
|
||
make -j$(nproc) | ||
make install | ||
popd | ||
|
||
# strip executables | ||
find ${DEST} -type f -perm /u+x -exec strip -d {} \; | ||
|
||
# delete tests and static libraries to save disk space | ||
find ${DEST} -type d -name test -exec rm -rf {} + | ||
find ${DEST} -type f -name *.a -delete | ||
|
||
complete "${DEST}" "${FULLNAME}" "${OUTPUT}" |