summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJake Forster <jakecameron.forster@gmail.com>2025-06-22 12:02:49 +0930
committerLudovic Courtès <ludo@gnu.org>2025-06-30 14:30:40 +0200
commitaa2f243ab724ead8f7c06f0a9dc8c1a4874de7fe (patch)
treec901613e34accaa47c6674b9061edd0755d264c2 /gnu
parentcd8f7f8d891a787ac6c275f04405676c7586b7ff (diff)
gnu: insight-toolkit: Update to 5.4.4.
* gnu/packages/image-processing (insight-toolkit): Update to 5.4.4. [source] Switch to git-fetch; apply patch. [arguments]<#:configure-flags>: Add -DITK_USE_SYSTEM_SWIG=ON, -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON, -DITK_USE_PYTHON_LIMITED_API=OFF and -DBUILD_TESTING=OFF. Add -DHDF5_DIR set to HDF5's lib/cmake. [inputs]: Add libaec. [native-inputs]: Add git-minimal; replace swig with swig-next. * gnu/packages/patches/insight-toolkit-fix-build.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patch. Change-Id: Ifbf73709e773649fb00c2d46848d3418daaf98c1 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/image-processing.scm34
-rw-r--r--gnu/packages/patches/insight-toolkit-fix-build.patch43
3 files changed, 70 insertions, 8 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index c97bbfaac64..5b0f2b5e545 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1623,6 +1623,7 @@ dist_patch_DATA = \
%D%/packages/patches/instead-use-games-path.patch \
%D%/packages/patches/intltool-perl-compatibility.patch \
%D%/packages/patches/inetutils-hurd64.patch \
+ %D%/packages/patches/insight-toolkit-fix-build.patch \
%D%/packages/patches/irrlicht-use-system-libs.patch \
%D%/packages/patches/irrlicht-link-against-needed-libs.patch \
%D%/packages/patches/isl-0.11.1-aarch64-support.patch \
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index c84290205df..cf6da9bbb50 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -24,6 +24,7 @@
;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
;;; Copyright © 2023 Cairn <cairn@pm.me>
;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2025 Jake Forster <jakecameron.forster@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1238,15 +1239,20 @@ libraries designed for computer vision research and implementation.")
(define-public insight-toolkit
(package
(name "insight-toolkit")
- (version "5.0.0")
+ (version "5.4.4")
(source
(origin
- (method url-fetch)
- (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
- "releases/download/v" version "/InsightToolkit-"
- version ".tar.xz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/InsightSoftwareConsortium/ITK")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
(sha256
- (base32 "0bs63mk4q8jmx38f031jy5w5n9yy5ng9x8ijwinvjyvas8cichqi"))))
+ (base32 "1l5rby8jj8726k380aivycmhn56cz56mr9k3r56c8hkkrfwwng50"))
+ ;; This patch is required to build with both ITK_USE_GPU=ON and
+ ;; ITK_WRAP_PYTHON=ON.
+ ;; <https://github.com/InsightSoftwareConsortium/ITK/pull/4842>
+ (patches (search-patches "insight-toolkit-fix-build.patch"))))
(build-system cmake-build-system)
(outputs '("out" "python"))
(arguments
@@ -1255,7 +1261,15 @@ libraries designed for computer vision research and implementation.")
#~(list "-DITK_USE_GPU=ON"
"-DITK_USE_SYSTEM_LIBRARIES=ON"
"-DITK_USE_SYSTEM_CASTXML=ON"
+ "-DITK_USE_SYSTEM_SWIG=ON"
+ (string-append "-DHDF5_DIR=" #$(this-package-input "hdf5")
+ "/lib/cmake")
"-DBUILD_SHARED_LIBS=ON"
+ ;; Without this flag, there are shared libraries installed
+ ;; in PY_SITE_PACKAGES_PATH/itk instead of #$output/lib and
+ ;; RUNPATHs contain the *build directory* of
+ ;; PY_SITE_PACKAGES_PATH/itk.
+ "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
"-DITK_WRAPPING=ON"
"-DITK_WRAP_PYTHON=ON"
"-DITK_DYNAMIC_LOADING=ON"
@@ -1267,7 +1281,10 @@ libraries designed for computer vision research and implementation.")
"/lib/python" python-version
"/site-packages")))
(string-append "-DPY_SITE_PACKAGES_PATH=" python-lib-path))
- "-DCMAKE_CXX_STANDARD=17")
+ ;; Python is not built with Py_LIMITED_API.
+ "-DITK_USE_PYTHON_LIMITED_API=OFF"
+ "-DCMAKE_CXX_STANDARD=17"
+ "-DBUILD_TESTING=OFF")
#:phases #~(modify-phases %standard-phases
(add-after 'unpack 'do-not-tune
@@ -1298,6 +1315,7 @@ libraries designed for computer vision research and implementation.")
fftw
fftwf
hdf5
+ libaec
libjpeg-turbo
libpng
libtiff
@@ -1308,7 +1326,7 @@ libraries designed for computer vision research and implementation.")
vxl-1
zlib))
(native-inputs
- (list castxml pkg-config swig which))
+ (list castxml git-minimal pkg-config swig-next which))
;; The 'CMake/ITKSetStandardCompilerFlags.cmake' file normally sets
;; '-mtune=native -march=corei7', suggesting there's something to be
diff --git a/gnu/packages/patches/insight-toolkit-fix-build.patch b/gnu/packages/patches/insight-toolkit-fix-build.patch
new file mode 100644
index 00000000000..a8a9ef3ce00
--- /dev/null
+++ b/gnu/packages/patches/insight-toolkit-fix-build.patch
@@ -0,0 +1,43 @@
+From 3e90110ece80124d38641b3a1d02a9127f56eb25 Mon Sep 17 00:00:00 2001
+From: David Allemang <david.allemang@kitware.com>
+Date: Mon, 9 Sep 2024 13:19:43 -0400
+Subject: [PATCH] COMP: Fix Python GPU Wrapping
+
+---
+ .../GPUImageFilterBase/wrapping/itkGPUCastImageFilter.wrap | 4 ++--
+ .../wrapping/itkGPUDiscreteGaussianImageFilter.wrap | 3 +++
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/Modules/Filtering/GPUImageFilterBase/wrapping/itkGPUCastImageFilter.wrap b/Modules/Filtering/GPUImageFilterBase/wrapping/itkGPUCastImageFilter.wrap
+index 7c1116884d7..c70af7d8446 100644
+--- a/Modules/Filtering/GPUImageFilterBase/wrapping/itkGPUCastImageFilter.wrap
++++ b/Modules/Filtering/GPUImageFilterBase/wrapping/itkGPUCastImageFilter.wrap
+@@ -23,7 +23,7 @@ foreach(from ${from_types})
+ endforeach()
+ itk_end_wrap_class()
+
+-itk_wrap_class("itk::CastImageFilter" POINTER)
++itk_wrap_class("itk::CastImageFilter" POINTER_WITH_SUPERCLASS)
+ foreach(d ${ITK_WRAP_IMAGE_DIMS})
+ # Add from == to pixel type first for preference
+ foreach(to ${to_types})
+@@ -183,7 +183,7 @@ foreach(d ${ITK_WRAP_IMAGE_DIMS})
+ endforeach()
+ itk_end_wrap_class()
+
+-itk_wrap_class("itk::GPUCastImageFilter" POINTER)
++itk_wrap_class("itk::GPUCastImageFilter" POINTER_WITH_SUPERCLASS)
+ foreach(d ${ITK_WRAP_IMAGE_DIMS})
+ # Add from == to pixel type first for preference
+ foreach(to ${to_types})
+diff --git a/Modules/Filtering/GPUSmoothing/wrapping/itkGPUDiscreteGaussianImageFilter.wrap b/Modules/Filtering/GPUSmoothing/wrapping/itkGPUDiscreteGaussianImageFilter.wrap
+index 2477c7876f0..0cfe9c2bd4a 100644
+--- a/Modules/Filtering/GPUSmoothing/wrapping/itkGPUDiscreteGaussianImageFilter.wrap
++++ b/Modules/Filtering/GPUSmoothing/wrapping/itkGPUDiscreteGaussianImageFilter.wrap
+@@ -1,3 +1,6 @@
++set(types "${WRAP_ITK_SCALAR}")
++itk_wrap_include("itkGPUImage.h")
++
+ itk_wrap_class("itk::DiscreteGaussianImageFilter" POINTER)
+ foreach(d ${ITK_WRAP_IMAGE_DIMS})
+ foreach(t ${types})