linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / science / biology / elastix / default.nix
blob55ee5ab4fb6676b97f6801df3a0d48aa94953005
1 { lib, stdenv, fetchFromGitHub, fetchpatch, cmake, itk, python3, Cocoa }:
3 stdenv.mkDerivation rec {
4   pname    = "elastix";
5   version = "5.0.1";
7   src = fetchFromGitHub {
8     owner  = "SuperElastix";
9     repo   = pname;
10     rev    = version;
11     sha256 = "1mx8kkak2d3ibfrxrh8jkmh2zkdlgl9h578wiw3617zcwaa97bxw";
12   };
14   patches = [
15     (fetchpatch {
16       name = "install-executables.patch";  # https://github.com/SuperElastix/elastix/issues/305
17       url = "https://github.com/SuperElastix/elastix/commit/8e26cdc0d66f6030c7be085fdc424d84d4fc7546.patch";
18       sha256 = "12y9wbpi9jlarnw6fk4iby97jxvx5g4daq9zqblbcmn51r134bj5";
19     })
20   ];
22   nativeBuildInputs = [ cmake python3 ];
23   buildInputs = [ itk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
25   doCheck = !stdenv.isDarwin;  # usual dynamic linker issues
27   preCheck = "
28     export LD_LIBRARY_PATH=$(pwd)/bin
29   ";
31   meta = with lib; {
32     homepage = "http://elastix.isi.uu.nl/";
33     description = "Image registration toolkit based on ITK";
34     maintainers = with maintainers; [ bcdarwin ];
35     platforms = platforms.x86_64;  # libitkpng linker issues with ITK 5.1
36     license = licenses.asl20;
37   };