From bc35eb4ec08b77bdcfcda70de826feacb3f0a337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Wed, 25 Jan 2023 12:25:57 +0100 Subject: [PATCH] python-h5py: Support multi-digit SOVERSION of HDF5 library. --- .../0001-multi-digit-SOVERSION.patch | 12 ++++++++++++ mingw-w64-python-h5py/PKGBUILD | 17 +++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 mingw-w64-python-h5py/0001-multi-digit-SOVERSION.patch diff --git a/mingw-w64-python-h5py/0001-multi-digit-SOVERSION.patch b/mingw-w64-python-h5py/0001-multi-digit-SOVERSION.patch new file mode 100644 index 0000000000..5ca52a9517 --- /dev/null +++ b/mingw-w64-python-h5py/0001-multi-digit-SOVERSION.patch @@ -0,0 +1,12 @@ +diff -urN h5py-3.8.0/setup_configure.py.orig h5py-3.8.0/setup_configure.py +--- h5py-3.8.0/setup_configure.py.orig 2023-01-04 18:26:33.000000000 +0100 ++++ h5py-3.8.0/setup_configure.py 2023-01-25 12:01:14.626392300 +0100 +@@ -250,7 +250,7 @@ + regexp = re.compile(r'^hdf5.dll') + else: + default_path = 'libhdf5-0.dll' +- regexp = re.compile(r'^libhdf5-[0-9].dll') ++ regexp = re.compile(r'^libhdf5-\d+.dll$') + if sys.version_info >= (3, 8): + # To overcome "difficulty" loading the library on windows + # https://bugs.python.org/issue42114 diff --git a/mingw-w64-python-h5py/PKGBUILD b/mingw-w64-python-h5py/PKGBUILD index 775afb2e9a..b3c757385f 100644 --- a/mingw-w64-python-h5py/PKGBUILD +++ b/mingw-w64-python-h5py/PKGBUILD @@ -7,7 +7,7 @@ provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") pkgver=3.8.0 -pkgrel=2 +pkgrel=3 pkgdesc="General-purpose Python bindings for the HDF5 library (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') @@ -22,14 +22,26 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools" "${MINGW_PACKAGE_PREFIX}-python-pkgconfig" "${MINGW_PACKAGE_PREFIX}-pkg-config") source=(https://github.com/h5py/h5py/releases/download/${pkgver}/h5py-${pkgver}.tar.gz + 0001-multi-digit-SOVERSION.patch lzf_c.c.patch) sha256sums=('6fead82f0c4000cf38d53f9c030780d81bfa0220218aee13b90b7701c937d95f' + 'b522515e3688acac0ca1a50265a2aa2009ec6df55f0d205b72e5dea5fd494705' '6d0126b881b5dcd637146d151341b72aa68eef760092272279072ec0bc4ceca9') +apply_patch_with_msg() { + for _patch in "$@" + do + msg2 "Applying $_patch" + patch -Np1 -i "${srcdir}/$_patch" + done +} + prepare() { cd "${srcdir}/${_realname}-${pkgver}" - patch -p1 -i ${srcdir}/lzf_c.c.patch + apply_patch_with_msg \ + 0001-multi-digit-SOVERSION.patch \ + lzf_c.c.patch cd "${srcdir}" rm -rf "python-build-${MSYSTEM}" | true @@ -40,6 +52,7 @@ build() { cd "${srcdir}/python-build-${MSYSTEM}" H5PY_SETUP_REQUIRES=0 \ + HDF5_DIR=${MINGW_PREFIX} \ MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python setup.py build }