2017-09-24 22:28:16 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
|
2015-11-11 22:51:50 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-12-01 00:36:15 +00:00
|
|
|
pname = "libminc";
|
2018-05-09 21:23:04 +01:00
|
|
|
name = "${pname}-2018-01-17";
|
2015-11-11 22:51:50 +00:00
|
|
|
|
2017-09-26 18:22:46 +01:00
|
|
|
owner = "BIC-MNI";
|
|
|
|
|
|
|
|
# current master is significantly ahead of most recent release, so use Git version:
|
2017-12-01 00:36:15 +00:00
|
|
|
src = fetchFromGitHub {
|
2017-09-26 18:22:46 +01:00
|
|
|
inherit owner;
|
2017-09-24 22:28:16 +01:00
|
|
|
repo = pname;
|
2018-05-09 21:23:04 +01:00
|
|
|
rev = "a9cbe1353eae9791b7d5b03af16e0f86922ce40b";
|
|
|
|
sha256 = "0mn4n3ihzcr1jw2g1vy6c8p4lkc88jwljk04argmj7k4djrgpxpa";
|
2015-11-11 22:51:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2017-09-24 22:28:16 +01:00
|
|
|
buildInputs = [ zlib netcdf nifticlib hdf5 ];
|
2015-11-11 22:51:50 +00:00
|
|
|
|
2017-09-24 22:28:16 +01:00
|
|
|
cmakeFlags = [ "-DBUILD_TESTING=${if doCheck then "TRUE" else "FALSE"}"
|
|
|
|
"-DLIBMINC_MINC1_SUPPORT=TRUE"
|
|
|
|
"-DLIBMINC_BUILD_SHARED_LIBS=TRUE"
|
|
|
|
"-DLIBMINC_USE_SYSTEM_NIFTI=TRUE" ];
|
2015-11-11 22:51:50 +00:00
|
|
|
|
2017-09-24 22:28:16 +01:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
export LD_LIBRARY_PATH="$(pwd)" # see #22060
|
2018-04-10 01:29:03 +01:00
|
|
|
ctest -E 'ezminc_rw_test|minc_conversion' --output-on-failure
|
|
|
|
# ezminc_rw_test can't find libminc_io.so.5.2.0; minc_conversion hits netcdf compilation issue
|
2017-09-24 22:28:16 +01:00
|
|
|
'';
|
2015-11-11 22:51:50 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2017-12-01 00:36:15 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-11-11 22:51:50 +00:00
|
|
|
meta = with stdenv.lib; {
|
2017-09-26 18:22:46 +01:00
|
|
|
homepage = "https://github.com/${owner}/${pname}";
|
2015-11-11 22:51:50 +00:00
|
|
|
description = "Medical imaging library based on HDF5";
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
platforms = platforms.unix;
|
2017-09-26 18:22:46 +01:00
|
|
|
license = licenses.free;
|
2015-11-11 22:51:50 +00:00
|
|
|
};
|
|
|
|
}
|