1{ stdenv, fetchurl, python, buildPythonPackage
2, numpy, hdf5, cython
3, mpiSupport ? false, mpi4py ? null, mpi ? null }:
4
5assert mpiSupport == hdf5.mpiSupport;
6assert mpiSupport -> mpi != null
7 && mpi4py != null
8 && mpi == mpi4py.mpi
9 && mpi == hdf5.mpi
10 ;
11
12with stdenv.lib;
13
14buildPythonPackage rec {
15 name = "h5py-2.3.1";
16
17 src = fetchurl {
18 url = "https://pypi.python.org/packages/source/h/h5py/${name}.tar.gz";
19 md5 = "8f32f96d653e904d20f9f910c6d9dd91";
20 };
21
22 setupPyBuildFlags = [ "--hdf5=${hdf5}" ]
23 ++ optional mpiSupport "--mpi"
24 ;
25 setupPyInstallFlags = setupPyBuildFlags;
26
27 preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else "";
28
29 buildInputs = [ hdf5 cython ]
30 ++ optional mpiSupport mpi
31 ;
32 propagatedBuildInputs = [ numpy ]
33 ++ optional mpiSupport mpi4py
34 ;
35
36 meta = {
37 description =
38 "Pythonic interface to the HDF5 binary data format";
39 homepage = "http://www.h5py.org/";
40 license = stdenv.lib.licenses.bsd2;
41 };
42}