nixpkgs/pkgs/by-name/h5/h5utils/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
Nix
Raw Normal View History

2024-07-14 12:02:41 +00:00
{
stdenv,
fetchurl,
lib,
hdf5,
libpng,
libjpeg,
hdf4 ? null,
libmatheval ? null,
2018-03-15 11:04:54 +00:00
}:
stdenv.mkDerivation (finalAttrs: {
2023-01-18 19:40:33 +00:00
version = "1.13.2";
pname = "h5utils";
2018-03-15 11:04:54 +00:00
# fetchurl is used instead of fetchFromGitHub because the git repo version requires
# additional tools to build compared to the tarball release; see the README for details.
src = fetchurl {
url = "https://github.com/stevengj/h5utils/releases/download/${finalAttrs.version}/h5utils-${finalAttrs.version}.tar.gz";
hash = "sha256-7qeFWoI1+st8RU5hEDCY5VZY2g3fS23luCqZLl8CQ1E=";
2018-03-15 11:04:54 +00:00
};
# libdf is an alternative name for libhdf (hdf4)
2024-07-14 12:02:41 +00:00
preConfigure = lib.optionalString (hdf4 != null) ''
2018-03-15 11:04:54 +00:00
substituteInPlace configure \
--replace "-ldf" "-lhdf" \
'';
preBuild = lib.optionalString hdf5.mpiSupport "export CC=${lib.getBin hdf5.mpi}/mpicc";
2018-03-15 11:04:54 +00:00
2024-07-14 12:02:41 +00:00
buildInputs =
[
hdf5
libjpeg
libpng
]
++ lib.optional hdf5.mpiSupport hdf5.mpi
++ lib.optional (hdf4 != null) hdf4
++ lib.optional (libmatheval != null) libmatheval;
2018-03-15 11:04:54 +00:00
2024-07-14 12:09:56 +00:00
meta = {
2018-03-15 11:04:54 +00:00
description = "Set of utilities for visualization and conversion of scientific data in the free, portable HDF5 format";
homepage = "https://github.com/stevengj/h5utils";
changelog = "https://github.com/NanoComp/h5utils/releases/tag/${finalAttrs.version}";
2024-07-14 12:09:56 +00:00
license = with lib.licenses; [
2024-07-14 12:02:41 +00:00
mit
gpl2Plus
];
2024-07-14 12:09:56 +00:00
maintainers = [ lib.maintainers.sfrijters ];
2018-03-15 11:04:54 +00:00
};
})