2023-08-10 07:59:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, bzip2
|
|
|
|
, cmake
|
|
|
|
, fetchurl
|
|
|
|
, fftw
|
|
|
|
, llvmPackages
|
|
|
|
, zlib
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "cmtk";
|
2023-08-10 07:59:29 +00:00
|
|
|
version = "3.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "cmtk-source.tar.gz";
|
2023-08-10 07:59:29 +00:00
|
|
|
url = "https://www.nitrc.org/frs/download.php/13188/CMTK-${finalAttrs.version}-Source.tar.gz//?i_agree=1&download_now=1";
|
|
|
|
hash = "sha256-iE164NCOSOypZLLZfZy9RTyrS+YnY9ECqfb4QhlsMS4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace apps/vtkxform.cxx --replace-fail \
|
|
|
|
"float xyzFloat[3] = { xyz[0], xyz[1], xyz[2] };" \
|
|
|
|
"float xyzFloat[3] = { (float)xyz[0], (float)xyz[1], (float)xyz[2] };"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
buildInputs = [
|
|
|
|
bzip2
|
|
|
|
fftw
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals stdenv.cc.isClang [
|
|
|
|
llvmPackages.openmp
|
|
|
|
];
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
(lib.cmakeFeature "CMAKE_CXX_STANDARD" "14")
|
|
|
|
] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
|
|
|
(lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Dfinite=isfinite")
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-08-10 07:59:29 +00:00
|
|
|
description = "Computational Morphometry Toolkit";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cmtk";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''A software toolkit for computational morphometry of
|
|
|
|
biomedical images, CMTK comprises a set of command line tools and a
|
|
|
|
back-end general-purpose library for processing and I/O'';
|
|
|
|
maintainers = with maintainers; [ tbenst ];
|
|
|
|
platforms = platforms.all;
|
2023-08-10 07:59:29 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://www.nitrc.org/projects/cmtk/";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-08-10 07:59:29 +00:00
|
|
|
})
|