2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libminc";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "2.4.05";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
owner = "BIC-MNI";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit owner;
|
|
|
|
repo = pname;
|
2022-08-21 13:32:41 +00:00
|
|
|
rev = "aa08255f0856e70fb001c5f9ee1f4e5a8c12d47d"; # new release, but no git tag
|
|
|
|
sha256 = "XMTO6/HkyrrQ0s5DzJLCmmWheye2DGMnpDbcGdP6J+A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-10-07 09:15:18 +00:00
|
|
|
buildInputs = [ zlib nifticlib ];
|
|
|
|
propagatedBuildInputs = [ netcdf hdf5 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DLIBMINC_MINC1_SUPPORT=ON"
|
|
|
|
"-DLIBMINC_BUILD_SHARED_LIBS=ON"
|
2022-08-21 13:32:41 +00:00
|
|
|
"-DLIBMINC_USE_NIFTI=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DLIBMINC_USE_SYSTEM_NIFTI=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
2020-10-07 09:15:18 +00:00
|
|
|
# -j1: see https://github.com/BIC-MNI/libminc/issues/110
|
2022-08-21 13:32:41 +00:00
|
|
|
checkPhase = ''
|
|
|
|
ctest -j1 --output-on-failure
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://github.com/BIC-MNI/libminc";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Medical imaging library based on HDF5";
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
platforms = platforms.unix;
|
2020-10-07 09:15:18 +00:00
|
|
|
license = licenses.free;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|