about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
new file mode 100644
index 000000000000..55ee5ab4fb66
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, itk, python3, Cocoa }:
+
+stdenv.mkDerivation rec {
+  pname    = "elastix";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner  = "SuperElastix";
+    repo   = pname;
+    rev    = version;
+    sha256 = "1mx8kkak2d3ibfrxrh8jkmh2zkdlgl9h578wiw3617zcwaa97bxw";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "install-executables.patch";  # https://github.com/SuperElastix/elastix/issues/305
+      url = "https://github.com/SuperElastix/elastix/commit/8e26cdc0d66f6030c7be085fdc424d84d4fc7546.patch";
+      sha256 = "12y9wbpi9jlarnw6fk4iby97jxvx5g4daq9zqblbcmn51r134bj5";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake python3 ];
+  buildInputs = [ itk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+
+  doCheck = !stdenv.isDarwin;  # usual dynamic linker issues
+
+  preCheck = "
+    export LD_LIBRARY_PATH=$(pwd)/bin
+  ";
+
+  meta = with lib; {
+    homepage = "http://elastix.isi.uu.nl/";
+    description = "Image registration toolkit based on ITK";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.x86_64;  # libitkpng linker issues with ITK 5.1
+    license = licenses.asl20;
+  };
+}