nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 50 lines 1.4 kB view raw
1{ 2 stdenv, 3 fetchurl, 4 lib, 5 hdf5, 6 libpng, 7 libjpeg, 8 hdf4 ? null, 9 libmatheval ? null, 10}: 11 12stdenv.mkDerivation (finalAttrs: { 13 version = "1.13.2"; 14 pname = "h5utils"; 15 16 # fetchurl is used instead of fetchFromGitHub because the git repo version requires 17 # additional tools to build compared to the tarball release; see the README for details. 18 src = fetchurl { 19 url = "https://github.com/stevengj/h5utils/releases/download/${finalAttrs.version}/h5utils-${finalAttrs.version}.tar.gz"; 20 hash = "sha256-7qeFWoI1+st8RU5hEDCY5VZY2g3fS23luCqZLl8CQ1E="; 21 }; 22 23 # libdf is an alternative name for libhdf (hdf4) 24 preConfigure = lib.optionalString (hdf4 != null) '' 25 substituteInPlace configure \ 26 --replace "-ldf" "-lhdf" \ 27 ''; 28 29 preBuild = lib.optionalString hdf5.mpiSupport "export CC=${lib.getBin hdf5.mpi}/mpicc"; 30 31 buildInputs = [ 32 hdf5 33 libjpeg 34 libpng 35 ] 36 ++ lib.optional hdf5.mpiSupport hdf5.mpi 37 ++ lib.optional (hdf4 != null) hdf4 38 ++ lib.optional (libmatheval != null) libmatheval; 39 40 meta = { 41 description = "Set of utilities for visualization and conversion of scientific data in the free, portable HDF5 format"; 42 homepage = "https://github.com/stevengj/h5utils"; 43 changelog = "https://github.com/NanoComp/h5utils/releases/tag/${finalAttrs.version}"; 44 license = with lib.licenses; [ 45 mit 46 gpl2Plus 47 ]; 48 maintainers = [ lib.maintainers.sfrijters ]; 49 }; 50})