multiple dist support

This commit is contained in:
dave 2019-05-31 14:26:56 -07:00
parent 03ef30b3b8
commit f9ad705a53
15 changed files with 92 additions and 6 deletions

View File

@ -1,3 +1,4 @@
cpython
.git
temp
temp
/src/out

14
Dockerfile.disco Normal file
View File

@ -0,0 +1,14 @@
FROM ubuntu:disco
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
RUN useradd builder && \
install -d /build -o builder -g builder
ADD scripts/bootstrap.sh /bootstrap.sh
ADD scripts/build.sh /build.sh
ENTRYPOINT ["/bootstrap.sh"]

14
Dockerfile.trusty Normal file
View File

@ -0,0 +1,14 @@
FROM ubuntu:trusty
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
RUN useradd builder && \
install -d /build -o builder -g builder
ADD scripts/bootstrap.sh /bootstrap.sh
ADD scripts/build.sh /build.sh
ENTRYPOINT ["/bootstrap.sh"]

14
Dockerfile.xenial Normal file
View File

@ -0,0 +1,14 @@
FROM ubuntu:xenial
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
RUN useradd builder && \
install -d /build -o builder -g builder
ADD scripts/bootstrap.sh /bootstrap.sh
ADD scripts/build.sh /build.sh
ENTRYPOINT ["/bootstrap.sh"]

View File

@ -7,7 +7,17 @@ Extpython is a collection of tools for building installable packages containing
installations are isolated from the operating system's python such that modules may be added, removed, or upgraded
without risk of breaking. The builds are executed in Docker.
Example invocation:
```
./images.sh
./build.sh trusty-3.7.3.sh
```
The vars file - `trusty-3.7.3.sh` above - contains information about what python version will be built. See
`src/bionic-3.7.3.sh` for an annotated example.
TODO:
- Support other than Bionic
- Parameter for pre-loaded pip modules

View File

@ -2,6 +2,6 @@
VARSFILE=$1
ls -la src/$VARSFILE
. src/$VARSFILE
time docker run -it --rm -e "VARSFILE=$VARSFILE" -v $PWD/src:/src extpythonbuilder
time docker run -it --rm -e "VARSFILE=$VARSFILE" -v $PWD/src:/src extbuilder-$EXTPYTHON_DIST

7
images.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash -ex
RELEASES="trusty xenial bionic disco"
for release in $RELEASES ; do
docker build -t extbuilder-${release} -f Dockerfile.${release} .
done

View File

@ -3,6 +3,7 @@
# get metadata
ln -s /src/$VARSFILE /tmp/vars.sh
. /tmp/vars.sh
. /etc/lsb-release #for DISTRIB_CODENAME
# install deps
apt-get update
@ -12,6 +13,6 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-co
sudo -Hu builder /build.sh
# export the debs
OUTDIR="/src/out/$PYTHON_RELEASE/"
OUTDIR="/src/out/${PYTHON_RELEASE}/${DISTRIB_CODENAME}"
mkdir -p $OUTDIR
cp /build/out/* $OUTDIR

View File

@ -1,7 +1,8 @@
#!/usr/bin/make -f
PY3_SRC=./cpython/
PY3_CONFFLAGS=--prefix=$(DESTDIR)/opt/extpython/_OPT_DIR_ --with-ensurepip=install --enable-optimizations
PY3_CONFFLAGS=--prefix=$(DESTDIR)/opt/extpython/_OPT_DIR_ --with-ensurepip=install
#--enable-optimizations
all:
cd $(PY3_SRC) && \

View File

@ -1,5 +1,6 @@
#!/bin/bash -eux
export EXTPYTHON_DIST=bionic
export PYTHON_RELEASE=2.7.16
export PYTHON_MAJOR=2.7
export PYTHON_TARBALL="http://artifact.scc.net.davepedu.com/repo/tar/cpython/cpython/cpython-${PYTHON_RELEASE}.tar.gz"

View File

@ -1,5 +1,7 @@
#!/bin/bash -eux
# Which dist to build on
export EXTPYTHON_DIST=bionic
# Release is used to select which tarball to download
export PYTHON_RELEASE=3.7.3
# Major version no is used in paths and labels (extpython-python${}, /opt/extpython/${}/...)

View File

@ -1,5 +1,6 @@
#!/bin/bash -eux
export EXTPYTHON_DIST=bionic
export PYTHON_RELEASE=3.8.0a4
export PYTHON_MAJOR=3.8
export PYTHON_TARBALL="http://artifact.scc.net.davepedu.com/repo/tar/cpython/cpython/cpython-${PYTHON_RELEASE}.tar.gz"

8
src/disco-3.7.3.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash -eux
export EXTPYTHON_DIST=disco
export PYTHON_RELEASE=3.7.3
export PYTHON_MAJOR=3.7
export PYTHON_TARBALL="http://artifact.scc.net.davepedu.com/repo/tar/cpython/cpython/cpython-${PYTHON_RELEASE}.tar.gz"
export CPYTHON_DEPS="libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev \
libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev"

12
src/trusty-3.7.3.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash -eux
export EXTPYTHON_DIST=trusty
# Release is used to select which tarball to download
export PYTHON_RELEASE=3.7.3
# Major version no is used in paths and labels (extpython-python${}, /opt/extpython/${}/...)
export PYTHON_MAJOR=3.7
# Tarball download URL
export PYTHON_TARBALL="http://artifact.scc.net.davepedu.com/repo/tar/cpython/cpython/cpython-${PYTHON_RELEASE}.tar.gz"
# Deps needed to build this package
export CPYTHON_DEPS="libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev \
libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev"