2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libminc";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "2.4.06";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-01-13 08:15:51 +00:00
|
|
|
owner = "BIC-MNI";
|
|
|
|
repo = "libminc";
|
|
|
|
rev = "refs/tags/release-${finalAttrs.version}";
|
|
|
|
hash = "sha256-HTt3y0AFM9pkEkWPb9cDmvUz4iBQWfpX7wLF9Vlg8hc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2024-01-13 08:15:51 +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
|
|
|
};
|
2024-01-13 08:15:51 +00:00
|
|
|
})
|