all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#60640] Gnu: Add gdcm
@ 2023-01-07 19:40 Tor-björn Claesson
       [not found] ` <handler.60640.B.167314095112989.ack@debbugs.gnu.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-07 19:40 UTC (permalink / raw)
  To: 60640

gnu/packages/image-processing.scm | 72 +++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index 70c820e76b..271593b5f9 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -99,6 +99,7 @@ (define-module (gnu packages image-processing)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -1776,3 +1777,74 @@ (define-public charls
  to have them encoded to JPEG-LS, or JPEG-LS streams, which CharLS will decode
 to images.")
     (license license:bsd-3)))
+
+(define-public gdcm
+  (package
+    (name "gdcm")
+    (version "3.0.20")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/malaterre/GDCM/")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
+    (build-system cmake-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     (list #:tests? #f
+           #:phases #~(modify-phases %standard-phases
+                        (add-before 'configure 'set-LDFLAGS
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (setenv "LDFLAGS"
+                                    (string-append "-Wl,-rpath="
+                                                   #$output "/lib"))))
+                        (add-before 'build 'patch-gdcm-charls.h
+                          (lambda _
+                            (substitute* "../source/Utilities/gdcm_charls.h"
+                              (("# include <CharLS/charls.h>")
+                               "# include <charls/charls.h>")) #t)))
+           #:configure-flags #~(list "-DCMAKE_SKIP_RPATH:BOOL=YES"
+                                     "-DCMAKE_BUILD_TYPE:STRING=Release"
+                                     "-DCMAKE_C_FLAGS=-fvisibility=hidden"
+                                     "-DCMAKE_CXX_FLAGS=-fvisibility=hidden"
+                                     "-DGDCM_BUILD_SHARED_LIBS:BOOL=ON"
+                                     "-DGDCM_DOCUMENTATION:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_ZLIB:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_CHARLS:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_POPPLER:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_JSON:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_UUID:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON"
+                                     "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF"
+                                     "-DGCM_BUILD_TESTING:BOOL=OFF"
+                                     "-DGDCM_BUILD_APPLICATIONS:BOOL=OFF"
+                                     "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=OFF"
+                                     "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=OFF"
+                                     "-DGDCM_USE_SYSTEM_LJPEG:BOOL=OFF")))
+    (inputs (list openssl
+                  expat
+                  charls
+                  poppler
+                  libxml2
+                  json-c
+                  openjpeg
+                  `(,util-linux "lib")
+                  zlib))
+    (native-inputs (list git pkg-config doxygen graphviz))
+    (home-page "https://gdcm.sourceforge.net")
+    (synopsis
+     "C++ library dedicated to reading/parsing and writing DICOM medical files")
+    (description
+     "Grassroots DICOM (GDCM) is an implementation of the DICOM standard
+designed to be open source so that researchers may access clinical data
+directly.  GDCM includes a file format definition and a network communications
+protocol, both of which should be extended to provide a full set of tools for
+a researcher or small medical imaging vendor to interface with an existing
+medical database.")
+    (license license:bsd-3)))
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Acknowledgement (Gnu: Add gdcm)
       [not found] ` <handler.60640.B.167314095112989.ack@debbugs.gnu.org>
@ 2023-01-08  7:59   ` Tor-björn Claesson
  2023-01-08  8:04     ` Tor-björn Claesson
                       ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-08  7:59 UTC (permalink / raw)
  To: 60640


Hi!

This patch adds GDCM (a nice C++ library for DICOM, as in medical imaging),
with a few wharts:
1. I have not yet been able to build the bin output,
which consists of utilities for manipulating DICOM data. 

2. It does not build pdf-documentation, since that would require
texlive as a native input.

3. It does not perform tests.

4. It uses socketxx, ljpeg and papyrus3 from the gdcm sources. 

5. I'm not sure how to specify util-linux:bin as an input?

Cheers,
Tor-björn Claesson

help-debbugs@gnu.org (GNU bug Tracking System) writes:

> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  guix-patches@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 60640@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.


-- 
Mvh,
Tor-björn Claesson




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Acknowledgement (Gnu: Add gdcm)
  2023-01-08  7:59   ` [bug#60640] Acknowledgement (Gnu: Add gdcm) Tor-björn Claesson
@ 2023-01-08  8:04     ` Tor-björn Claesson
  2023-01-09  8:28       ` Tobias Geerinckx-Rice via Guix-patches via
  2023-01-10 14:40     ` Tobias Geerinckx-Rice via Guix-patches via
  2023-01-12 22:17     ` [bug#60640] Gnu: Add gdcm Ludovic Courtès
  2 siblings, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-08  8:04 UTC (permalink / raw)
  To: 60640

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson@gmail.com>:

>
> 5. I'm not sure how to specify util-linux:bin as an input?
>
I mean util-linux:lib...

[-- Attachment #2: Type: text/html, Size: 498 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Acknowledgement (Gnu: Add gdcm)
  2023-01-08  8:04     ` Tor-björn Claesson
@ 2023-01-09  8:28       ` Tobias Geerinckx-Rice via Guix-patches via
  2023-01-09 10:50         ` Tor-björn Claesson
  0 siblings, 1 reply; 30+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2023-01-09  8:28 UTC (permalink / raw)
  To: 60640, tclaesson

Hi Tor-björn,

On 8 January 2023 08:04:40 UTC, "Tor-björn Claesson" <tclaesson@gmail.com> wrote:
>Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson@gmail.com>:
>
>>
>> 5. I'm not sure how to specify util-linux:bin as an input?
>>
>I mean util-linux:lib...

Exactly like you did.  Are you seeing util-linux-related failures?


Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Acknowledgement (Gnu: Add gdcm)
  2023-01-09  8:28       ` Tobias Geerinckx-Rice via Guix-patches via
@ 2023-01-09 10:50         ` Tor-björn Claesson
  2023-01-10  7:01           ` ( via Guix-patches via
  0 siblings, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-09 10:50 UTC (permalink / raw)
  To: 60640

Hi Tobias,
thanks for taking the time to comment!

Tobias Geerinckx-Rice <me@tobias.gr> writes:
> Hi Tor-björn,
>
> On 8 January 2023 08:04:40 UTC, "Tor-björn Claesson" <tclaesson@gmail.com> wrote:
>>Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson@gmail.com>:
>>
>>>
>>> 5. I'm not sure how to specify util-linux:bin as an input?
>>>
>>I mean util-linux:lib...
>
> Exactly like you did.  Are you seeing util-linux-related failures?
>
>
> Kind regards,
>
> T G-R
>
> Sent on the go.  Excuse or enjoy my brevity.

No failures, only guix lint tells me "gdcm@3.0.20: label 'util-linux'
does not match package name 'util-linux:lib'", so I thought I might be
doing something wrong. If not then all fine on that front.

-- 
Cheers,
Tor-björn Claesson




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Acknowledgement (Gnu: Add gdcm)
  2023-01-09 10:50         ` Tor-björn Claesson
@ 2023-01-10  7:01           ` ( via Guix-patches via
  0 siblings, 0 replies; 30+ messages in thread
From: ( via Guix-patches via @ 2023-01-10  7:01 UTC (permalink / raw)
  To: Tor-björn Claesson, 60640

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

On Mon Jan 9, 2023 at 10:50 AM GMT, Tor-björn Claesson wrote:
> No failures, only guix lint tells me "gdcm@3.0.20: label 'util-linux'
> does not match package name 'util-linux:lib'", so I thought I might be
> doing something wrong. If not then all fine on that front.

Oh, that's fine.  I don't think there's a way to fix that at the moment.

    -- (

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Acknowledgement (Gnu: Add gdcm)
  2023-01-08  7:59   ` [bug#60640] Acknowledgement (Gnu: Add gdcm) Tor-björn Claesson
  2023-01-08  8:04     ` Tor-björn Claesson
@ 2023-01-10 14:40     ` Tobias Geerinckx-Rice via Guix-patches via
  2023-01-10 15:10       ` Tor-björn Claesson
  2023-01-12 22:17     ` [bug#60640] Gnu: Add gdcm Ludovic Courtès
  2 siblings, 1 reply; 30+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2023-01-10 14:40 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

Hi again,

Tor-björn Claesson 写道:
> This patch adds GDCM (a nice C++ library for DICOM, as in 
> medical imaging),
> with a few wharts:

I'll answer your questions later, but have started the build 
before I go out.

The build appears to be running something like

  until fc-something; do :; done

in an infinite loop, spamming the build log at best and slowing 
down the build at worst.

Did you notice that too?

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-07 19:40 [bug#60640] Gnu: Add gdcm Tor-björn Claesson
       [not found] ` <handler.60640.B.167314095112989.ack@debbugs.gnu.org>
@ 2023-01-10 14:52 ` Tobias Geerinckx-Rice via Guix-patches via
  2023-01-11  5:29   ` Tor-björn Claesson
  2024-02-19 22:41 ` bug#60640: " Sharlatan Hellseher
  2 siblings, 1 reply; 30+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2023-01-10 14:52 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640


[-- Attachment #1.1: Type: text/plain, Size: 5913 bytes --]

Tor-björn Claesson 写道:
> 1. I have not yet been able to build the bin output,
> which consists of utilities for manipulating DICOM data. 

OK, I'll take a look.

> 2. It does not build pdf-documentation, since that would require
> texlive as a native input.

OK.  You can add this sort of information as a comment by the 
relevant line, so it doesn't get lost (even during review :-).

> 3. It does not perform tests.

OK, I'll take a look.

If tests are disabled, the reason should always be noted in a 
comment.  Even if it's just ‘; no test suite’.

> 4. It uses socketxx, ljpeg and papyrus3 from the gdcm sources.

Here too I've punted on that by just adding a comment for now.

> +(define-public gdcm

It used to be common to unconditionally add packages to the end of 
files, but this needlessly increased the risk of merge conflicts.

Instead, just add them wherever they first fit alphabetically; 
here, I put it above ‘mia’.

> +    (version "3.0.20")

‘guix lint’ says this can be updated to 3.1.0 but I didn't try, as 
I'd rather it be tested by an actual user — i.e., you.

> + 
> "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
> +    (build-system cmake-build-system)
> +    (outputs '("out" "doc"))

/share/doc wasn't actually installed into "doc", but to "out", so 
I set the GDCM_INSTALL_DOC_DIR configure flag.

> +    (arguments
> +     (list #:tests? #f
> +           #:phases #~(modify-phases %standard-phases
> +                        (add-before 'configure 'set-LDFLAGS
> +                          (lambda* (#:key inputs outputs 
> #:allow-other-keys)
> +                            (setenv "LDFLAGS"
> +                                    (string-append 
> "-Wl,-rpath="
> +                                                   #$output 
> "/lib"))))
> +                        (add-before 'build 'patch-gdcm-charls.h
> +                          (lambda _
> +                            (substitute* 
> "../source/Utilities/gdcm_charls.h"
> +                              (("# include <CharLS/charls.h>")

Purely as a matter of taste I dropped the ‘# include ’ from both 
strings and escaped the ‘.’ in the regexp.

> +                               "# include <charls/charls.h>")) 
> #t)))

‘#t’ endings are also obsolete.  Just drop them entirely.  Phases 
can now safely return anything, including nothing or undefined.

I added the following phase to work around log spam, since I 
didn't find its source (nor did I look very hard) [edit: it was 
indeed graphviz, thanks].  By default, $HOME is not writable in 
the build environment.

  (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 
> "-DCMAKE_SKIP_RPATH:BOOL=YES"

I, opinionated, added newlines after #:phases and 
#:configure-flags.

Some people like the ‘extreme indentation’ you get by throwing 
away half of your screen width.  I find it leads to cramped code 
and noisy patches once the phases need to get actual work done or 
an even longer CMAKE_ flag comes along.

I also added some newlines and tried to group related flags.

> + 
> "-DCMAKE_C_FLAGS=-fvisibility=hidden"
> + 
> "-DCMAKE_CXX_FLAGS=-fvisibility=hidden"

Should these be explained in a very brief comment?

> + 
> "-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_ZLIB:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_CHARLS:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_POPPLER:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_JSON:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_UUID:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=ON"
> + 
> "-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON"

Thank you for building with system libraries!  Also remove the 
bundled copies when possible.  I did so in a (rather strict) 
source snippet.

> + 
> "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF"

I cannot get the man pages to build, either.  They need something 
called ‘xsl-ns’.  I've disabled GDCM_BUILD_DOCBOOK_MANPAGES for 
now.

> + 
> "-DGCM_BUILD_TESTING:BOOL=OFF"

Why is this set?  It's reported by CMake as having no effect, and 
a diff of the output confirms that.

> + 
> "-DGDCM_BUILD_APPLICATIONS:BOOL=OFF"

I added a ‘TODO’ comment above these bundled projects:

> + 
> "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=OFF"
> + 
> "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=OFF"
> + 
> "-DGDCM_USE_SYSTEM_LJPEG:BOOL=OFF")))
> +    (inputs (list openssl
> +                  expat
> +                  charls
> +                  poppler
> +                  libxml2
> +                  json-c
> +                  openjpeg
> +                  `(,util-linux "lib")
> +                  zlib))
> +    (native-inputs (list git pkg-config doxygen graphviz))

Sorted both.

> +    (home-page "https://gdcm.sourceforge.net")
> +    (synopsis
> +     "C++ library dedicated to reading/parsing and writing 
> DICOM medical files")
> +    (description
> +     "Grassroots DICOM (GDCM) is an implementation of the DICOM 
> standard
> +designed to be open source so that researchers may access 
> clinical data
> +directly.  GDCM includes a file format definition and a network 
> communications
> +protocol, both of which should be extended to provide a full 
> set of tools for
> +a researcher or small medical imaging vendor to interface with 
> an existing
> +medical database.")

I rewrote this just a smidge.  Mostly to remove the extra words, 
and use pretty @acronym{} mark-up.

> +    (license license:bsd-3)))

I still need to check this.

I've attached my WIP V2 to this message, with a commit message 
matching our conventions.

Kind regards,

T G-R


[-- Attachment #1.2: v2-0001-gnu-Add-gdcm.patch --]
[-- Type: text/x-patch, Size: 6360 bytes --]

From e2e2d9e220158aa2fd7dd0f4995c76d7d09ae79b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Sat, 7 Jan 2023 21:40:42 +0200
Subject: [PATCH v2] gnu: Add gdcm.

* gnu/packages/image-processing.scm (gdcm): New variable.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
---
 gnu/packages/image-processing.scm | 105 ++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)

diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index 70c820e76b..b95cb54964 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -99,6 +99,7 @@ (define-module (gnu packages image-processing)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -196,6 +197,110 @@ (define-public dcmtk
               "A union of the Apache 2.0 licence and various non-copyleft
 licences similar to the Modified BSD licence."))))
 
+(define-public gdcm
+  (package
+    (name "gdcm")
+    (version "3.0.20")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/malaterre/GDCM/")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)))
+              (snippet
+               '(begin
+                  (define (unbundle? file)
+                    (and (file-is-directory? file)
+                         ;; Not all directories represent a bundled project,
+                         ;; and some projects can't yet be unbundled.
+                         (not (member file '("." ".."
+                                             "doxygen"
+                                             "gdcmext"
+                                             "gdcmjpeg" ; TODO
+                                             "gdcmrle"
+                                             "socketxx"))))) ; TODO
+                  (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" "doc"))
+    (arguments
+     (list #:tests? #f                  ; XXX
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-before 'configure 'set-LDFLAGS
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (setenv "LDFLAGS"
+                           (string-append "-Wl,-rpath="
+                                          #$output "/lib"))))
+               (add-before 'build 'set-HOME
+                 ;; The build spams ‘Fontconfig error: No writable cache
+                 ;; directories’ in a seemingly endless loop otherwise.
+                 (lambda _
+                   (setenv "HOME" "/tmp")))
+               (add-before 'build 'patch-gdcm-charls.h
+                 (lambda _
+                   (substitute* "../source/Utilities/gdcm_charls.h"
+                     (("<CharLS/charls\\.h>")
+                      "<charls/charls.h>")))))
+           #:configure-flags
+           #~(list "-DCMAKE_SKIP_RPATH:BOOL=YES"
+                   "-DCMAKE_BUILD_TYPE:STRING=Release"
+                   "-DCMAKE_C_FLAGS=-fvisibility=hidden"
+                   "-DCMAKE_CXX_FLAGS=-fvisibility=hidden"
+                   "-DGDCM_BUILD_SHARED_LIBS:BOOL=ON"
+
+                   "-DGDCM_DOCUMENTATION:BOOL=ON"
+                   "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF" ; TODO? need texlive
+                   (string-append "-DGDCM_INSTALL_DOC_DIR="
+                                  #$output:doc "/share/doc/" #$name)
+                   "-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF" ; TODO: need ‘xsl-ns’
+
+                   "-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_ZLIB:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_CHARLS:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_POPPLER:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_JSON:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_UUID:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=ON"
+                   "-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON"
+
+                   "-DGDCM_BUILD_APPLICATIONS:BOOL=OFF"
+
+                   ;; TODO: Unbundle these if possible.
+                   "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=OFF"
+                   "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=OFF" ; socketxx in snippet
+                   "-DGDCM_USE_SYSTEM_LJPEG:BOOL=OFF"))) ; gdcmjpeg in snippet
+    (inputs (list charls
+                  expat
+                  json-c
+                  libxml2
+                  openjpeg
+                  openssl
+                  poppler
+                  `(,util-linux "lib")
+                  zlib))
+    (native-inputs (list doxygen git graphviz pkg-config))
+    (home-page "https://gdcm.sourceforge.net")
+    (synopsis "C++ library to read, parse, and write DICOM medical files")
+    (description
+     "@acronym{GDCM, Grassroots DICOM} implements the @acronym{DICOM, Digital
+Imaging and Communications in Medicine} standard to let researchers access
+clinical data directly.  GDCM includes a file format definition and a network
+communications protocol, both of which should be extended to provide a full set
+of tools for a researcher or small medical imaging vendor to interface with an
+existing medical database.")
+    (license license:bsd-3)))
+
 (define-public mia
   (package
     (name "mia")

base-commit: e0ed305f2f096e7048af1a117c72895433f4886a
-- 
2.38.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Acknowledgement (Gnu: Add gdcm)
  2023-01-10 14:40     ` Tobias Geerinckx-Rice via Guix-patches via
@ 2023-01-10 15:10       ` Tor-björn Claesson
  0 siblings, 0 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-10 15:10 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

Hi!


I'll answer your questions later, but have started the build
> before I go out.
>
> The build appears to be running something like
>
>   until fc-something; do :; done
>
> in an infinite loop, spamming the build log at best and slowing
> down the build at worst.
>
> Did you notice that too?
>

I get a lot of "Fontconfig error: No writable cache directories" which
appeared after adding graphviz as a native input for building
documentation. Is this what you are meaning?

Thanks=)
Tor-björn

[-- Attachment #2: Type: text/html, Size: 863 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-10 14:52 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2023-01-11  5:29   ` Tor-björn Claesson
  2023-01-12 11:21     ` Tor-björn Claesson
  0 siblings, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-11  5:29 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 60640


Hi!

Tobias Geerinckx-Rice <me@tobias.gr> writes:
>
>> 3. It does not perform tests.
>
> OK, I'll take a look.
>
> If tests are disabled, the reason should always be noted in a comment.
> Even if it's just ‘; no test suite’.
>

#:tests? #t makes the build fail with "make: *** No rule to make target
 'test'.  Stop."
 
GDCM has nightly regression tests
(https://open.cdash.org/index.php?project=GDCM), should we try to run
those when building? I have tried to find out how to do this but for now
with no success. Maybe it is obvious to more experienced people?

>> +(define-public gdcm
>
> It used to be common to unconditionally add packages to the end of
> files, but this needlessly increased the risk of merge conflicts.
>
> Instead, just add them wherever they first fit alphabetically; here, I
> put it above ‘mia’.
>

Ok, will do from now on!

>> +    (version "3.0.20")
>
> ‘guix lint’ says this can be updated to 3.1.0 but I didn't try, as I'd
> rather it be tested by an actual user — i.e., you.
>

I got that too, but the latest release in git is 3.0.20

>> + "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
>> +    (build-system cmake-build-system)
>> +    (outputs '("out" "doc"))
>
> /share/doc wasn't actually installed into "doc", but to "out", so I
> set the GDCM_INSTALL_DOC_DIR configure flag.
>
>> +    (arguments
>> +     (list #:tests? #f
>> +           #:phases #~(modify-phases %standard-phases
>> +                        (add-before 'configure 'set-LDFLAGS
>> +                          (lambda* (#:key inputs outputs
>> #:allow-other-keys)
>> +                            (setenv "LDFLAGS"
>> +                                    (string-append "-Wl,-rpath="
>> +                                                   #$output
>> "/lib"))))
>> +                        (add-before 'build 'patch-gdcm-charls.h
>> +                          (lambda _
>> +                            (substitute*
>> "../source/Utilities/gdcm_charls.h"
>> +                              (("# include <CharLS/charls.h>")

Ah, good catch!

>
> Purely as a matter of taste I dropped the ‘# include ’ from both
> strings and escaped the ‘.’ in the regexp.
>
>> +                               "# include <charls/charls.h>"))
>> #t)))
>
> ‘#t’ endings are also obsolete.  Just drop them entirely.  Phases can
> now safely return anything, including nothing or undefined.
>
> I added the following phase to work around log spam, since I didn't
> find its source (nor did I look very hard) [edit: it was indeed
> graphviz, thanks].  By default, $HOME is not writable in the build
> environment.
>
>  (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 "-DCMAKE_SKIP_RPATH:BOOL=YES"

Is this needed, btw? It came from gdcm:s packaging
instructions. Removing it causes no verify-runpath issues.

>
> I, opinionated, added newlines after #:phases and #:configure-flags.
>
> Some people like the ‘extreme indentation’ you get by throwing away
> half of your screen width.  I find it leads to cramped code and noisy
> patches once the phases need to get actual work done or an even longer
> CMAKE_ flag comes along.
>
> I also added some newlines and tried to group related flags.
>

Thanks, I didn't know that would make the line fit better on
screen. Much neater=)

>> + "-DCMAKE_C_FLAGS=-fvisibility=hidden"
>> + "-DCMAKE_CXX_FLAGS=-fvisibility=hidden"
>
> Should these be explained in a very brief comment?
>

They are from https://github.com/malaterre/GDCM/blob/master/PACKAGER,
the explanation is:
"This make sure that on UNIX, the API is actually identical at what is found on Windows."

>
> Thank you for building with system libraries!  Also remove the bundled
> copies when possible.  I did so in a (rather strict) source snippet.
>

Ok, neat=)

>> + "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF"
>
> I cannot get the man pages to build, either.  They need something
> called ‘xsl-ns’.  I've disabled GDCM_BUILD_DOCBOOK_MANPAGES for now.
>
>> + "-DGCM_BUILD_TESTING:BOOL=OFF"
>
> Why is this set?  It's reported by CMake as having no effect, and a
> diff of the output confirms that.
>

From the old wiki:

"This boolean is responsible for deciding whether or not to build/run the
nightly regression test of gdcm. Warning when turning this option on,
the size of the gdcm libraries will be bigger since some extra code are
compiled in for the testing framework (see gdcm::Testing, and the md5
lib)."

This seems to be incorrect then, maybe we can skip it.

>> +    (license license:bsd-3)))
>
> I still need to check this.
>

https://github.com/malaterre/GDCM/blob/master/Copyright.txt

I'm not able to apply your new patch, but that is probably a fault on my part.

Thanks a lot for sharing your time and knowledge, and for making this
patch neater! I find this a lot of fun, but have no experience
with scheme or packaging, so your explanations are very valuable to me.

Cheers
Tor-björn




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-11  5:29   ` Tor-björn Claesson
@ 2023-01-12 11:21     ` Tor-björn Claesson
  0 siblings, 0 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-12 11:21 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 6073 bytes --]

Hi again!

Your patch applies perfectly, the error was on my side.

Also, a gdcm package was added to the bioinformatics module 4 days ago=) It
packages an older version (2.8.9) but is much more concise than my attempt.
Would it be worthwhile to continue work on this package as perhaps gdcm-3.0
and move it to bioinformatics? I put it in image-processing since dcmtk was
already there.

Best regards

Den ons 11 jan. 2023 kl 08:08 skrev Tor-björn Claesson <tclaesson@gmail.com
>:

>
> Hi!
>
> Tobias Geerinckx-Rice <me@tobias.gr> writes:
> >
> >> 3. It does not perform tests.
> >
> > OK, I'll take a look.
> >
> > If tests are disabled, the reason should always be noted in a comment.
> > Even if it's just ‘; no test suite’.
> >
>
> #:tests? #t makes the build fail with "make: *** No rule to make target
>  'test'.  Stop."
>
> GDCM has nightly regression tests
> (https://open.cdash.org/index.php?project=GDCM), should we try to run
> those when building? I have tried to find out how to do this but for now
> with no success. Maybe it is obvious to more experienced people?
>
> >> +(define-public gdcm
> >
> > It used to be common to unconditionally add packages to the end of
> > files, but this needlessly increased the risk of merge conflicts.
> >
> > Instead, just add them wherever they first fit alphabetically; here, I
> > put it above ‘mia’.
> >
>
> Ok, will do from now on!
>
> >> +    (version "3.0.20")
> >
> > ‘guix lint’ says this can be updated to 3.1.0 but I didn't try, as I'd
> > rather it be tested by an actual user — i.e., you.
> >
>
> I got that too, but the latest release in git is 3.0.20
>
> >> + "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
> >> +    (build-system cmake-build-system)
> >> +    (outputs '("out" "doc"))
> >
> > /share/doc wasn't actually installed into "doc", but to "out", so I
> > set the GDCM_INSTALL_DOC_DIR configure flag.
> >
> >> +    (arguments
> >> +     (list #:tests? #f
> >> +           #:phases #~(modify-phases %standard-phases
> >> +                        (add-before 'configure 'set-LDFLAGS
> >> +                          (lambda* (#:key inputs outputs
> >> #:allow-other-keys)
> >> +                            (setenv "LDFLAGS"
> >> +                                    (string-append "-Wl,-rpath="
> >> +                                                   #$output
> >> "/lib"))))
> >> +                        (add-before 'build 'patch-gdcm-charls.h
> >> +                          (lambda _
> >> +                            (substitute*
> >> "../source/Utilities/gdcm_charls.h"
> >> +                              (("# include <CharLS/charls.h>")
>
> Ah, good catch!
>
> >
> > Purely as a matter of taste I dropped the ‘# include ’ from both
> > strings and escaped the ‘.’ in the regexp.
> >
> >> +                               "# include <charls/charls.h>"))
> >> #t)))
> >
> > ‘#t’ endings are also obsolete.  Just drop them entirely.  Phases can
> > now safely return anything, including nothing or undefined.
> >
> > I added the following phase to work around log spam, since I didn't
> > find its source (nor did I look very hard) [edit: it was indeed
> > graphviz, thanks].  By default, $HOME is not writable in the build
> > environment.
> >
> >  (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 "-DCMAKE_SKIP_RPATH:BOOL=YES"
>
> Is this needed, btw? It came from gdcm:s packaging
> instructions. Removing it causes no verify-runpath issues.
>
> >
> > I, opinionated, added newlines after #:phases and #:configure-flags.
> >
> > Some people like the ‘extreme indentation’ you get by throwing away
> > half of your screen width.  I find it leads to cramped code and noisy
> > patches once the phases need to get actual work done or an even longer
> > CMAKE_ flag comes along.
> >
> > I also added some newlines and tried to group related flags.
> >
>
> Thanks, I didn't know that would make the line fit better on
> screen. Much neater=)
>
> >> + "-DCMAKE_C_FLAGS=-fvisibility=hidden"
> >> + "-DCMAKE_CXX_FLAGS=-fvisibility=hidden"
> >
> > Should these be explained in a very brief comment?
> >
>
> They are from https://github.com/malaterre/GDCM/blob/master/PACKAGER,
> the explanation is:
> "This make sure that on UNIX, the API is actually identical at what is
> found on Windows."
>
> >
> > Thank you for building with system libraries!  Also remove the bundled
> > copies when possible.  I did so in a (rather strict) source snippet.
> >
>
> Ok, neat=)
>
> >> + "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF"
> >
> > I cannot get the man pages to build, either.  They need something
> > called ‘xsl-ns’.  I've disabled GDCM_BUILD_DOCBOOK_MANPAGES for now.
> >
> >> + "-DGCM_BUILD_TESTING:BOOL=OFF"
> >
> > Why is this set?  It's reported by CMake as having no effect, and a
> > diff of the output confirms that.
> >
>
> From the old wiki:
>
> "This boolean is responsible for deciding whether or not to build/run the
> nightly regression test of gdcm. Warning when turning this option on,
> the size of the gdcm libraries will be bigger since some extra code are
> compiled in for the testing framework (see gdcm::Testing, and the md5
> lib)."
>
> This seems to be incorrect then, maybe we can skip it.
>
> >> +    (license license:bsd-3)))
> >
> > I still need to check this.
> >
>
> https://github.com/malaterre/GDCM/blob/master/Copyright.txt
>
> I'm not able to apply your new patch, but that is probably a fault on my
> part.
>
> Thanks a lot for sharing your time and knowledge, and for making this
> patch neater! I find this a lot of fun, but have no experience
> with scheme or packaging, so your explanations are very valuable to me.
>
> Cheers
> Tor-björn
>

[-- Attachment #2: Type: text/html, Size: 8003 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-08  7:59   ` [bug#60640] Acknowledgement (Gnu: Add gdcm) Tor-björn Claesson
  2023-01-08  8:04     ` Tor-björn Claesson
  2023-01-10 14:40     ` Tobias Geerinckx-Rice via Guix-patches via
@ 2023-01-12 22:17     ` Ludovic Courtès
  2023-01-13 10:45       ` Tor-björn Claesson
  2 siblings, 1 reply; 30+ messages in thread
From: Ludovic Courtès @ 2023-01-12 22:17 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

Hi!

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> This patch adds GDCM (a nice C++ library for DICOM, as in medical imaging),
> with a few wharts:

Commit 15caeb745c5d77b69905d38d43b4d09742bc71b6, pushed a couple of days
ago, adds GDCM (although the patch was much older).

Could you check if anything’s missing compared to your version?

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-12 22:17     ` [bug#60640] Gnu: Add gdcm Ludovic Courtès
@ 2023-01-13 10:45       ` Tor-björn Claesson
  2023-01-13 23:50         ` Ludovic Courtès
  0 siblings, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-13 10:45 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

Hi!

Ludovic Courtès <ludo@gnu.org> writes:

>
> Commit 15caeb745c5d77b69905d38d43b4d09742bc71b6, pushed a couple of days
> ago, adds GDCM (although the patch was much older).
>
> Could you check if anything’s missing compared to your version?
>
> Thanks,
> Ludo’.

Yes, that was great!
The pushed patch is version 2.8, whereas my patch is version 3.0. I was
able to port my application to 2.8 in 3 minutes, so I don't notice big
functional differences=)

Also it does tests, which I did not get to work yet, but it does not
specify system libraries.

Cheers,
Tor-björn Claesson




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-13 10:45       ` Tor-björn Claesson
@ 2023-01-13 23:50         ` Ludovic Courtès
  2023-01-14  8:19           ` Tor-björn Claesson
                             ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Ludovic Courtès @ 2023-01-13 23:50 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

Hi,

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> The pushed patch is version 2.8, whereas my patch is version 3.0. I was
> able to port my application to 2.8 in 3 minutes, so I don't notice big
> functional differences=)
>
> Also it does tests, which I did not get to work yet, but it does not
> specify system libraries.

Could you send (in this issue) one patch that updates to 3.0, and
another one to use system libraries?

That’d be perfect!

Thanks in advance,
Ludo’.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-13 23:50         ` Ludovic Courtès
@ 2023-01-14  8:19           ` Tor-björn Claesson
  2023-01-14  9:30           ` Tor-björn Claesson
                             ` (3 subsequent siblings)
  4 siblings, 0 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-14  8:19 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]

Hi,
Den lör 14 jan. 2023 kl 01:50 skrev Ludovic Courtès <ludo@gnu.org>:

>
> Could you send (in this issue) one patch that updates to 3.0, and
> another one to use system libraries?
>

I have a working update to 3.0.20. Except for other possible differences,
GDCM changes the name of the include directory between versions; I have to
e.g. #include <gdcm-2.8/gdcmImage.h> vs. <gdcm-3.0/gdcmImage.h>. How should
we deal with this? Would it make sense to leave a gdcm-2.8 package, to
cater for users of the older version, or should we expect people to follow
along?

Best regards!
Tor-björn

[-- Attachment #2: Type: text/html, Size: 943 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-13 23:50         ` Ludovic Courtès
  2023-01-14  8:19           ` Tor-björn Claesson
@ 2023-01-14  9:30           ` Tor-björn Claesson
  2023-01-17 14:36             ` Ludovic Courtès
  2023-01-14 17:06           ` Tor-björn Claesson
                             ` (2 subsequent siblings)
  4 siblings, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-14  9:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 56 bytes --]


Here is the first patch, which updates gdcm to 3.0.20.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-gdcm-Update-to-3.0.20.patch --]
[-- Type: text/x-patch, Size: 1914 bytes --]

From f4cd5077a762f25a9fa271329a798f324e4db685 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Sat, 14 Jan 2023 11:23:58 +0200
Subject: [PATCH] gnu: gdcm: Update to 3.0.20.

---
 gnu/packages/bioinformatics.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 6dd2e8250c..5b886526ad 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17842,7 +17842,7 @@ (define-public wfmash
 (define-public gdcm
   (package
     (name "gdcm")
-    (version "2.8.9")
+    (version "3.0.20")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -17852,7 +17852,7 @@ (define-public gdcm
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1j8mjnxcwn2xvzhf25lv4dbawxbgc4im1crh8081li7i4mbwswaj"))))
+                "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
     (build-system cmake-build-system)
     (arguments
      (list
@@ -17864,7 +17864,7 @@ (define-public gdcm
                              "|TestSCUValidation"
                              "|TestEcho"
                              "|TestFind'"))))
-    (home-page "http://gdcm.sourceforge.net/wiki/index.php/Main_Page")
+    (home-page "https://gdcm.sourceforge.net/wiki/index.php/Main_Page")
     (synopsis "Grassroots DICOM library")
     (description
      "Grassroots DICOM (GDCM) is an implementation of the DICOM standard
@@ -17873,7 +17873,7 @@ (define-public gdcm
 protocol, both of which should be extended to provide a full set of tools for
 a researcher or small medical imaging vendor to interface with an existing
 medical database.")
-    (license license:bsd-2)))
+    (license license:bsd-3)))
 
 (define-public wiggletools
   (package
-- 
2.38.1


[-- Attachment #3: Type: text/plain, Size: 78 bytes --]


Documentation is also missing, will add this as well.
Cheers,
Tor-björn

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-13 23:50         ` Ludovic Courtès
  2023-01-14  8:19           ` Tor-björn Claesson
  2023-01-14  9:30           ` Tor-björn Claesson
@ 2023-01-14 17:06           ` Tor-björn Claesson
  2023-01-17 14:38             ` Ludovic Courtès
  2023-01-14 19:34           ` Tor-björn Claesson
  2023-01-14 21:58           ` Tor-björn Claesson
  4 siblings, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-14 17:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 62 bytes --]

And here is a second patch adding documentation to gdcm 3.0.20

[-- Attachment #2: 0001-gnu-gdcm-Add-documentation.patch --]
[-- Type: text/x-patch, Size: 2382 bytes --]

From 9ec1adbf72f3b122a484fe449e3b950fcee4b221 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Sat, 14 Jan 2023 19:03:39 +0200
Subject: [PATCH] gnu: gdcm: Add documentation.

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

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 5b886526ad..aa54ec7ff7 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -93,6 +93,7 @@ (define-module (gnu packages bioinformatics)
   #:use-module (gnu packages gawk)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gd)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages golang)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages graph)
@@ -17854,8 +17855,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;"
@@ -17863,7 +17872,13 @@ (define-public gdcm
                              "|TestElement2"
                              "|TestSCUValidation"
                              "|TestEcho"
-                             "|TestFind'"))))
+                             "|TestFind'")
+              "-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’
+    (native-inputs (list doxygen ghostscript graphviz texlive))
     (home-page "https://gdcm.sourceforge.net/wiki/index.php/Main_Page")
     (synopsis "Grassroots DICOM library")
     (description
-- 
2.38.1


[-- Attachment #3: Type: text/plain, Size: 32 bytes --]


Cheers,
Tor-björn Claesson

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-13 23:50         ` Ludovic Courtès
                             ` (2 preceding siblings ...)
  2023-01-14 17:06           ` Tor-björn Claesson
@ 2023-01-14 19:34           ` Tor-björn Claesson
  2023-01-14 21:58           ` Tor-björn Claesson
  4 siblings, 0 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-14 19:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

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


[-- Attachment #2: 0001-gnu-gdcm-Add-output-bin.patch --]
[-- Type: text/x-patch, Size: 2880 bytes --]

From 1b680bf73c6a62efd40d608c25e9b7815f03d786 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
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


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-13 23:50         ` Ludovic Courtès
                             ` (3 preceding siblings ...)
  2023-01-14 19:34           ` Tor-björn Claesson
@ 2023-01-14 21:58           ` Tor-björn Claesson
  4 siblings, 0 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-14 21:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

And here is the last patch, which uses system packages where possible.
All  nice things in these patches are thanks to the help of Tobias,
any screwups are mine.

Thanks!
Tor-björn

[-- Attachment #2: 0001-gnu-gdcm-Use-system-packages-where-possible.patch --]
[-- Type: text/x-patch, Size: 3795 bytes --]

From 77a7609eb727c53028846d0bf54204cdf9f58f9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Sat, 14 Jan 2023 23:56:43 +0200
Subject: [PATCH] gnu: gdcm: Use system packages where possible.

---
 gnu/packages/bioinformatics.scm | 47 +++++++++++++++++++++++++++++++--
 1 file changed, 45 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index e45d33ec2b..41709fd9ed 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17853,7 +17853,29 @@ (define-public gdcm
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
+                "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)))
+              (snippet
+               '(begin
+                  (define (unbundle? file)
+                    (member file '("dicom3tools"
+                                   "gdcmexpat"
+                                   "gdcmutfcpp"
+                                   "gdcmuuid"
+                                   "gdcmzlib"
+                                   "getopt"
+                                   "KWStyle"
+                                   "pvrg"
+                                   "Release"
+                                   "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
@@ -17882,6 +17904,20 @@ (define-public gdcm
                              "|gdcmscu-find-dicomserver"
                              "|TestEcho"
                              "|TestFind'")
+              ;; Libraries
+              "-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON"
+              "-DGDCM_USE_SYSTEM_JSON: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_LJPEG:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=OFF"
+              "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=OFF"
               ;; Documentation
               "-DGDCM_DOCUMENTATION:BOOL=ON"
               "-DGDCM_PDF_DOCUMENTATION:BOOL=ON"
@@ -17890,7 +17926,14 @@ (define-public gdcm
               "-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF" ;; TODO: need ‘xsl-ns’
               ;; Utilities
               "-DGDCM_BUILD_APPLICATIONS:BOOL=ON")))
-    (native-inputs (list doxygen ghostscript graphviz texlive))
+    (inputs (list expat
+                  json-c
+                  libxml2
+                  openssl
+                  poppler
+                  `(,util-linux "lib")
+                  zlib))
+    (native-inputs (list doxygen ghostscript graphviz pkg-config texlive))
     (home-page "https://gdcm.sourceforge.net/wiki/index.php/Main_Page")
     (synopsis "Grassroots DICOM library")
     (description
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-14  9:30           ` Tor-björn Claesson
@ 2023-01-17 14:36             ` Ludovic Courtès
  0 siblings, 0 replies; 30+ messages in thread
From: Ludovic Courtès @ 2023-01-17 14:36 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

Hi!

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> From f4cd5077a762f25a9fa271329a798f324e4db685 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
> Date: Sat, 14 Jan 2023 11:23:58 +0200
> Subject: [PATCH] gnu: gdcm: Update to 3.0.20.
>
> ---
>  gnu/packages/bioinformatics.scm | 8 ++++----

Applied with a commit log following our conventions.

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-14 17:06           ` Tor-björn Claesson
@ 2023-01-17 14:38             ` Ludovic Courtès
  2023-01-17 19:21               ` Tor-björn Claesson
  2023-01-20 11:30               ` Tor-björn Claesson
  0 siblings, 2 replies; 30+ messages in thread
From: Ludovic Courtès @ 2023-01-17 14:38 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> From 9ec1adbf72f3b122a484fe449e3b950fcee4b221 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
> Date: Sat, 14 Jan 2023 19:03:39 +0200
> Subject: [PATCH] gnu: gdcm: Add documentation.
>
> ---
>  gnu/packages/bioinformatics.scm | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)

[...]

> +              "-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’
> +    (native-inputs (list doxygen ghostscript graphviz texlive))

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

Could you send an updated patch?

Ludo’.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-17 14:38             ` Ludovic Courtès
@ 2023-01-17 19:21               ` Tor-björn Claesson
  2023-01-25 22:22                 ` Ludovic Courtès
  2023-01-20 11:30               ` Tor-björn Claesson
  1 sibling, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-17 19:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

Hi!

Ludovic Courtès <ludo@gnu.org> 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

[-- Attachment #2: 0001-gnu-gdcm-Add-documentation.patch --]
[-- Type: text/x-patch, Size: 2032 bytes --]

From 4cab625e857c3a63dcfce10b7c03f06b173014a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
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


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-17 14:38             ` Ludovic Courtès
  2023-01-17 19:21               ` Tor-björn Claesson
@ 2023-01-20 11:30               ` Tor-björn Claesson
  2023-01-20 12:44                 ` Tor-björn Claesson
  1 sibling, 1 reply; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-20 11:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

Hi,

Den tis 17 jan. 2023 kl 16:38 skrev Ludovic Courtès <ludo@gnu.org>:

>
> 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?
>
The new version of the patch builds HTML documentation, but not man-pages
(because of a xsl-requirement and including libxslt as a native input
causes the build to fail.)

I wrote the previous answer in a rush, and failed to properly address this
question. For this I apologize, it was not meant to be disrespectful.

Tor-björn

[-- Attachment #2: Type: text/html, Size: 983 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-20 11:30               ` Tor-björn Claesson
@ 2023-01-20 12:44                 ` Tor-björn Claesson
  2023-01-25 22:01                   ` Ludovic Courtès
  2023-01-25 22:49                   ` Ludovic Courtès
  0 siblings, 2 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-20 12:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640


[-- Attachment #1.1: Type: text/plain, Size: 1023 bytes --]

Also, I can't build gdcm from the main guix repo although it builds
perfectly fine in my local checkout. The cause is three failing tests.
Attached is a patch to ignore them.

I'm really sorry about this.
Is there something else I could have done to catch this before submitting?

Tor-björn Claesson

Den fre 20 jan. 2023 kl 13:30 skrev Tor-björn Claesson <tclaesson@gmail.com
>:

> Hi,
>
> Den tis 17 jan. 2023 kl 16:38 skrev Ludovic Courtès <ludo@gnu.org>:
>
>>
>> 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?
>>
> The new version of the patch builds HTML documentation, but not man-pages
> (because of a xsl-requirement and including libxslt as a native input
> causes the build to fail.)
>
> I wrote the previous answer in a rush, and failed to properly address this
> question. For this I apologize, it was not meant to be disrespectful.
>
> Tor-björn
>

[-- Attachment #1.2: Type: text/html, Size: 1751 bytes --]

[-- Attachment #2: 0001-gnu-gdcm-Ignore-3-failing-tests.patch --]
[-- Type: text/x-patch, Size: 1009 bytes --]

From e1e8d18c4db9de4c8f46354ba3fc912f23ebe9d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Fri, 20 Jan 2023 14:38:39 +0200
Subject: [PATCH] gnu: gdcm: Ignore 3 failing tests.

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

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index e60dffc21e..c23f731687 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17861,6 +17861,9 @@ (define-public gdcm
                              "'TestFileMetaInformation"
                              "|TestElement2"
                              "|TestSCUValidation"
+                             "|TestWriter"
+                             "|TestAnonymizer4"
+                             "|TestPrinter1"
                              "|TestEcho"
                              "|TestFind'"))))
     (home-page "https://gdcm.sourceforge.net/wiki/index.php/Main_Page")
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-20 12:44                 ` Tor-björn Claesson
@ 2023-01-25 22:01                   ` Ludovic Courtès
  2023-01-31 21:42                     ` Tor-björn Claesson
  2023-01-25 22:49                   ` Ludovic Courtès
  1 sibling, 1 reply; 30+ messages in thread
From: Ludovic Courtès @ 2023-01-25 22:01 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

Hi,

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> From e1e8d18c4db9de4c8f46354ba3fc912f23ebe9d0 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
> Date: Fri, 20 Jan 2023 14:38:39 +0200
> Subject: [PATCH] gnu: gdcm: Ignore 3 failing tests.
>
> ---
>  gnu/packages/bioinformatics.scm | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
> index e60dffc21e..c23f731687 100644
> --- a/gnu/packages/bioinformatics.scm
> +++ b/gnu/packages/bioinformatics.scm
> @@ -17861,6 +17861,9 @@ (define-public gdcm
>                               "'TestFileMetaInformation"
>                               "|TestElement2"
>                               "|TestSCUValidation"
> +                             "|TestWriter"
> +                             "|TestAnonymizer4"
> +                             "|TestPrinter1"
>                               "|TestEcho"

Applied, thanks!

It would be nice if you could investigate the test failures: they might
reveal that something’s wrong with our packaging.

Ludo’.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-17 19:21               ` Tor-björn Claesson
@ 2023-01-25 22:22                 ` Ludovic Courtès
  0 siblings, 0 replies; 30+ messages in thread
From: Ludovic Courtès @ 2023-01-25 22:22 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> From 4cab625e857c3a63dcfce10b7c03f06b173014a9 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
> 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(-)

I added a commit log that follows our conventions and applied it,
thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-20 12:44                 ` Tor-björn Claesson
  2023-01-25 22:01                   ` Ludovic Courtès
@ 2023-01-25 22:49                   ` Ludovic Courtès
  2023-01-27 15:06                     ` Tor-björn Claesson
  1 sibling, 1 reply; 30+ messages in thread
From: Ludovic Courtès @ 2023-01-25 22:49 UTC (permalink / raw)
  To: Tor-björn Claesson; +Cc: 60640

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> From e1e8d18c4db9de4c8f46354ba3fc912f23ebe9d0 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
> Date: Fri, 20 Jan 2023 14:38:39 +0200
> Subject: [PATCH] gnu: gdcm: Ignore 3 failing tests.

Actually I’m seeing more test failures in a -c24 build:

--8<---------------cut here---------------start------------->8---
195/217 Test #195: TestStrictScanner1 .....................***Failed    0.01 sec
No such directory: /tmp/guix-build-gdcm-3.0.20.drv-0/build/Testing/Temporary/TestWriter

        Start 196: TestStrictScanner2_1
196/217 Test #196: TestStrictScanner2_1 ...................***Failed    0.01 sec
No such directory: /tmp/guix-build-gdcm-3.0.20.drv-0/build/Testing/Temporary/TestWriter

        Start 197: TestStrictScanner2
197/217 Test #197: TestStrictScanner2 .....................***Failed    0.02 sec
No such directory: /tmp/guix-build-gdcm-3.0.20.drv-0/build/Testing/Temporary/TestWriter

        Start 198: TestStrictScanner2_2
198/217 Test #198: TestStrictScanner2_2 ...................***Failed    0.02 sec
No such directory: /tmp/guix-build-gdcm-3.0.20.drv-0/build/Testing/Temporary/TestWriter

[…]

98% tests passed, 4 tests failed out of 217

Total Test time (real) = 596.45 sec

The following tests FAILED:
	195 - TestStrictScanner1 (Failed)
	196 - TestStrictScanner2_1 (Failed)
	197 - TestStrictScanner2 (Failed)
	198 - TestStrictScanner2_2 (Failed)
Errors while running CTest
--8<---------------cut here---------------end--------------->8---

Passing #:parallel-tests? #f doesn’t help.

Could you take a look?

TIA,
Ludo’.




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-25 22:49                   ` Ludovic Courtès
@ 2023-01-27 15:06                     ` Tor-björn Claesson
  0 siblings, 0 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-27 15:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

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?

-- 
Mvh,
Tor-björn Claesson


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-gdcm-Ignore-remaining-failing-tests.patch --]
[-- Type: text/x-patch, Size: 1517 bytes --]

From 7aaae11c7efc38222bfbf503e52cdb15bfccc33c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Fri, 27 Jan 2023 13:26:02 +0200
Subject: [PATCH 1/3] gnu: gdcm: Ignore remaining failing tests.
gnu: gdcm: Ignore remaining failing tests.
---
 gnu/packages/bioinformatics.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 8c75607a65..0fa7bb3746 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -18097,12 +18097,15 @@ (define-public gdcm
       #:configure-flags
       #~(list "-DGDCM_BUILD_TESTING=true"
               (string-append "-DCMAKE_CTEST_ARGUMENTS=-E;"
-                             "'TestFileMetaInformation"
-                             "|TestElement2"
-                             "|TestSCUValidation"
-                             "|TestWriter"
+                             "'TestWriter"
+                             "|TestStrictScanner1"
+			     "|TestStrictScanner2"
+			     "|TestStrictScanner2_1"
+			     "|TestStrictScanner2_2"
                              "|TestAnonymizer4"
                              "|TestPrinter1"
+                             ;; Disable tests that download data from the internet.
+                             "|TestSCUValidation"
                              "|TestEcho"
                              "|TestFind'")
               "-DGDCM_DOCUMENTATION:BOOL=ON"
-- 
2.39.1


[-- Attachment #3: 0002-gnu-gdcm-Add-bin-output.patch --]
[-- Type: text/x-patch, Size: 2374 bytes --]

From 2bc5c46ca2fee406a7108e5d43ef66af2d392889 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson@gmail.com>
Date: Fri, 27 Jan 2023 14:43:32 +0200
Subject: [PATCH 2/3] gnu: gdcm: Add bin output.
gnu: gdcm: Add bin output.
---
 gnu/packages/bioinformatics.scm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 0fa7bb3746..9a3c0f7d42 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -18084,7 +18084,7 @@ (define-public gdcm
                (base32
                 "1rf0p7dnakjry0fa6ax1h762bn0l5n6ibfdxn077mjvwgpqan51l"))))
     (build-system cmake-build-system)
-    (outputs '("out" "doc"))
+    (outputs '("out" "bin" "doc"))
     (arguments
      (list
       #:phases
@@ -18093,7 +18093,14 @@ (define-public gdcm
             ;; The build spams ‘Fontconfig error: No writable cache
             ;; directories’ in a seemingly endless loop otherwise.
             (lambda _
-              (setenv "HOME" "/tmp"))))
+              (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;"
@@ -18105,9 +18112,13 @@ (define-public gdcm
                              "|TestAnonymizer4"
                              "|TestPrinter1"
                              ;; Disable tests that download data from the internet.
+                             "|gdcmscu-echo-dicomserver"
+                             "|gdcmscu-store-dicomserver"
+                             "|gdcmscu-find-dicomserver"
                              "|TestSCUValidation"
                              "|TestEcho"
                              "|TestFind'")
+              "-DGDCM_BUILD_APPLICATIONS:BOOL=ON"
               "-DGDCM_DOCUMENTATION:BOOL=ON"
               "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF"
               (string-append "-DGDCM_INSTALL_DOC_DIR="
-- 
2.39.1


[-- Attachment #4: 0003-gnu-gdcm-Use-more-system-libraries.patch --]
[-- Type: text/x-patch, Size: 3560 bytes --]

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


^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#60640] Gnu: Add gdcm
  2023-01-25 22:01                   ` Ludovic Courtès
@ 2023-01-31 21:42                     ` Tor-björn Claesson
  0 siblings, 0 replies; 30+ messages in thread
From: Tor-björn Claesson @ 2023-01-31 21:42 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60640

Hi again!

Ludovic Courtès <ludo@gnu.org> writes:
> It would be nice if you could investigate the test failures: they might
> reveal that something’s wrong with our packaging.

Maybe the following is of any help, I was confused by the TestWriter
etc. passing in my local checkout, but not when I later tried to build
gdcm from the real guix repository.

This can be reproduced as follows:

1. Check out and build the original commit to add gdcm 2.8.9 (15caeb745c)
2. Check out and build the "upgrade to 3.0.20" commit (2bdbd962e3)

Now the tests suddenly pass. What does the build of 2.8.9 leave behind?
I'm still really confused by this!

-- 
Mvh,
Tor-björn Claesson




^ permalink raw reply	[flat|nested] 30+ messages in thread

* bug#60640: Gnu: Add gdcm
  2023-01-07 19:40 [bug#60640] Gnu: Add gdcm Tor-björn Claesson
       [not found] ` <handler.60640.B.167314095112989.ack@debbugs.gnu.org>
  2023-01-10 14:52 ` Tobias Geerinckx-Rice via Guix-patches via
@ 2024-02-19 22:41 ` Sharlatan Hellseher
  2 siblings, 0 replies; 30+ messages in thread
From: Sharlatan Hellseher @ 2024-02-19 22:41 UTC (permalink / raw)
  To: 60640-done

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]


Hi,

GDCM was added back in 2022 by the commit 15caeb745c5d77b69905d38d43b4d09742bc71b6.

--8<---------------cut here---------------start------------->8---
15caeb745c5d77b69905d38d43b4d09742bc71b6
Author:     Antero Mejr <antero@mailbox.org>
AuthorDate: Wed Jun 15 15:39:53 2022 +0000
Commit:     Ludovic Courtès <ludo@gnu.org>
CommitDate: Sun Jan 8 16:11:45 2023 +0100

gnu: Add gdcm.

* gnu/packages/bioinformatics.scm (gdcm): New variable.
--8<---------------cut here---------------end--------------->8---

And it's on the 3.0.20.

Closing as already availale.

Thanks,
Oleg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-02-19 22:43 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-07 19:40 [bug#60640] Gnu: Add gdcm Tor-björn Claesson
     [not found] ` <handler.60640.B.167314095112989.ack@debbugs.gnu.org>
2023-01-08  7:59   ` [bug#60640] Acknowledgement (Gnu: Add gdcm) Tor-björn Claesson
2023-01-08  8:04     ` Tor-björn Claesson
2023-01-09  8:28       ` Tobias Geerinckx-Rice via Guix-patches via
2023-01-09 10:50         ` Tor-björn Claesson
2023-01-10  7:01           ` ( via Guix-patches via
2023-01-10 14:40     ` Tobias Geerinckx-Rice via Guix-patches via
2023-01-10 15:10       ` Tor-björn Claesson
2023-01-12 22:17     ` [bug#60640] Gnu: Add gdcm Ludovic Courtès
2023-01-13 10:45       ` Tor-björn Claesson
2023-01-13 23:50         ` Ludovic Courtès
2023-01-14  8:19           ` Tor-björn Claesson
2023-01-14  9:30           ` Tor-björn Claesson
2023-01-17 14:36             ` Ludovic Courtès
2023-01-14 17:06           ` Tor-björn Claesson
2023-01-17 14:38             ` Ludovic Courtès
2023-01-17 19:21               ` Tor-björn Claesson
2023-01-25 22:22                 ` Ludovic Courtès
2023-01-20 11:30               ` Tor-björn Claesson
2023-01-20 12:44                 ` Tor-björn Claesson
2023-01-25 22:01                   ` Ludovic Courtès
2023-01-31 21:42                     ` Tor-björn Claesson
2023-01-25 22:49                   ` Ludovic Courtès
2023-01-27 15:06                     ` Tor-björn Claesson
2023-01-14 19:34           ` Tor-björn Claesson
2023-01-14 21:58           ` Tor-björn Claesson
2023-01-10 14:52 ` Tobias Geerinckx-Rice via Guix-patches via
2023-01-11  5:29   ` Tor-björn Claesson
2023-01-12 11:21     ` Tor-björn Claesson
2024-02-19 22:41 ` bug#60640: " Sharlatan Hellseher

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.