lol
1{ stdenv
2, fetchurl
3, removeReferencesTo
4, cpp ? false
5, gfortran ? null
6, zlib ? null
7, szip ? null
8, mpi ? null
9, enableShared ? true
10}:
11
12# cpp and mpi options are mutually exclusive
13# (--enable-unsupported could be used to force the build)
14assert !cpp || mpi == null;
15
16let inherit (stdenv.lib) optional optionals; in
17
18stdenv.mkDerivation rec {
19 version = "1.10.3";
20 name = "hdf5-${version}";
21 src = fetchurl {
22 url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/${name}/src/${name}.tar.bz2";
23 sha256 = "1a85v6812afi6k3gmfdcj80f6ys9kc80v7ysz39pz9948z7dqp66";
24 };
25
26 passthru = {
27 mpiSupport = (mpi != null);
28 inherit mpi;
29 };
30
31 nativeBuildInputs = [ removeReferencesTo ];
32
33 buildInputs = []
34 ++ optional (gfortran != null) gfortran
35 ++ optional (szip != null) szip;
36
37 propagatedBuildInputs = []
38 ++ optional (zlib != null) zlib
39 ++ optional (mpi != null) mpi;
40
41 configureFlags = []
42 ++ optional cpp "--enable-cxx"
43 ++ optional (gfortran != null) "--enable-fortran"
44 ++ optional (szip != null) "--with-szlib=${szip}"
45 ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
46 ++ optional enableShared "--enable-shared";
47
48 patches = [./bin-mv.patch];
49
50 postInstall = ''
51 find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
52 '';
53
54 meta = {
55 description = "Data model, library, and file format for storing and managing data";
56 longDescription = ''
57 HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient
58 I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing
59 applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and
60 applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
61 '';
62 license = stdenv.lib.licenses.free; # BSD-like
63 homepage = https://www.hdfgroup.org/HDF5/;
64 platforms = stdenv.lib.platforms.unix;
65 broken = (gfortran != null) && stdenv.isDarwin;
66 };
67}