anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / development / libraries / science / biology / mirtk / default.nix
blob979f3589b3302ca1cef18f87789ba7b871e6480f
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , python3
6 , boost
7 , eigen
8 , libGLU
9 , fltk
10 , itk
11 , vtk
12 , zlib
13 , tbb
16 stdenv.mkDerivation rec {
17   pname = "mirtk";
18   version = "unstable-2022-07-22";
20   src = fetchFromGitHub {
21     owner = "BioMedIA";
22     repo = "MIRTK";
23     rev = "973ce2fe3f9508dec68892dbf97cca39067aa3d6";
24     hash = "sha256-vKgkDrbyGOcbaYlxys1duC8ZNG0Y2nqh3TtSQ06Ox0Q=";
25     fetchSubmodules = true;
26   };
28   cmakeFlags = [
29     "-DWITH_VTK=ON"
30     "-DBUILD_ALL_MODULES=ON"
31     "-DWITH_TBB=ON"
32     "-DWITH_ITK=ON"
33     "-DWITH_GIFTICLIB=ON"
34     "-DWITH_NIFTILIB=ON"
35   ];
37   # tries to download data during configuration
38   postPatch = ''
39     substituteInPlace Packages/DrawEM/CMakeLists.txt --replace "include(Atlases.cmake)" ""
40   '';
42   # tests don't seem to be maintained and gtest fails to link with BUILD_TESTING=ON;
43   # unclear if specific to Nixpkgs
44   doCheck = false;
46   postInstall = ''
47     install -Dm644 -t "$out/share/bash-completion/completions/mirtk" share/completion/bash/mirtk
48   '';
50   env.NIX_CFLAGS_COMPILE = "-Wno-changes-meaning";
52   nativeBuildInputs = [ cmake ];
53   buildInputs = [
54     boost
55     eigen
56     fltk
57     itk
58     libGLU
59     python3
60     tbb
61     vtk
62     zlib
63   ];
65   meta = with lib; {
66     homepage = "https://github.com/BioMedIA/MIRTK";
67     description = "Medical image registration library and tools";
68     mainProgram = "mirtk";
69     maintainers = with maintainers; [ bcdarwin ];
70     platforms = platforms.linux;
71     license = licenses.asl20;
72   };