Skip to content

Commit aa1877e

Browse files
committed
Update the Docker image to manylinux
1 parent 85d2e6f commit aa1877e

File tree

5 files changed

+32
-20
lines changed

5 files changed

+32
-20
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ install:
1919

2020
script:
2121
- docker run --cap-add SYS_ADMIN --device /dev/fuse --mount src=$PWD,dst=/work,type=bind ${DOCKER_USERNAME}/linuxdeploy-plugin-python:${ARCH}
22+
- python3 -m tests
2223

2324
after_success:
2425
- ./.travis/after-success.sh

.travis/Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
FROM ubuntu:trusty
1+
FROM quay.io/pypa/manylinux2010_x86_64
22
LABEL maintainer="https://github.com/niess"
33

44
ARG Arch=x86_64
55
ENV ARCH="${Arch}" \
6-
OPENSSL="1.1.1c" \
7-
OPENSSL_DIR="${HOME}/openssl/${OPENSSL}${CONFIG_HASH}"
6+
OPENSSL="1.1.1c"
87

9-
RUN apt update -y -qq && \
10-
apt install --no-install-recommends -y -qq \
11-
build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev \
12-
libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev \
13-
libexpat1-dev liblzma-dev libffi-dev tk-dev automake libfuse2 wget && \
14-
rm -rf /var/lib/apt/lists/*
8+
RUN yum -y install bzip2-devel fuse-sshfs ncurses-devel readline-devel \
9+
sqlite-devel openssl-devel symlinks tk-devel xz-devel wget
1510

1611
COPY . /work/.travis
1712
WORKDIR /work
1813
SHELL ["/bin/bash", "-c"]
1914

15+
ENV OPENSSL_DIR="${HOME}/openssl/${OPENSSL}"
2016
RUN ./.travis/install.sh
2117

2218
ENV PATH="${OPENSSL_DIR}/bin:${PATH}" \
2319
CFLAGS="${CFLAGS} -I${OPENSSL_DIR}/include" \
24-
LDFLAGS="-L${OPENSSL_DIR}/lib -Wl,-rpath=${OPENSSL_DIR}/lib" \
20+
LDFLAGS="-L${OPENSSL_DIR}/lib" \
2521
LD_LIBRARY_PATH="${OPENSSL_DIR}/lib:${LD_LIBRARY_PATH}"
2622

2723
CMD ["./.travis/script.sh"]

.travis/script.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ wrapped_run python python2
2121
wrapped_run python python3
2222
wrapped_run python scipy
2323
wrapped_run python xonsh
24-
25-
python3 -m tests

linuxdeploy-plugin-python.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ show_usage () {
4848
echo " Provide extra configuration flags for the Python build. Note"
4949
echo " that the install prefix will be overwritten"
5050
echo ""
51+
echo " PYTHON_ENTRYPOINT=\"${PYTHON_ENTRYPOINT}\""
52+
echo " Extra options when calling the python executable"
53+
echo ""
5154
echo " PYTHON_SOURCE=\"${PYTHON_SOURCE}\""
5255
echo " The source to use for Python. Can be a directory, an url or/and"
5356
echo " an archive"
@@ -122,7 +125,7 @@ fi
122125

123126
prefix="usr/python"
124127
cd "${source_dir}"
125-
./configure ${PYTHON_CONFIG} "--with-ensurepip=install" "--prefix=/${prefix}"
128+
./configure ${PYTHON_CONFIG} "--with-ensurepip=install" "--prefix=/${prefix}" LDFLAGS="${LDFLAGS} -Wl,-rpath='"'$$ORIGIN'"/../../lib'"
126129
HOME="${PYTHON_BUILD_DIR}" make -j"$NPROC" DESTDIR="$APPDIR" install
127130

128131

@@ -194,11 +197,16 @@ patch_binary() {
194197
local name="$(basename $1)"
195198

196199
if [ "${name::3}" == "lib" ]; then
197-
if [ ! -f "${APPDIR}/usr/lib/${name}" ]; then
200+
if [ ! -f "${APPDIR}/usr/lib/${name}" ] && [ ! -L "${APPDIR}/usr/lib/${name}" ]; then
198201
echo "Patching dependency ${name}"
199202
strip "$1"
200203
"${patchelf}" --set-rpath '$ORIGIN' "$1"
201-
ln -rs "$1" "${APPDIR}/usr/lib"
204+
if [ "$(command -v symlinks)" ]; then
205+
ln -s "$1" "${APPDIR}/usr/lib/${name}"
206+
symlinks -c "${APPDIR}/usr/lib/${name}"
207+
else
208+
ln -rs "$1" "${APPDIR}/usr/lib"
209+
fi
202210
fi
203211
else
204212
echo "Patching C-extension module ${name}"
@@ -238,7 +246,16 @@ find "site-packages" -name 'lib*.so*' -type f | while read file; do patch_binary
238246

239247

240248
# Copy any TCl/Tk shared data
241-
if [[ -d "/usr/share/tcltk" ]] && [[ ! -d "${APPDIR}/${prefix}/share/tcltk" ]]; then
242-
mkdir -p "${APPDIR}/${prefix}/share"
243-
cp -r "/usr/share/tcltk" "${APPDIR}/${prefix}/share"
249+
if [[ ! -d "${APPDIR}/${prefix}/share/tcltk" ]]; then
250+
if [[ -d "/usr/share/tcltk" ]]; then
251+
mkdir -p "${APPDIR}/${prefix}/share"
252+
cp -r "/usr/share/tcltk" "${APPDIR}/${prefix}/share"
253+
else
254+
mkdir -p "${APPDIR}/${prefix}/share/tcltk"
255+
tclpath="$(ls -d /usr/share/tcl* | tail -1)"
256+
tkpath="$(ls -d /usr/share/tk* | tail -1)"
257+
for path in "${tclpath}" "${tkpath}"; do
258+
cp -r "${path}" "${APPDIR}/${prefix}/share/tcltk"
259+
done
260+
fi
244261
fi

share/python-wrapper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ APPDIR="${APPDIR:-$SCRIPTPATH/../..}"
66

77
# Configure the environment
88
prefix="{{PREFIX}}"
9-
export TCL_LIBRARY="${APPDIR}/${prefix}/share/tcltk/tcl"*
10-
export TK_LIBRARY="${APPDIR}/${prefix}/share/tcltk/tk"*
9+
export TCL_LIBRARY="$(ls -d ${APPDIR}/${prefix}/share/tcltk/tcl* | tail -1)"
10+
export TK_LIBRARY="$(ls -d ${APPDIR}/${prefix}/share/tcltk/tk* | tail -1)"
1111
export TKPATH="${TK_LIBRARY}"
1212

1313
# Resolve symlinks within the image

0 commit comments

Comments
 (0)