diff mbox series

[bug#60640] Gnu: Add gdcm

Message ID 878rhoxb6c.fsf@gmail.com
State New
Headers show
Series [bug#60640] Gnu: Add gdcm | expand

Commit Message

Tor-björn Claesson Jan. 27, 2023, 3:06 p.m. UTC
Hi!

Ludovic Courtès <ludo@gnu.org> writes:
>
> The following tests FAILED:
> 	195 - TestStrictScanner1 (Failed)
> 	196 - TestStrictScanner2_1 (Failed)
> 	197 - TestStrictScanner2 (Failed)
> 	198 - TestStrictScanner2_2 (Failed)
> Errors while running CTest
>
> Passing #:parallel-tests? #f doesn’t help.
>
> Could you take a look?

The TestStrictScanner tests fail because they expect TestWriter to have
run, but we disabled it.

TestWriter, TestAnonymizer4, and TestPrinter1 are also reported as
failing in the GDCM ctest dashboard
(https://open.cdash.org/index.php?project=GDCM).
It is strange that they passed previously in my local checkout
(they fail now, some change in the toolchain?)
I will try to look into this.

For now, here is a patch to ignore the remaining failures, giving us
an installable package, and also updated patches to add a bin output
and use more system libraries.

Investigating the remaining failing tests and using more system
libraries feels like a fairly big, if fun, task possibly involving
work on GDCM as well as this package. Should we close this bug report
if we have a working package when the attached patches are applied?
diff mbox series

Patch

From 467a7b614ccafa2de51a8e56a6ecf384fb6fa07b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Fri, 27 Jan 2023 17:03:36 +0200
Subject: [PATCH 3/3] gnu: gdcm: Use more system libraries.
gnu: gdcm: Use more system libraries.
---
 gnu/packages/bioinformatics.scm | 48 ++++++++++++++++++++++++++++++---
 1 file changed, 45 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 9a3c0f7d42..77b3388f2e 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -18082,7 +18082,28 @@  (define-public gdcm
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1rf0p7dnakjry0fa6ax1h762bn0l5n6ibfdxn077mjvwgpqan51l"))))
+                "1rf0p7dnakjry0fa6ax1h762bn0l5n6ibfdxn077mjvwgpqan51l"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)))
+              (snippet
+               '(begin
+                  (define (unbundle? file)
+                    (member file '("dicom3tools"
+                                   "gdcmexpat"
+                                   "gdcmutfcpp"
+                                   "gdcmuuid"
+                                   "gdcmzlib"
+                                   "getopt"
+                                   "KWStyle"
+                                   "pvrg"
+                                   "Release"
+                                   "VTK")))
+                  (with-directory-excursion "Utilities"
+                    (for-each (lambda (utility)
+                                (delete-file-recursively utility)
+                                (substitute* "CMakeLists.txt"
+                                  (((string-append ".*/" utility "/.*")) "")))
+                              (scandir "." unbundle?)))))))
     (build-system cmake-build-system)
     (outputs '("out" "bin" "doc"))
     (arguments
@@ -18123,8 +18144,29 @@  (define-public gdcm
               "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF"
               (string-append "-DGDCM_INSTALL_DOC_DIR="
                              #$output:doc "/share/doc/" #$name)
-              "-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"))) ; TODO: need ‘xsl-ns’
-    (native-inputs (list doxygen graphviz))
+              "-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"  ; TODO: need ‘xsl-ns’
+              ;; Libraries
+              "-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON"
+              "-DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON"
+              "-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON"
+              "-DGDCM_USE_SYSTEM_POPPLER:BOOL=ON"
+              "-DGDCM_USE_SYSTEM_UUID:BOOL=ON"
+              "-DGDCM_USE_SYSTEM_ZLIB:BOOL=ON"
+              ;; TODO: Unbundle these if possible.
+              "-DGDCM_USE_SYSTEM_CHARLS:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_JSON:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_LJPEG:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=OFF")))
+    (inputs (list
+             expat
+             libxml2
+             openssl
+             poppler
+             `(,util-linux "lib")
+             zlib))
+    (native-inputs (list doxygen graphviz pkg-config))
     (home-page "https://gdcm.sourceforge.net/wiki/index.php/Main_Page")
     (synopsis "Grassroots DICOM library")
     (description
-- 
2.39.1