From 7264bbf85b2f4e63f74b3cb3e7ce50ed661252bb Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 14 Jul 2024 14:01:52 +0200 Subject: [PATCH] h5dump: use finalAttrs, hash instead of sha256, remove with lib --- pkgs/tools/misc/h5utils/default.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/misc/h5utils/default.nix b/pkgs/tools/misc/h5utils/default.nix index 90f9b48dd118..917313a0cb4f 100644 --- a/pkgs/tools/misc/h5utils/default.nix +++ b/pkgs/tools/misc/h5utils/default.nix @@ -4,15 +4,15 @@ , libmatheval ? null }: -stdenv.mkDerivation rec { +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/${version}/h5utils-${version}.tar.gz"; - sha256 = "sha256-7qeFWoI1+st8RU5hEDCY5VZY2g3fS23luCqZLl8CQ1E="; + 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) @@ -22,18 +22,17 @@ stdenv.mkDerivation rec { --replace "-ldf" "-lhdf" \ ''; - preBuild = lib.optionalString hdf5.mpiSupport "export CC=${hdf5.mpi}/bin/mpicc"; + preBuild = lib.optionalString hdf5.mpiSupport "export CC=${lib.getBin hdf5.mpi}/mpicc"; - buildInputs = with lib; [ hdf5 libjpeg libpng ] ++ optional hdf5.mpiSupport hdf5.mpi - ++ optional (hdf4 != null) hdf4 - ++ optional (libmatheval != null) libmatheval; + buildInputs = [ hdf5 libjpeg libpng ] ++ lib.optional hdf5.mpiSupport hdf5.mpi + ++ lib.optional (hdf4 != null) hdf4 + ++ lib.optional (libmatheval != null) libmatheval; meta = with lib; { 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/${version}"; + changelog = "https://github.com/NanoComp/h5utils/releases/tag/${finalAttrs.version}"; license = with licenses; [ mit gpl2Plus ]; maintainers = with maintainers; [ sfrijters ]; }; - -} +})