2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libminc";
|
2020-10-07 09:15:18 +00:00
|
|
|
version = "unstable-2020-07-17";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
owner = "BIC-MNI";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit owner;
|
|
|
|
repo = pname;
|
2020-10-07 09:15:18 +00:00
|
|
|
rev = "ffb5fb234a852ea7e8da8bb2b3b49f67acbe56ca";
|
|
|
|
sha256 = "0yr4ksghpvxh9zg0a4p7hvln3qirsi08plvjp5kxx2qiyj96zsdm";
|
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"
|
|
|
|
"-DLIBMINC_USE_SYSTEM_NIFTI=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
checkPhase = ''
|
|
|
|
export LD_LIBRARY_PATH="$(pwd)" # see #22060
|
2020-10-07 09:15:18 +00:00
|
|
|
ctest -j1 -E 'ezminc_rw_test' --output-on-failure
|
|
|
|
# -j1: see https://github.com/BIC-MNI/libminc/issues/110
|
|
|
|
# ezminc_rw_test: can't find libminc_io.so.5.2.0
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.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
|
|
|
};
|
|
|
|
}
|