linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / libminc / default.nix
blob2440082cce9d7a546aa83b753187d29e8c681374
1 { lib, stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
3 stdenv.mkDerivation rec {
4   pname   = "libminc";
5   version = "unstable-2020-07-17";
7   owner = "BIC-MNI";
9   src = fetchFromGitHub {
10     inherit owner;
11     repo   = pname;
12     rev    = "ffb5fb234a852ea7e8da8bb2b3b49f67acbe56ca";
13     sha256 = "0yr4ksghpvxh9zg0a4p7hvln3qirsi08plvjp5kxx2qiyj96zsdm";
14   };
16   postPatch = ''
17     patchShebangs .
18   '';
20   nativeBuildInputs = [ cmake ];
21   buildInputs = [ zlib nifticlib ];
22   propagatedBuildInputs = [ netcdf hdf5 ];
24   cmakeFlags = [
25     "-DLIBMINC_MINC1_SUPPORT=ON"
26     "-DLIBMINC_BUILD_SHARED_LIBS=ON"
27     "-DLIBMINC_USE_SYSTEM_NIFTI=ON"
28   ];
30   doCheck = !stdenv.isDarwin;
31   checkPhase = ''
32     export LD_LIBRARY_PATH="$(pwd)"  # see #22060
33     ctest -j1 -E 'ezminc_rw_test' --output-on-failure
34     # -j1: see https://github.com/BIC-MNI/libminc/issues/110
35     # ezminc_rw_test: can't find libminc_io.so.5.2.0
36   '';
38   meta = with lib; {
39     homepage = "https://github.com/BIC-MNI/libminc";
40     description = "Medical imaging library based on HDF5";
41     maintainers = with maintainers; [ bcdarwin ];
42     platforms = platforms.unix;
43     license = licenses.free;
44   };