[Backport release-25.11] {ebtks,n3,inormalize}: update and fix build with CMake >= 4 (#466531)

This commit is contained in:
Aleksana
2025-11-30 11:05:42 +00:00
committed by GitHub
6 changed files with 44 additions and 86 deletions

View File

@@ -5,36 +5,31 @@
cmake,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation {
pname = "arguments";
version = "unstable-2015-11-30";
owner = "BIC-MNI";
version = "1.4.60-unstable-2023-01-18";
src = fetchFromGitHub {
inherit owner;
owner = "BIC-MNI";
repo = "arguments";
rev = "b3aad97f6b6892cb8733455d0d448649a48fa108";
sha256 = "1ar8lm1w1jflz3vdmjr5c4x6y7rscvrj78b8gmrv79y95qrgzv6s";
rev = "ed7c4c126b800d4312469e3cd3999a31e96fed0e";
hash = "sha256-1QxVZ17zSqx5P9nGAXHf7Fj86fuGn17PllGXFqyYJUo=";
};
nativeBuildInputs = [ cmake ];
#cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" "-DBICPL_DIR=${bicpl}/lib" ];
doCheck = false;
# internal_volume_io.h: No such file or directory
doCheck = false; # test binary not built by cmake
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "CMAKE_MINIMUM_REQUIRED(VERSION 2.6)" "cmake_minimum_required(VERSION 3.10)"
--replace-fail "CMAKE_MINIMUM_REQUIRED(VERSION 3.1)" "cmake_minimum_required(VERSION 3.10)"
'';
meta = with lib; {
homepage = "https://github.com/${owner}/arguments";
meta = {
homepage = "https://github.com/BIC-MNI/arguments";
description = "Library for argument handling for MINC programs";
maintainers = with maintainers; [ bcdarwin ];
platforms = platforms.unix;
license = licenses.gpl2Plus;
maintainers = with lib.maintainers; [ bcdarwin ];
platforms = lib.platforms.unix;
license = lib.licenses.gpl2Plus;
};
}

View File

@@ -8,35 +8,25 @@
stdenv.mkDerivation {
pname = "ebtks";
version = "unstable-2017-09-23";
version = "1.6.40-unstable-2025-05-06";
src = fetchFromGitHub {
owner = "BIC-MNI";
repo = "EBTKS";
rev = "67e4e197d8a32d6462c9bdc7af44d64ebde4fb5c";
hash = "sha256-+MIRE2NdRH7IQrstK3WRqft6l9I+UGD6j0G7Q6LhOKg=";
rev = "7317b54d79bd7d80b5361dc44a7966709d9a8b36";
hash = "sha256-kp3uPvsIker8918stsVUdMC72A6Jz0K7r5PFDLbWqNo=";
};
# error: use of undeclared identifier 'finite'; did you mean 'isfinite'?
postPatch = ''
substituteInPlace templates/EBTKS/SimpleArray.h \
--replace "#define FINITE(x) finite(x)" "#define FINITE(x) isfinite(x)"
''
# error: ISO C++17 does not allow 'register' storage class specifier
+ ''
find . -type f -exec sed -i -e 's/register //g' {} +
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ libminc ];
cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" ];
meta = with lib; {
meta = {
homepage = "https://github.com/BIC-MNI/EBTKS";
description = "Library for working with MINC files";
maintainers = with maintainers; [ bcdarwin ];
platforms = platforms.unix;
license = licenses.free;
maintainers = with lib.maintainers; [ bcdarwin ];
platforms = lib.platforms.unix;
license = lib.licenses.free;
};
}

View File

@@ -1,10 +0,0 @@
diff --git a/lgmask.in b/lgmask.in
index 17dbe4d..2195d91 100644
--- a/lgmask.in
+++ b/lgmask.in
@@ -1,4 +1,4 @@
-#! @PERL@
+#! /usr/bin/env perl
#---------------------------------------------------------------------------
#@COPYRIGHT :

View File

@@ -1,10 +0,0 @@
diff --git a/nu_correct_norm.in b/nu_correct_norm.in
index 1dc84ac..1bc6235 100644
--- a/nu_correct_norm.in
+++ b/nu_correct_norm.in
@@ -1,4 +1,4 @@
-#! @PERL@
+#! /usr/bin/perl
#---------------------------------------------------------------------------
#@COPYRIGHT :

View File

@@ -11,38 +11,34 @@
stdenv.mkDerivation {
pname = "inormalize";
version = "unstable-2014-10-21";
version = "1.2.00-unstable-2023-01-19";
src = fetchFromGitHub {
owner = "BIC-MNI";
repo = "inormalize";
rev = "79cea9cdfe7b99abfd40afda89ab2253b596ad2f";
sha256 = "1ahqv5q0ljvji99a5q8azjkdf6bgp6nr8lwivkqwqs3jm0k5clq7";
rev = "4928e573165d76551c3d273ccf0c46f4fbab11fc";
hash = "sha256-ZxTsPBsaL/5BWC7ew57um8LPb96hytI30JE8saBBNw8=";
};
patches = [
./lgmask-interp.patch
./nu_correct_norm-interp.patch
];
postPatch = ''
substituteInPlace inormalize.cc \
--replace "clamp" "::clamp"
substituteInPlace CMakeLists.txt \
--replace-fail "CMAKE_MINIMUM_REQUIRED(VERSION 3.1)" "CMAKE_MINIMUM_REQUIRED(VERSION 3.10)"
'';
nativeBuildInputs = [
cmake
makeWrapper
];
buildInputs = [
libminc
ebtks
];
propagatedBuildInputs = with perlPackages; [
]
++ (with perlPackages; [
perl
GetoptTabular
MNI-Perllib
];
]);
cmakeFlags = [
"-DLIBMINC_DIR=${libminc}/lib/cmake"
@@ -55,11 +51,11 @@ stdenv.mkDerivation {
done
'';
meta = with lib; {
meta = {
homepage = "https://github.com/BIC-MNI/inormalize";
description = "Program to normalize intensity of MINC files";
maintainers = with maintainers; [ bcdarwin ];
platforms = platforms.unix;
license = licenses.free;
maintainers = with lib.maintainers; [ bcdarwin ];
platforms = lib.platforms.unix;
license = lib.licenses.free;
};
}

View File

@@ -11,37 +11,34 @@
stdenv.mkDerivation {
pname = "N3";
version = "unstable-2018-08-09";
version = "1.12.00-unstable-2023-01-19";
src = fetchFromGitHub {
owner = "BIC-MNI";
repo = "N3";
rev = "010fc2ac58ce1d67b8e6a863fac0809d3203cb9b";
sha256 = "06hci7gzhy8p34ggvx7gah2k9yxpwhgmq1cgw8pcd1r82g4rg6kd";
rev = "96194790a577293163b6319d00539c8af45c195e";
hash = "sha256-iA2dMOc+dlraT44zITrvOLIaJ3iH4a/fU5aS/YzIEGQ=";
};
postPatch = ''
substituteInPlace src/VolumeHist/DHistogram.cc \
--replace "register " ""
'';
nativeBuildInputs = [
cmake
makeWrapper
];
buildInputs = [
libminc
ebtks
];
propagatedBuildInputs = with perlPackages; [
]
++ (with perlPackages; [
perl
MNI-Perllib
GetoptTabular
];
]);
cmakeFlags = [
"-DLIBMINC_DIR=${libminc}/lib/cmake"
"-DEBTKS_DIR=${ebtks}/lib/"
"-DCMAKE_POLICY_VERSION_MINIMUM=3.10"
];
postFixup = ''
@@ -50,11 +47,11 @@ stdenv.mkDerivation {
done
'';
meta = with lib; {
meta = {
homepage = "https://github.com/BIC-MNI/N3";
description = "MRI non-uniformity correction for MINC files";
maintainers = with maintainers; [ bcdarwin ];
platforms = platforms.unix;
license = licenses.free;
maintainers = with lib.maintainers; [ bcdarwin ];
platforms = lib.platforms.unix;
license = lib.licenses.free;
};
}