summaryrefslogtreecommitdiff
path: root/tools/manylinux/build-wheels.sh
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2016-08-18 15:03:00 +0200
committerStefan Behnel <stefan_ml@behnel.de>2016-08-18 15:03:00 +0200
commit5ddce3d1fc59c77b08396eccc4810d8eef870ece (patch)
tree71f728ceb2473b82a7fd773b4789d35daf82ddf7 /tools/manylinux/build-wheels.sh
parent3ce6462f0ca2f5a59de968f6740f744a836a73e7 (diff)
downloadpython-lxml-5ddce3d1fc59c77b08396eccc4810d8eef870ece.tar.gz
build and reuse sdist when building wheels and properly pass CFLAGS into docker container
Diffstat (limited to 'tools/manylinux/build-wheels.sh')
-rwxr-xr-xtools/manylinux/build-wheels.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/manylinux/build-wheels.sh b/tools/manylinux/build-wheels.sh
index eec1cffe..0ed2820f 100755
--- a/tools/manylinux/build-wheels.sh
+++ b/tools/manylinux/build-wheels.sh
@@ -6,14 +6,18 @@ echo "Started $0 $@"
set -e -x
REQUIREMENTS=/io/requirements.txt
WHEELHOUSE=/io/wheelhouse
+SDIST=$1
build_wheel() {
+ source="$1"
+ [ -n "$source" ] || source=/io
+
env STATIC_DEPS=true \
LDFLAGS="$LDFLAGS -fPIC" \
CFLAGS="$CFLAGS -fPIC" \
${PYBIN}/pip \
wheel \
- /io \
+ "$source" \
-w $WHEELHOUSE
}
@@ -29,17 +33,18 @@ assert_importable() {
prepare_system() {
yum install -y zlib-devel
# Remove Python 2.6 symlinks
- rm /opt/python/cp26*
+ rm -f /opt/python/cp26*
}
build_wheels() {
# Compile wheels for all python versions
for PYBIN in /opt/python/*/bin; do
- # Install requirements if file exists
- test ! -e $REQUIREMENTS \
- || ${PYBIN}/pip install -r $REQUIREMENTS
+ test -e "$SDIST" && source="$SDIST" || source=
+ # Install build requirements if we need them and file exists
+ test -z "$SDIST" -a -e "$REQUIREMENTS" \
+ && ${PYBIN}/pip install -r "$REQUIREMENTS"
- build_wheel
+ build_wheel "$source"
done
}