File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222 # Add an RPATH to libgfortran:
2323 # https://github.com/pypa/auditwheel/issues/451
24- if [ " $MB_ML_LIBC " == " musllinux" ]; then
25- apk add zip
26- else
27- yum install -y zip
28- fi
29- unzip $1 /* .whl " *libgfortran*"
24+ # Use zipfile since the manylinux images do not have `zip`
25+ python3 -c "
26+ import re, sys, zipfile, pathlib
27+ whl = next(pathlib.Path(sys.argv[1]).glob('*.whl'))
28+ with zipfile.ZipFile(whl, 'a') as z:
29+ members = [m for m in z.namelist() if re.search(r'libgfortran', m)]
30+ z.extractall(members=members)
31+ " " $1 "
3032 patchelf --force-rpath --set-rpath ' $ORIGIN' * /lib/libgfortran*
31- zip $1 /* .whl * /lib/libgfortran*
33+ python3 -c "
34+ import sys, zipfile, pathlib, glob
35+ whl = next(pathlib.Path(sys.argv[1]).glob('*.whl'))
36+ with zipfile.ZipFile(whl, 'a') as z:
37+ for f in glob.glob('*/lib/libgfortran*'):
38+ z.write(f)
39+ " " $1 "
3240 mkdir -p /output
3341 # copy libs/openblas*.tar.gz to dist/
3442 cp libs/openblas* .tar.gz /output/
You can’t perform that action at this time.
0 commit comments