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