2021-01-21 20:00:13 +03:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
|
2015-11-12 01:51:50 +03:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-12-09 22:19:15 +03:00
|
|
|
pname = "libminc";
|
2020-07-22 22:21:40 +03:00
|
|
|
version = "unstable-2020-07-17";
|
2015-11-12 01:51:50 +03:00
|
|
|
|
2017-09-26 20:22:46 +03:00
|
|
|
owner = "BIC-MNI";
|
|
|
|
|
2017-12-01 03:36:15 +03:00
|
|
|
src = fetchFromGitHub {
|
2017-09-26 20:22:46 +03:00
|
|
|
inherit owner;
|
2017-09-25 00:28:16 +03:00
|
|
|
repo = pname;
|
2020-07-22 22:21:40 +03:00
|
|
|
rev = "ffb5fb234a852ea7e8da8bb2b3b49f67acbe56ca";
|
|
|
|
sha256 = "0yr4ksghpvxh9zg0a4p7hvln3qirsi08plvjp5kxx2qiyj96zsdm";
|
2015-11-12 01:51:50 +03:00
|
|
|
};
|
|
|
|
|
2018-08-08 21:48:44 +03:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
2015-11-12 01:51:50 +03:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-07-22 22:21:40 +03:00
|
|
|
buildInputs = [ zlib nifticlib ];
|
|
|
|
propagatedBuildInputs = [ netcdf hdf5 ];
|
2015-11-12 01:51:50 +03:00
|
|
|
|
2018-08-08 21:48:44 +03:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DLIBMINC_MINC1_SUPPORT=ON"
|
|
|
|
"-DLIBMINC_BUILD_SHARED_LIBS=ON"
|
|
|
|
"-DLIBMINC_USE_SYSTEM_NIFTI=ON"
|
|
|
|
];
|
2017-09-25 00:28:16 +03:00
|
|
|
|
2019-12-09 22:19:15 +03:00
|
|
|
doCheck = !stdenv.isDarwin;
|
2017-09-25 00:28:16 +03:00
|
|
|
checkPhase = ''
|
|
|
|
export LD_LIBRARY_PATH="$(pwd)" # see #22060
|
2020-07-22 22:21:40 +03: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
|
2017-09-25 00:28:16 +03:00
|
|
|
'';
|
2015-11-12 01:51:50 +03:00
|
|
|
|
2021-01-21 20:00:13 +03:00
|
|
|
meta = with lib; {
|
2020-07-22 22:21:40 +03:00
|
|
|
homepage = "https://github.com/BIC-MNI/libminc";
|
2015-11-12 01:51:50 +03:00
|
|
|
description = "Medical imaging library based on HDF5";
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
platforms = platforms.unix;
|
2020-07-22 22:21:40 +03:00
|
|
|
license = licenses.free;
|
2015-11-12 01:51:50 +03:00
|
|
|
};
|
|
|
|
}
|