Subject: Re: bug#60640: Gnu: Add gdcm

From: Tor-björn Claesson <[email-masked]>
Date: Sat, 14 Jan 2023 21:34:44 +0200

And here is a patch which adds a "bin" output containing various
utility-programs. Sorry for some slight spamming, but things suddenly started
working=)
With this I think the package is functionally complete and I will move
on to using system libraries.

Cheers,
Tor-björn Claesson

>From 1b680bf73c6a62efd40d608c25e9b7815f03d786 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <[email-masked]>
Date: Sat, 14 Jan 2023 21:17:23 +0200
Subject: [PATCH] gnu: gdcm: Add output "bin"

---
 gnu/packages/bioinformatics.scm | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index aa54ec7ff7..e45d33ec2b 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17855,29 +17855,41 @@ (define-public gdcm
                (base32
                 "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
     (build-system cmake-build-system)
-    (outputs '("out" "doc"))
+    (outputs '("out" "bin" "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"))))
+            ;; The build spams ‘Fontconfig error: No writable cache
+            ;; directories’ in a seemingly endless loop otherwise.
+            (lambda _
+              (setenv "HOME" "/tmp")))
+          (add-after 'install 'move-files
+            ;; Move utilities to bin output.
+            (lambda _
+              (mkdir-p (string-append #$output:bin "/bin"))
+              (rename-file
+               (string-append #$output "/bin")
+               (string-append #$output:bin "/bin")))))
       #:configure-flags
       #~(list "-DGDCM_BUILD_TESTING=true"
               (string-append "-DCMAKE_CTEST_ARGUMENTS=-E;"
                              "'TestFileMetaInformation"
                              "|TestElement2"
                              "|TestSCUValidation"
+                             "|gdcmscu-echo-dicomserver"
+                             "|gdcmscu-find-dicomserver"
                              "|TestEcho"
                              "|TestFind'")
+              ;; Documentation
               "-DGDCM_DOCUMENTATION:BOOL=ON"
               "-DGDCM_PDF_DOCUMENTATION:BOOL=ON"
               (string-append "-DGDCM_INSTALL_DOC_DIR="
                              #$output:doc "/share/doc/" #$name)
-              "-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF"))) ; TODO: need ‘xsl-ns’
+              "-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF" ;; TODO: need ‘xsl-ns’
+              ;; Utilities
+              "-DGDCM_BUILD_APPLICATIONS:BOOL=ON")))
     (native-inputs (list doxygen ghostscript graphviz texlive))
     (home-page "https://gdcm.sourceforge.net/wiki/index.php/Main_Page")
     (synopsis "Grassroots DICOM library")
-- 
2.38.1