Skip to content

Commit 8b047b0

Browse files
authored
Merge pull request #266 from SimonRit/WheelExclude
2 parents 80c77b9 + 7046713 commit 8b047b0

File tree

3 files changed

+13
-38
lines changed

3 files changed

+13
-38
lines changed

scripts/dockcross-manylinux-build-module-wheels.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,18 @@ chmod 777 $(pwd)/tools
6161
mkdir -p dist
6262
DOCKER_ARGS="-v $(pwd)/dist:/work/dist/ -v ${script_dir}/..:/ITKPythonPackage -v $(pwd)/tools:/tools"
6363
DOCKER_ARGS+=" -e MANYLINUX_VERSION"
64+
DOCKER_ARGS+=" -e LD_LIBRARY_PATH"
6465
# Mount any shared libraries
6566
if [[ -n ${LD_LIBRARY_PATH} ]]; then
6667
for libpath in ${LD_LIBRARY_PATH//:/ }; do
67-
DOCKER_ARGS+=" -v ${libpath}:/usr/lib64/$(basename -- ${libpath})"
68+
DOCKER_LIBRARY_PATH="/usr/lib64/$(basename -- ${libpath})"
69+
DOCKER_ARGS+=" -v ${libpath}:${DOCKER_LIBRARY_PATH}"
70+
if test -d ${libpath}; then
71+
DOCKER_LD_LIBRARY_PATH+="${DOCKER_LIBRARY_PATH}:${DOCKER_LD_LIBRARY_PATH}"
72+
fi
6873
done
6974
fi
75+
export LD_LIBRARY_PATH="${DOCKER_LD_LIBRARY_PATH}"
7076

7177
if [[ "${TARGET_ARCH}" = "aarch64" ]]; then
7278
echo "Install aarch64 architecture emulation tools to perform build for ARM platform"

scripts/internal/auditwheel_whitelist_monkeypatch.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

scripts/internal/manylinux-build-module-wheels.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,14 @@ for PYBIN in "${PYBINARIES[@]}"; do
122122
|| exit 1
123123
done
124124

125-
# Make sure auditwheel is installed for this python exe before importing
126-
# it in auditwheel_whitelist_monkeypatch.py
125+
# Convert list of excluded libs in --exclude_libs to auditwheel --exclude options
126+
if test -n "$EXCLUDE_LIBS"; then
127+
AUDITWHEEL_EXCLUDE_ARGS="--exclude ${EXCLUDE_LIBS//;/ --exclude }"
128+
fi
129+
127130
sudo ${Python3_EXECUTABLE} -m pip install auditwheel
128131
for whl in dist/*linux*$(uname -m).whl; do
129-
# Repair wheel using monkey patch to exclude shared libraries provided in whitelist
130-
${Python3_EXECUTABLE} "${script_dir}/auditwheel_whitelist_monkeypatch.py" \
131-
repair ${whl} -w /work/dist/ --whitelist "${EXCLUDE_LIBS}"
132+
auditwheel repair ${whl} -w /work/dist/ ${AUDITWHEEL_EXCLUDE_ARGS}
132133
rm ${whl}
133134
done
134135

0 commit comments

Comments
 (0)