@@ -14,7 +14,48 @@ export OPENSSL_ROOT=openssl-1.0.2u
1414export OPENSSL_HASH=ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
1515export CURL_VERSION=" 7.75.0"
1616
17- source h5py-wheels/config.sh
17+ # source h5py-wheels/config.sh
18+
19+ # copied from h5py-wheels/config.sh
20+
21+ function build_wheel {
22+ if [ -z " $IS_OSX " ]; then
23+ build_linux_wheel $@
24+ else
25+ build_osx_wheel $@
26+ fi
27+ }
28+
29+ function build_linux_wheel {
30+ source multibuild/library_builders.sh
31+ build_libs
32+ # Add workaround for auditwheel bug:
33+ # https://github.com/pypa/auditwheel/issues/29
34+ local bad_lib=" /usr/local/lib/libhdf5.so"
35+ if [ -z " $( readelf --dynamic $bad_lib | grep RUNPATH) " ]; then
36+ patchelf --set-rpath $( dirname $bad_lib ) $bad_lib
37+ fi
38+ build_pip_wheel $@
39+ }
40+
41+ function build_osx_wheel {
42+ local repo_dir=${1:- $REPO_DIR }
43+ export CC=clang
44+ export CXX=clang++
45+ install_pkg_config
46+ # Build libraries
47+ source multibuild/library_builders.sh
48+ export ARCH_FLAGS=" -arch x86_64"
49+ export CFLAGS=$ARCH_FLAGS
50+ export CXXFLAGS=$ARCH_FLAGS
51+ export FFLAGS=$ARCH_FLAGS
52+ export LDFLAGS=$ARCH_FLAGS
53+ build_libs
54+ # Build wheel
55+ export LDFLAGS=" $ARCH_FLAGS -Wall -undefined dynamic_lookup -bundle"
56+ export LDSHARED=" $CC $LDFLAGS "
57+ build_pip_wheel " $repo_dir "
58+ }
1859
1960function build_curl2 {
2061 if [ -e curl-stamp ]; then return ; fi
0 commit comments