Subject: [bug#60640] Gnu: Add gdcm

From: Tor-björn Claesson <[email-masked]>
Date: Tue, 17 Jan 2023 21:21:17 +0200

Hi!

Ludovic Courtès <[email-masked]> writes:
> In general, we don’t install documentation as PDF/PS, unless there’s no
> other choice (preferred formats are Info, man pages, and HTML).
>
> Is there such an option?
>
> Furthermore, we shouldn’t depend on ‘texlive’, which is the big
> monolithic package:
>
>   https://guix.gnu.org/manual/devel/en/html_node/Using-TeX-and-LaTeX.html
>
Thanks for the feedback! Here is an updated patch.

-- 
Cheers,
Tor-björn Claesson
>From 4cab625e857c3a63dcfce10b7c03f06b173014a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <[email-masked]>
Date: Sat, 14 Jan 2023 19:03:39 +0200
Subject: [PATCH] gnu: gdcm: Add documentation.

---
 gnu/packages/bioinformatics.scm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index e60dffc21e..d534734cb2 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17853,8 +17853,16 @@ (define-public gdcm
                (base32
                 "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
     (build-system cmake-build-system)
+    (outputs '("out" "doc"))
     (arguments
      (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'build 'set-HOME
+                 ;; The build spams ‘Fontconfig error: No writable cache
+                 ;; directories’ in a seemingly endless loop otherwise.
+                 (lambda _
+                   (setenv "HOME" "/tmp"))))
       #:configure-flags
       #~(list "-DGDCM_BUILD_TESTING=true"
               (string-append "-DCMAKE_CTEST_ARGUMENTS=-E;"
@@ -17862,7 +17870,13 @@ (define-public gdcm
                              "|TestElement2"
                              "|TestSCUValidation"
                              "|TestEcho"
-                             "|TestFind'"))))
+                             "|TestFind'")
+              "-DGDCM_DOCUMENTATION:BOOL=ON"
+              "-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))
     (home-page "https://gdcm.sourceforge.net/wiki/index.php/Main_Page")
     (synopsis "Grassroots DICOM library")
     (description
-- 
2.38.1