depot/third_party/nixpkgs/pkgs/by-name/h5/h5utils/package.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

51 lines
1.4 KiB
Nix

{
stdenv,
fetchurl,
lib,
hdf5,
libpng,
libjpeg,
hdf4 ? null,
libmatheval ? null,
}:
stdenv.mkDerivation (finalAttrs: {
version = "1.13.2";
pname = "h5utils";
# 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=";
};
# libdf is an alternative name for libhdf (hdf4)
preConfigure = lib.optionalString (hdf4 != null) ''
substituteInPlace configure \
--replace "-ldf" "-lhdf" \
'';
preBuild = lib.optionalString hdf5.mpiSupport "export CC=${lib.getBin hdf5.mpi}/mpicc";
buildInputs =
[
hdf5
libjpeg
libpng
]
++ lib.optional hdf5.mpiSupport hdf5.mpi
++ lib.optional (hdf4 != null) hdf4
++ lib.optional (libmatheval != null) libmatheval;
meta = {
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}";
license = with lib.licenses; [
mit
gpl2Plus
];
maintainers = [ lib.maintainers.sfrijters ];
};
})