Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libminc / default.nix
blob00db5fc8337736cf8cbcd8ddc1cfc8eaf4cb5e99
1 { lib, stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
3 stdenv.mkDerivation rec {
4   pname   = "libminc";
5   version = "2.4.05";
7   owner = "BIC-MNI";
9   src = fetchFromGitHub {
10     inherit owner;
11     repo   = pname;
12     rev    = "aa08255f0856e70fb001c5f9ee1f4e5a8c12d47d";  # new release, but no git tag
13     sha256 = "XMTO6/HkyrrQ0s5DzJLCmmWheye2DGMnpDbcGdP6J+A=";
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_NIFTI=ON"
28     "-DLIBMINC_USE_SYSTEM_NIFTI=ON"
29   ];
31   doCheck = !stdenv.isDarwin;
32     # -j1: see https://github.com/BIC-MNI/libminc/issues/110
33   checkPhase = ''
34     ctest -j1 --output-on-failure
35   '';
37   meta = with lib; {
38     homepage = "https://github.com/BIC-MNI/libminc";
39     description = "Medical imaging library based on HDF5";
40     maintainers = with maintainers; [ bcdarwin ];
41     platforms = platforms.unix;
42     license = licenses.free;
43   };