gnu: itk-snap: Update to 4.2.2-0.6525125.

* gnu/packages/image-processing: Import (gnu packages ssh).
(itk-snap): Update to 4.2.2-0.6525125.
[source]: Fetch from the new official home on GitHub.  Remove
itk-snap-alt-glibc-compat.patch.
[arguments]: Use gexps.
<#:configure-flags>: Remove "-DSNAP_VERSION_GIT_SHA1=release",
"-DSNAP_VERSION_GIT_TIMESTAMP=0", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON",
"-DCMAKE_CXX_STANDARD=14".
<#:phases>{disable-gui-tests}: Disable more GUI tests.
{prepare-submodules}: Remove substitution in c3d checkout.  Add digestible
submodule.
{fix-includes}: Delete phase.
{remove-bundled-jsoncpp}: New phase.
{wrap-executable}: Use gexp.
[inputs]: Replace insight-toolkit-4.12 with insight-toolkit-legacy.  Replace
vtk-7 with vtk. Replace qtbase-5 with qtbase.  Replace qtdeclarative-5 with
qtdeclarative.  Add freetype, glew, jsoncpp and libssh.  Remove bash-minimal,
fftw, fftwf, hdf5, vxl-1 and zlib.
[native-inputs]: Use new style.  Update c3d and greedy checkouts.  Add
digestible checkout.  Remove googletest, qttools-5 and pkg-config.
* gnu/local.mk: Deregister itk-snap-alt-glibc-compat.patch.
* gnu/packages/patches/itk-snap-alt-glibc-compat.patch: Remove file.

Change-Id: I6a90a590fa773e838946d773e9b0a743129ee1f3
This commit is contained in:
Jake Forster 2025-07-25 23:58:33 +09:30 committed by Andreas Enge
parent 82ab2e82f3
commit 6a6e8673a9
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3
3 changed files with 105 additions and 133 deletions

View file

@ -1634,7 +1634,6 @@ dist_patch_DATA = \
%D%/packages/patches/irrlicht-use-system-libs.patch \ %D%/packages/patches/irrlicht-use-system-libs.patch \
%D%/packages/patches/irrlicht-link-against-needed-libs.patch \ %D%/packages/patches/irrlicht-link-against-needed-libs.patch \
%D%/packages/patches/isl-0.11.1-aarch64-support.patch \ %D%/packages/patches/isl-0.11.1-aarch64-support.patch \
%D%/packages/patches/itk-snap-alt-glibc-compat.patch \
%D%/packages/patches/jamesdsp-fix-bulid-on-pipewire-1.4.0.patch\ %D%/packages/patches/jamesdsp-fix-bulid-on-pipewire-1.4.0.patch\
%D%/packages/patches/jami-disable-webengine.patch \ %D%/packages/patches/jami-disable-webengine.patch \
%D%/packages/patches/jami-enable-testing.patch \ %D%/packages/patches/jami-enable-testing.patch \

View file

