Skip to content

Commit 694087c

Browse files
committed
update
1 parent 54dfd3c commit 694087c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

config.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,39 @@ function build_wheel {
3131
wrap_wheel_builder build_pip_wheel $@
3232
}
3333

34+
function repair_wheelhouse {
35+
# Runs 'auditwheel repair' over all wheels in a directory
36+
# If the wheel is not renamed by the repair process,
37+
# then the original wheel will be left unmodified
38+
local in_dir=$1
39+
local out_dir=${2:-$in_dir}
40+
for whl in $in_dir/*.whl; do
41+
if [[ $whl == *none-any.whl ]]; then # Pure Python wheel
42+
if [ "$in_dir" != "$out_dir" ]; then cp $whl $out_dir; fi
43+
else
44+
local tmpdir=$(mktemp -d -t)
45+
46+
auditwheel show $whl
47+
48+
auditwheel repair $whl -w $tmpdir/
49+
50+
local built=$(find $tmpdir -name *.whl)
51+
if [ $(basename $built) == $(basename $whl) ]; then
52+
if [ "$in_dir" != "$out_dir" ]; then cp $whl $out_dir; fi
53+
else
54+
cp $built $out_dir
55+
56+
# Remove unfixed if writing into same directory
57+
if [ "$in_dir" == "$out_dir" ]; then rm $whl; fi
58+
fi
59+
rm -rf $tmpdir
60+
fi
61+
done
62+
auditwheel show $out_dir/$built
63+
chmod -R a+rwX $out_dir
64+
}
65+
66+
3467
# add --verbose to pip
3568
function pip_opts {
3669
if [ -n "$MANYLINUX_URL" ]; then

0 commit comments

Comments
 (0)