Browse Source

multiple dist support

master
dave 1 year ago
parent
commit
f9ad705a53
15 changed files with 92 additions and 6 deletions
  1. +2
    -1
      .dockerignore
  2. +0
    -0
      Dockerfile.bionic
  3. +14
    -0
      Dockerfile.disco
  4. +14
    -0
      Dockerfile.trusty
  5. +14
    -0
      Dockerfile.xenial
  6. +11
    -1
      README.md
  7. +2
    -2
      build.sh
  8. +7
    -0
      images.sh
  9. +2
    -1
      scripts/bootstrap.sh
  10. +2
    -1
      src/Makefile
  11. +1
    -0
      src/bionic-2.7.16.sh
  12. +2
    -0
      src/bionic-3.7.3.sh
  13. +1
    -0
      src/bionic-3.8.0a4.sh
  14. +8
    -0
      src/disco-3.7.3.sh
  15. +12
    -0
      src/trusty-3.7.3.sh

+ 2
- 1
.dockerignore View File

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

Dockerfile → Dockerfile.bionic View File


+ 14
- 0
Dockerfile.disco 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
- 0
Dockerfile.trusty 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
- 0
Dockerfile.xenial 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"]

+ 11
- 1
README.md 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

+ 2
- 2
build.sh 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
- 0
images.sh 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

+ 2
- 1
scripts/bootstrap.sh 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

+ 2
- 1
src/Makefile 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) && \


+ 1
- 0
src/bionic-2.7.16.sh 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"


+ 2
- 0
src/bionic-3.7.3.sh 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/${}/...)


+ 1
- 0
src/bionic-3.8.0a4.sh 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
- 0
src/disco-3.7.3.sh 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
- 0
src/trusty-3.7.3.sh 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"

Loading…
Cancel
Save