@ -106,6 +106,7 @@
#:use-module (gnu packages serialization) #:use-module (gnu packages serialization)
#:use-module (gnu packages sphinx) #:use-module (gnu packages sphinx)
#:use-module (gnu packages sqlite) #:use-module (gnu packages sqlite)
#:use-module (gnu packages ssh)
#:use-module (gnu packages swig) #:use-module (gnu packages swig)
#:use-module (gnu packages tbb) #:use-module (gnu packages tbb)
#:use-module (gnu packages textutils) #:use-module (gnu packages textutils)
@ -1477,137 +1478,131 @@ combine the information contained in both.")
#~(cons* "-DCMAKE_CXX_FLAGS=-std=c++14" #$cf)))))) #~(cons* "-DCMAKE_CXX_FLAGS=-std=c++14" #$cf))))))
(define-public itk-snap (define-public itk-snap
;; The latest release, 4.2.2, segmentation faults on startup.
;; The commit is version 4.4.0-alpha3.
(let ((commit "65251254d44d68a6c0530984169784e35de020dd")
(revision "0"))
(package (package
(name "itk-snap") (name "itk-snap")
(version "3.8.0") (version (git-version "4.2.2" revision commit))
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://git.code.sf.net/p/itk-snap/src") (url "https://github.com/pyushkevich/itksnap")
(commit (string-append "v" version)))) (commit commit)))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q")) (base32 "07dgcfklc55yj3ldcq6fc5fil8qfrv7z6c3xhbd293kz7kpjr4yc"))))
(patches (search-patches "itk-snap-alt-glibc-compat.patch"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:configure-flags (list
(list "-DSNAP_VERSION_GIT_SHA1=release" #:configure-flags
"-DSNAP_VERSION_GIT_BRANCH=release" #~(list "-DSNAP_VERSION_GIT_BRANCH=release"
"-DSNAP_VERSION_GIT_TIMESTAMP=0" "-DSNAP_PACKAGE_QT_PLUGINS=OFF")
"-DSNAP_PACKAGE_QT_PLUGINS=OFF" #:phases
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON" #~(modify-phases %standard-phases
;; ISO C++17 does not allow dynamic exception specifications. ;; During the installation phase all libraries provided by all
"-DCMAKE_CXX_STANDARD=14") ;; dependencies will be copied to the lib directory. That's insane,
#:phases ;; so we disable this.
(modify-phases %standard-phases (add-after 'unpack 'do-not-copy-dependencies
;; During the installation phase all libraries provided by all (lambda _
;; dependencies will be copied to the lib directory. That's insane, (substitute* "CMakeLists.txt"
;; so we disable this. (("install_qt5_executable\
(add-after 'unpack 'do-not-copy-dependencies
(lambda _
(substitute* "CMakeLists.txt"
(("install_qt5_executable\
\\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)") \\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)")
"")))) ""))))
(add-after 'unpack 'disable-gui-tests (add-after 'unpack 'disable-gui-tests
(lambda _ (lambda _
;; The GUI tests just time out. ;; The GUI tests just segmentation fault.
(substitute* "CMakeLists.txt" (substitute* "CMakeLists.txt"
((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\ ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
|RandomForest|RandomForestBailOut)") |RandomForest|RandomForestBailOut|NaNs|4DContinuousRenderingD|EdgeAttraction\
"")))) |EchoCartesianDicomLoading|LabelSmoothing|PreferencesDialog|MeshImport\
(add-after 'unpack 'make-reproducible |MeshWorkspace|SegmentationMesh|VolumeRendering|Reloading|4DToMC|MCTo4D\
(lambda _ |DeformationGrid)")
(substitute* "CMakeLists.txt" ""))))
(("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)") (add-after 'unpack 'make-reproducible
"SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")")))) (lambda _
(add-after 'unpack 'prepare-submodules (substitute* "CMakeLists.txt"
(lambda* (#:key inputs #:allow-other-keys) (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
(rmdir "Submodules/c3d") "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))))
(copy-recursively (assoc-ref inputs "c3d-src") (add-after 'unpack 'prepare-submodules
"Submodules/c3d") (lambda _
(substitute* '("Submodules/c3d/adapters/BiasFieldCorrectionN4.cxx" (rmdir "Submodules/c3d")
"Submodules/c3d/adapters/ApplyMetric.cxx") (symlink #$(this-package-native-input "c3d-checkout")
(("vcl_") "std::")) "Submodules/c3d")
(rmdir "Submodules/greedy") (rmdir "Submodules/digestible")
(symlink (assoc-ref inputs "greedy-src") (symlink #$(this-package-native-input "digestible-checkout")
"Submodules/greedy"))) "Submodules/digestible")
(add-after 'unpack 'fix-includes (rmdir "Submodules/greedy")
(lambda _ (symlink #$(this-package-native-input "greedy-checkout")
(substitute* "GUI/Model/RegistrationModel.cxx" "Submodules/greedy")))
(("<vnl_symmetric_eigensystem.h>") (add-after 'unpack 'remove-bundled-jsoncpp
"<vnl/algo/vnl_symmetric_eigensystem.h>")))) (lambda _
(add-before 'check 'prepare-tests (substitute* "CMakeLists.txt"
(lambda _ ((" Common/JSon/jsoncpp\\.cpp") ""))))
;; Needed by at least one test. (add-before 'check 'prepare-tests
(setenv "HOME" "/tmp"))) (lambda _
(add-after 'install 'wrap-executable ;; Needed by at least one test.
(lambda* (#:key inputs outputs #:allow-other-keys) (setenv "HOME" "/tmp")))
(let ((out (assoc-ref outputs "out"))) (add-after 'install 'wrap-executable
(wrap-program (string-append out "/bin/itksnap") (lambda _
`("QT_PLUGIN_PATH" ":" prefix (wrap-program (string-append #$output "/bin/itksnap")
,(map (lambda (label) (list
(string-append (assoc-ref inputs label) "QT_PLUGIN_PATH"
"/lib/qt5/plugins")) 'suffix
'("qtbase" "qtdeclarative")))))))))) (list (string-append #$(this-package-input "qtbase")
"/lib/qt6/plugins")
(string-append #$(this-package-input "qtdeclarative")
"/lib/qt6/plugins")))))))))
(inputs (inputs
(list bash-minimal (list curl
curl freetype
fftw glew
fftwf
glu glu
hdf5 insight-toolkit-legacy
jsoncpp
libssh
mesa-opencl mesa-opencl
;; This package does not build with either insight-toolkit 5.0.0 qtbase
;; and not with 4.13. It really needs to be 4.12. qtdeclarative
insight-toolkit-4.12 vtk))
vtk-7
qtbase-5
qtdeclarative-5
vxl-1
zlib))
(native-inputs (native-inputs
`(("googletest" ,googletest) (list
("qttools-5" ,qttools-5) doxygen
("pkg-config" ,pkg-config) ;; Use the submodule commits in this version of ITK-SNAP.
("c3d-src" (origin
,(let* ((commit "f521358db26e00002c911cc47bf463b043942ad3") (method git-fetch)
(revision "1") (uri (git-reference
(version (git-version "0" revision commit))) (url "https://github.com/pyushkevich/c3d")
(origin (commit "a86a2a32db8635c1535522332fee68bc56eacaa2")))
(method git-fetch) (file-name "c3d-checkout")
(uri (git-reference (sha256
(url "https://github.com/pyushkevich/c3d") (base32 "0da3ikx7pqlrmvhkmzil269j6kyd84pphy1mls8v69gmzl89piis")))
(commit commit))) (origin
(file-name (git-file-name "c3d" version)) (method git-fetch)
(sha256 (uri (git-reference
(base32 (url "https://github.com/pyushkevich/digestible")
"0kyv3rxrxwr8c3sa9zv01lsnhk95b27gx1s870k3yi8qp52h7bx3"))))) (commit "1b66709e99c43d280bb472e1a0e36185ef2ea412")))
;; We are using an arbitrary commit from 2017 because the latest (file-name "digestible-checkout")
;; version breaks the build... (sha256
("greedy-src" (base32 "1m1b954prq6l3byfdgxw2y17xsg81agd516g5n6ps60dqnxw8hqs")))
,(let* ((commit "97e340f7e8e66597599144947775e6039e79a0d3") (origin
(revision "1") (method git-fetch)
(version (git-version "0" revision commit))) (uri (git-reference
(origin (url "https://github.com/pyushkevich/greedy")
(method git-fetch) (commit "f10152c5374da08ee024c4c60ef8882876bd0808")))
(uri (git-reference (file-name "greedy-checkout")
(url "https://github.com/pyushkevich/greedy") (sha256
(commit commit))) (base32 "0xk1l0h4wis4nkfwjnvh624bdlhy7l26djibk4l00wzv0vvq21qv")))))
(file-name (git-file-name "greedy" version))
(sha256
(base32
"0k5bc9za4jrc8z9dj08z1rkcp5xf0gnd1d2jmi1w9ny4vxh2q2ab")))))))
(home-page "https://sourceforge.net/p/itk-snap/") (home-page "https://sourceforge.net/p/itk-snap/")
(synopsis "Medical image segmentation") (synopsis "Medical image segmentation")
(description "ITK-SNAP is a tool for segmenting anatomical structures in (description "ITK-SNAP is a tool for segmenting anatomical structures in
medical images. It provides an automatic active contour segmentation medical images. It provides an automatic active contour segmentation
pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
full-featured UI aimed at clinical researchers.") full-featured UI aimed at clinical researchers.")
;; This includes the submodules greedy and c3d. ;; This includes the submodules greedy, c3d and digestible.
(license license:gpl3+))) (license license:gpl3+))))
(define-public metapixel (define-public metapixel
;; Follow stable branch. ;; Follow stable branch.

View file

@ -1,22 +0,0 @@
Retrieved from ALT Linux.
https://git.altlinux.org/tasks/273587/build/300/x86_64/srpm/itk-snap-3.8.0-alt6.src.rpm
diff --git a/GUI/Qt/main.cxx b/GUI/Qt/main.cxx
index 576f7160..ceab92e6 100644
--- a/GUI/Qt/main.cxx
+++ b/GUI/Qt/main.cxx
@@ -51,12 +51,13 @@ using namespace std;
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include <signal.h>
+#include <string.h>
#include <execinfo.h>
void SegmentationFaultHandler(int sig)
{
cerr << "*************************************" << endl;
- cerr << "ITK-SNAP: " << sys_siglist[sig] << endl;
+ cerr << "ITK-SNAP: " << strsignal(sig) << " (" << sigabbrev_np(sig) << ")" << endl;
cerr << "BACKTRACE: " << endl;
void *array[50];
int nsize = backtrace(array, 50);