about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libminc
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libminc')
-rw-r--r--nixpkgs/pkgs/development/libraries/libminc/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libminc/default.nix b/nixpkgs/pkgs/development/libraries/libminc/default.nix
new file mode 100644
index 000000000000..53b6af40b512
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libminc/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
+
+stdenv.mkDerivation rec {
+  pname   = "libminc";
+  version = "2.4.03";
+
+  owner = "BIC-MNI";
+
+  src = fetchFromGitHub {
+    inherit owner;
+    repo   = pname;
+    rev    = "release-${version}";
+    sha256 = "0kpmqs9df836ywsqj749qbsfavf5bnldblxrmnmxqq9pywc8yfrm";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib netcdf nifticlib hdf5 ];
+
+  cmakeFlags = [
+    "-DLIBMINC_MINC1_SUPPORT=ON"
+    "-DLIBMINC_BUILD_SHARED_LIBS=ON"
+    "-DLIBMINC_USE_SYSTEM_NIFTI=ON"
+  ];
+
+  doCheck = !stdenv.isDarwin;
+  checkPhase = ''
+    export LD_LIBRARY_PATH="$(pwd)"  # see #22060
+    ctest -E 'ezminc_rw_test|minc_conversion' --output-on-failure
+    # ezminc_rw_test can't find libminc_io.so.5.2.0; minc_conversion hits netcdf compilation issue
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/${owner}/${pname}";
+    description = "Medical imaging library based on HDF5";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}