From d9831cd4399b0f81a8bd4eddab1a0c075bc7751f Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 23 Apr 2025 21:52:07 +0900 Subject: [PATCH] gnu: mia: Fix build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/mia-gcc11.patch: New file. * gnu/packages/patches/mia-openexr3.patch: New file. * gnu/local.mk (dist_patch_DATA): Register them. * gnu/packages/image-processing.scm (mia) [patches]: Apply them. [inputs]: Replace hdf5 with hdf5-1.10. Add lapack. Replace openxr-2 with openxr. Move doxygen to... [native-inputs]: ... here. Fixes: bug#47561 Reported-by: Ludovic Courtès Change-Id: I337df14370a589c7c15d15bcc69b948b43c2e61b --- gnu/local.mk | 2 + gnu/packages/image-processing.scm | 13 +-- gnu/packages/patches/mia-gcc11.patch | 106 ++++++++++++++++++++++++ gnu/packages/patches/mia-openexr3.patch | 27 ++++++ 4 files changed, 143 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/mia-gcc11.patch create mode 100644 gnu/packages/patches/mia-openexr3.patch diff --git a/gnu/local.mk b/gnu/local.mk index 6ae94d24c17..4aa84f8ef96 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1854,6 +1854,8 @@ dist_patch_DATA = \ %D%/packages/patches/mercurial-hg-extension-path.patch \ %D%/packages/patches/mhash-keygen-test-segfault.patch \ %D%/packages/patches/mia-fix-boost-headers.patch \ + %D%/packages/patches/mia-gcc11.patch \ + %D%/packages/patches/mia-openexr3.patch \ %D%/packages/patches/mia-vtk9.patch \ %D%/packages/patches/mia-vtk92.patch \ %D%/packages/patches/mia-vtk-version.patch \ diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 5a3e6f69efd..14bfdbfb20e 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -19,7 +19,7 @@ ;;; Copyright © 2021 Paul Garlick ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 Ivan Gankevich -;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2022, 2025 Maxim Cournoyer ;;; Copyright © 2022 Tomasz Jeneralczyk ;;; Copyright © 2022 Paul A. Patience ;;; Copyright © 2023 Cairn @@ -219,6 +219,8 @@ licences similar to the Modified BSD licence.")))) (base32 "0qpcd3n26q52dpyibm11f5l6cgscdr54p2jish39gc3p1f5h3ws1")) (patches (search-patches "mia-fix-boost-headers.patch" + "mia-gcc11.patch" + "mia-openexr3.patch" "mia-vtk9.patch" "mia-vtk92.patch" "mia-vtk-version.patch")))) @@ -230,14 +232,14 @@ licences similar to the Modified BSD licence.")))) (inputs (list boost dcmtk - doxygen eigen fftw fftwf gsl gts - hdf5 + hdf5-1.10 itpp + lapack libjpeg-turbo libpng libtiff @@ -246,11 +248,12 @@ licences similar to the Modified BSD licence.")))) maxflow niftilib nlopt - openexr-2 + openexr python-lxml vtk)) (native-inputs - (list pkg-config + (list doxygen + pkg-config python-wrapper)) (home-page "https://mia.sourceforge.net") (synopsis "Toolkit for gray scale medical image analysis") diff --git a/gnu/packages/patches/mia-gcc11.patch b/gnu/packages/patches/mia-gcc11.patch new file mode 100644 index 00000000000..4dfaeeab1ab --- /dev/null +++ b/gnu/packages/patches/mia-gcc11.patch @@ -0,0 +1,106 @@ +Author: Gert Wollny +Debian-Bug: https://bugs.debian.org/984233 +--- a/mia/2d/test_segframe.cc ++++ b/mia/2d/test_segframe.cc +@@ -27,8 +27,9 @@ + #include + #include + ++using std::vector; ++using std::string; + using namespace mia; +-using namespace std; + using namespace ::boost::unit_test; + namespace bfs = boost::filesystem; + +--- a/mia/2d/test_segmentation.cc ++++ b/mia/2d/test_segmentation.cc +@@ -31,8 +31,11 @@ + + + NS_MIA_USE +-using namespace std; + using namespace ::boost::unit_test; ++using std::vector; ++using std::string; ++using std::invalid_argument; ++using std::runtime_error; + + const char *testpoint_init = + "\n\n"; +@@ -403,7 +406,7 @@ + for ( string::const_iterator x = xmldoc.begin(), t = testdoc.begin(); + x != xmldoc.end() && t != testdoc.end(); ++x, ++t ) { + if (*x != *t) { +- cvfail() << "'" << *x << "' vs '" << *t << "'" << endl; ++ cvfail() << "'" << *x << "' vs '" << *t << "'" << std::endl; + } + } + } +--- a/mia/3d/filter/test_mask.cc ++++ b/mia/3d/filter/test_mask.cc +@@ -23,7 +23,6 @@ + #include + + NS_MIA_USE +-using namespace std; + using namespace ::boost::unit_test; + using namespace mask_3dimage_filter; + +--- a/mia/3d/test_ica.cc ++++ b/mia/3d/test_ica.cc +@@ -22,8 +22,9 @@ + #include + + using namespace mia; +-using namespace std; + using namespace boost::unit_test; ++using std::vector; ++using std::invalid_argument; + + const size_t slices = 5; + const size_t nx = 2; +--- a/mia/3d/test_imagedraw.cc ++++ b/mia/3d/test_imagedraw.cc +@@ -102,7 +102,7 @@ + + + struct compare_coordinate { +- bool operator () (const C3DBounds& lhs, const C3DBounds& rhs) ++ bool operator () (const C3DBounds& lhs, const C3DBounds& rhs) const + { + return (lhs.z < rhs.z) || + ((lhs.z == rhs.z) && ((lhs.y < rhs.y) || +--- a/mia/mesh/filter/test_deltrianglesbynormal.cc ++++ b/mia/mesh/filter/test_deltrianglesbynormal.cc +@@ -39,7 +39,7 @@ + + template + struct compare_vertex_ordered { +- bool operator () (const T3DVector& lhs, const T3DVector& rhs) ++ bool operator () (const T3DVector& lhs, const T3DVector& rhs) const + { + return (lhs.z < rhs.z) || + ((lhs.z == rhs.z) && ((lhs.y < rhs.y) || +--- a/mia/mesh/filter/test_selectbig.cc ++++ b/mia/mesh/filter/test_selectbig.cc +@@ -39,7 +39,7 @@ + + template + struct compare_vertex_ordered { +- bool operator () (const T3DVector& lhs, const T3DVector& rhs) ++ bool operator () (const T3DVector& lhs, const T3DVector& rhs) const + { + return (lhs.z < rhs.z) || + ((lhs.z == rhs.z) && ((lhs.y < rhs.y) || +--- a/mia/mesh/triangularMesh.cc ++++ b/mia/mesh/triangularMesh.cc +@@ -508,7 +508,7 @@ + }; + + struct compare_vertex { +- bool operator () (const VertexWithIndex& lhs, const VertexWithIndex& rhs) ++ bool operator () (const VertexWithIndex& lhs, const VertexWithIndex& rhs) const + { + return (lhs.v.z < rhs.v.z) || + ((lhs.v.z == rhs.v.z) && ((lhs.v.y < rhs.v.y) || diff --git a/gnu/packages/patches/mia-openexr3.patch b/gnu/packages/patches/mia-openexr3.patch new file mode 100644 index 00000000000..5205d733559 --- /dev/null +++ b/gnu/packages/patches/mia-openexr3.patch @@ -0,0 +1,27 @@ +Description: Fix compilation with openexr 3.x +Author: Mathieu Malaterre +Bug-Debian: https://bugs.debian.org/1017517 + +--- mia-2.4.7.orig/addons/openexr/2dimgexr.cc ++++ mia-2.4.7/addons/openexr/2dimgexr.cc +@@ -25,6 +25,9 @@ + #include + #include + #include ++#include ++#include ++#include + + #include + #include +--- mia-2.4.7.orig/addons/openexr/2dvfexr.cc ++++ mia-2.4.7/addons/openexr/2dvfexr.cc +@@ -25,6 +25,8 @@ + #include + #include + #include ++#include ++#include + + #include + #include