diff --git a/mingw-w64-python-h5py/PKGBUILD b/mingw-w64-python-h5py/PKGBUILD new file mode 100644 index 0000000000..5b5063a8c4 --- /dev/null +++ b/mingw-w64-python-h5py/PKGBUILD @@ -0,0 +1,97 @@ +# Contributor: Runar Tenfjord < runar dot tenfjord at gmail dot com > + +_realname=h5py +pkgname=("${MINGW_PACKAGE_PREFIX}-python2-$_realname" + "${MINGW_PACKAGE_PREFIX}-python3-$_realname") +pkgver=2.3.1 +pkgrel=1 +pkgdesc="General-purpose Python bindings for the HDF5 library. (mingw-w64)" +arch=('any') +url="http://www.h5py.org" +license=('BSD') +makedepends=( + "${MINGW_PACKAGE_PREFIX}-python2-numpy" + "${MINGW_PACKAGE_PREFIX}-python3-numpy" + "${MINGW_PACKAGE_PREFIX}-cython" + "${MINGW_PACKAGE_PREFIX}-cython2" + "${MINGW_PACKAGE_PREFIX}-gcc" + "${MINGW_PACKAGE_PREFIX}-hdf5" +) +source=( + https://pypi.python.org/packages/source/h/h5py/h5py-$pkgver.tar.gz + setup.py.patch + lzf_c.c.patch +) +md5sums=('8f32f96d653e904d20f9f910c6d9dd91' + '07604b410e29df82c06a9add19b755a5' + '8c28048812d378a8a9330dbd21def864') + +prepare() { + cd $_realname-$pkgver + patch -p1 -i ${srcdir}/setup.py.patch + patch -p1 -i ${srcdir}/lzf_c.c.patch + cd .. + + cp -a $_realname-$pkgver $_realname-py2-$pkgver + cp -a $_realname-$pkgver $_realname-py3-$pkgver +} + +build() { + # build for python2 + cd ${srcdir}/$_realname-py2-$pkgver + + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python2 setup.py build + + # build for python3 + cd ${srcdir}/$_realname-py3-$pkgver + + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python3 setup.py build +} + +package_python2-h5py() { + depends=( + "${MINGW_PACKAGE_PREFIX}-python2-numpy" + "${MINGW_PACKAGE_PREFIX}-hdf5" + ) + + cd $_realname-py2-$pkgver + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python2 setup.py install --skip-build \ + --prefix=${MINGW_PREFIX} --root=${pkgdir} --optimize=1 + + install -Dm644 licenses/license.txt \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE.txt" +} + +package_python3-h5py() { + depends=( + "${MINGW_PACKAGE_PREFIX}-python3-numpy" + "${MINGW_PACKAGE_PREFIX}-hdf5" + ) + + cd $_realname-py3-$pkgver + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python3 setup.py install --skip-build \ + --prefix=${MINGW_PREFIX} --root=${pkgdir} --optimize=1 + + install -Dm644 licenses/license.txt \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE.txt" +} + +package_mingw-w64-i686-python2-h5py() { + package_python2-h5py +} + +package_mingw-w64-i686-python3-h5py() { + package_python3-h5py +} + +package_mingw-w64-x86_64-python2-h5py() { + package_python2-h5py +} + +package_mingw-w64-x86_64-python3-h5py() { + package_python3-h5py +} diff --git a/mingw-w64-python-h5py/lzf_c.c.patch b/mingw-w64-python-h5py/lzf_c.c.patch new file mode 100644 index 0000000000..f3fed6f7dc --- /dev/null +++ b/mingw-w64-python-h5py/lzf_c.c.patch @@ -0,0 +1,11 @@ +--- h5py-py3-2.3.1/lzf/lzf/lzf_c.c 2014-06-18 22:57:51.000000000 +0200 ++++ h5py-py2-2.3.1/lzf/lzf/lzf_c.c 2014-09-25 21:37:54.438298600 +0200 +@@ -121,7 +121,7 @@ + * special workaround for it. + */ + #if ( defined (WIN32) && defined (_M_X64) ) || defined (_WIN64) +- unsigned _int64 off; /* workaround for missing POSIX compliance */ ++ unsigned long off; + #else + unsigned long off; + #endif diff --git a/mingw-w64-python-h5py/setup.py.patch b/mingw-w64-python-h5py/setup.py.patch new file mode 100644 index 0000000000..c8a008e6ad --- /dev/null +++ b/mingw-w64-python-h5py/setup.py.patch @@ -0,0 +1,19 @@ +--- h5py-py3-2.3.1/setup.py 2014-06-23 01:13:59.000000000 +0200 ++++ h5py-py2-2.3.1/setup.py 2014-09-25 21:35:00.415345000 +0200 +@@ -19,6 +19,7 @@ + + VERSION = '2.3.1' + ++MSYS = "MSYSTEM" in os.environ + + # --- Encapsulate NumPy imports in a specialized Extension type --------------- + +@@ -131,7 +132,7 @@ + + # --- Configure Cython and create extensions ---------------------------------- + +-if sys.platform.startswith('win'): ++if sys.platform.startswith('win') and not MSYS: + COMPILER_SETTINGS = { + 'libraries' : ['h5py_hdf5','h5py_hdf5_hl'], + 'include_dirs' : [localpath('lzf'),