GNU bug report logs - #60640
Gnu: Add gdcm

Previous Next

Package: guix-patches;

Reported by: Tor-björn Claesson <tclaesson <at> gmail.com>

Date: Sun, 8 Jan 2023 01:23:03 UTC

Severity: normal

Tags: patch

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60640 in the body.
You can then email your comments to 60640 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sun, 08 Jan 2023 01:23:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tor-björn Claesson <tclaesson <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 08 Jan 2023 01:23:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: Gnu: Add gdcm
Date: Sat, 07 Jan 2023 21:40:42 +0200
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





Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sun, 08 Jan 2023 08:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Acknowledgement (Gnu: Add gdcm)
Date: Sun, 08 Jan 2023 09:59:40 +0200
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 <at> 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 <at> gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 60640 <at> debbugs.gnu.org.
>
> Please do not send mail to help-debbugs <at> gnu.org unless you wish
> to report a problem with the Bug-tracking system.


-- 
Mvh,
Tor-björn Claesson




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sun, 08 Jan 2023 08:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Acknowledgement (Gnu: Add gdcm)
Date: Sun, 8 Jan 2023 10:04:40 +0200
[Message part 1 (text/plain, inline)]
Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson <at> gmail.com>:

>
> 5. I'm not sure how to specify util-linux:bin as an input?
>
I mean util-linux:lib...
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Mon, 09 Jan 2023 08:29:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: guix-patches <at> gnu.org,
 Tor-björn Claesson <tclaesson <at> gmail.com>,
 60640 <at> debbugs.gnu.org
Subject: Re: [bug#60640] Acknowledgement (Gnu: Add gdcm)
Date: Mon, 09 Jan 2023 08:28:29 +0000
Hi Tor-björn,

On 8 January 2023 08:04:40 UTC, "Tor-björn Claesson" <tclaesson <at> gmail.com> wrote:
>Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson <at> 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.




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Mon, 09 Jan 2023 08:29:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Mon, 09 Jan 2023 10:54:02 GMT) Full text and rfc822 format available.

Message #20 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: 60640 <at> debbugs.gnu.org
Subject: Re: [bug#60640] Acknowledgement (Gnu: Add gdcm)
Date: Mon, 09 Jan 2023 12:50:32 +0200
Hi Tobias,
thanks for taking the time to comment!

Tobias Geerinckx-Rice <me <at> tobias.gr> writes:
> Hi Tor-björn,
>
> On 8 January 2023 08:04:40 UTC, "Tor-björn Claesson" <tclaesson <at> gmail.com> wrote:
>>Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson <at> 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 <at> 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




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 10 Jan 2023 07:02:02 GMT) Full text and rfc822 format available.

Message #23 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>,
 <60640 <at> debbugs.gnu.org>
Subject: Re: [bug#60640] Acknowledgement (Gnu: Add gdcm)
Date: Tue, 10 Jan 2023 07:01:42 +0000
[Message part 1 (text/plain, inline)]
On Mon Jan 9, 2023 at 10:50 AM GMT, Tor-björn Claesson wrote:
> No failures, only guix lint tells me "gdcm <at> 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.

    -- (
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 10 Jan 2023 14:43:01 GMT) Full text and rfc822 format available.

Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#60640] Acknowledgement (Gnu: Add gdcm)
Date: Tue, 10 Jan 2023 15:40:50 +0100
[Message part 1 (text/plain, inline)]
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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 10 Jan 2023 14:43:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 10 Jan 2023 15:11:01 GMT) Full text and rfc822 format available.

Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 60640 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#60640] Acknowledgement (Gnu: Add gdcm)
Date: Tue, 10 Jan 2023 17:10:14 +0200
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 10 Jan 2023 15:11:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 10 Jan 2023 20:27:01 GMT) Full text and rfc822 format available.

Message #38 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#60640] Gnu: Add gdcm
Date: Tue, 10 Jan 2023 15:52:49 +0100
[Message part 1 (text/plain, inline)]
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

[v2-0001-gnu-Add-gdcm.patch (text/x-patch, inline)]
From e2e2d9e220158aa2fd7dd0f4995c76d7d09ae79b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson <at> 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 <at> 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

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 10 Jan 2023 20:27:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Wed, 11 Jan 2023 06:09:02 GMT) Full text and rfc822 format available.

Message #44 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 60640 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#60640] Gnu: Add gdcm
Date: Wed, 11 Jan 2023 07:29:10 +0200
Hi!

Tobias Geerinckx-Rice <me <at> 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




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Wed, 11 Jan 2023 06:09:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Bruno Victal <mirai <at> makinata.eu> to control <at> debbugs.gnu.org. (Wed, 11 Jan 2023 17:38:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Thu, 12 Jan 2023 11:22:02 GMT) Full text and rfc822 format available.

Message #52 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 60640 <at> debbugs.gnu.org, guix-patches <at> gnu.org
Subject: Re: [bug#60640] Gnu: Add gdcm
Date: Thu, 12 Jan 2023 13:21:34 +0200
[Message part 1 (text/plain, inline)]
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 <at> gmail.com
>:

>
> Hi!
>
> Tobias Geerinckx-Rice <me <at> 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
>
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Thu, 12 Jan 2023 11:23:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Thu, 12 Jan 2023 22:18:01 GMT) Full text and rfc822 format available.

Message #58 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Thu, 12 Jan 2023 23:17:46 +0100
Hi!

Tor-björn Claesson <tclaesson <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Fri, 13 Jan 2023 10:49:02 GMT) Full text and rfc822 format available.

Message #61 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Fri, 13 Jan 2023 12:45:10 +0200
Hi!

Ludovic Courtès <ludo <at> 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




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Fri, 13 Jan 2023 23:51:02 GMT) Full text and rfc822 format available.

Message #64 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Sat, 14 Jan 2023 00:50:39 +0100
Hi,

Tor-björn Claesson <tclaesson <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sat, 14 Jan 2023 08:21:02 GMT) Full text and rfc822 format available.

Message #67 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Sat, 14 Jan 2023 10:19:51 +0200
[Message part 1 (text/plain, inline)]
Hi,
Den lör 14 jan. 2023 kl 01:50 skrev Ludovic Courtès <ludo <at> 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
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sat, 14 Jan 2023 09:33:01 GMT) Full text and rfc822 format available.

Message #70 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Sat, 14 Jan 2023 11:30:29 +0200
[Message part 1 (text/plain, inline)]
Here is the first patch, which updates gdcm to 3.0.20.
[0001-gnu-gdcm-Update-to-3.0.20.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Documentation is also missing, will add this as well.
Cheers,
Tor-björn

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sat, 14 Jan 2023 17:08:02 GMT) Full text and rfc822 format available.

Message #73 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Sat, 14 Jan 2023 19:06:29 +0200
[Message part 1 (text/plain, inline)]
And here is a second patch adding documentation to gdcm 3.0.20
[0001-gnu-gdcm-Add-documentation.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
Cheers,
Tor-björn Claesson

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sat, 14 Jan 2023 19:39:01 GMT) Full text and rfc822 format available.

Message #76 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Sat, 14 Jan 2023 21:34:44 +0200
[Message part 1 (text/plain, inline)]
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

[0001-gnu-gdcm-Add-output-bin.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Sat, 14 Jan 2023 22:01:02 GMT) Full text and rfc822 format available.

Message #79 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Sat, 14 Jan 2023 23:58:43 +0200
[Message part 1 (text/plain, inline)]
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
[0001-gnu-gdcm-Use-system-packages-where-possible.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 17 Jan 2023 14:37:02 GMT) Full text and rfc822 format available.

Message #82 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Tue, 17 Jan 2023 15:36:03 +0100
Hi!

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

> From f4cd5077a762f25a9fa271329a798f324e4db685 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 17 Jan 2023 14:39:01 GMT) Full text and rfc822 format available.

Message #85 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Tue, 17 Jan 2023 15:38:03 +0100
Tor-björn Claesson <tclaesson <at> gmail.com> skribis:

> From 9ec1adbf72f3b122a484fe449e3b950fcee4b221 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 17 Jan 2023 19:23:02 GMT) Full text and rfc822 format available.

Message #88 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Tue, 17 Jan 2023 21:21:17 +0200
[Message part 1 (text/plain, inline)]
Hi!

Ludovic Courtès <ludo <at> 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
[0001-gnu-gdcm-Add-documentation.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Fri, 20 Jan 2023 11:32:02 GMT) Full text and rfc822 format available.

Message #91 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Fri, 20 Jan 2023 13:30:48 +0200
[Message part 1 (text/plain, inline)]
Hi,

Den tis 17 jan. 2023 kl 16:38 skrev Ludovic Courtès <ludo <at> 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
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Fri, 20 Jan 2023 12:45:02 GMT) Full text and rfc822 format available.

Message #94 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Fri, 20 Jan 2023 14:44:02 +0200
[Message part 1 (text/plain, inline)]
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 <at> gmail.com
>:

> Hi,
>
> Den tis 17 jan. 2023 kl 16:38 skrev Ludovic Courtès <ludo <at> 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
>
[Message part 2 (text/html, inline)]
[0001-gnu-gdcm-Ignore-3-failing-tests.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Wed, 25 Jan 2023 22:02:02 GMT) Full text and rfc822 format available.

Message #97 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Wed, 25 Jan 2023 23:01:38 +0100
Hi,

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

> From e1e8d18c4db9de4c8f46354ba3fc912f23ebe9d0 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Wed, 25 Jan 2023 22:24:01 GMT) Full text and rfc822 format available.

Message #100 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Wed, 25 Jan 2023 23:22:58 +0100
Tor-björn Claesson <tclaesson <at> gmail.com> skribis:

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




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Wed, 25 Jan 2023 22:50:01 GMT) Full text and rfc822 format available.

Message #103 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tor-björn Claesson <tclaesson <at> gmail.com>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Wed, 25 Jan 2023 23:49:40 +0100
Tor-björn Claesson <tclaesson <at> gmail.com> skribis:

> From e1e8d18c4db9de4c8f46354ba3fc912f23ebe9d0 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Tor-bj=C3=B6rn=20Claesson?= <tclaesson <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Fri, 27 Jan 2023 15:15:01 GMT) Full text and rfc822 format available.

Message #106 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Fri, 27 Jan 2023 17:06:37 +0200
[Message part 1 (text/plain, inline)]
Hi!

Ludovic Courtès <ludo <at> 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

[0001-gnu-gdcm-Ignore-remaining-failing-tests.patch (text/x-patch, attachment)]
[0002-gnu-gdcm-Add-bin-output.patch (text/x-patch, attachment)]
[0003-gnu-gdcm-Use-more-system-libraries.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#60640; Package guix-patches. (Tue, 31 Jan 2023 22:22:01 GMT) Full text and rfc822 format available.

Message #109 received at 60640 <at> debbugs.gnu.org (full text, mbox):

From: Tor-björn Claesson <tclaesson <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60640 <at> debbugs.gnu.org
Subject: Re: bug#60640: Gnu: Add gdcm
Date: Tue, 31 Jan 2023 23:42:29 +0200
Hi again!

Ludovic Courtès <ludo <at> 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




Reply sent to Sharlatan Hellseher <sharlatanus <at> gmail.com>:
You have taken responsibility. (Mon, 19 Feb 2024 22:44:01 GMT) Full text and rfc822 format available.

Notification sent to Tor-björn Claesson <tclaesson <at> gmail.com>:
bug acknowledged by developer. (Mon, 19 Feb 2024 22:44:02 GMT) Full text and rfc822 format available.

Message #114 received at 60640-done <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 60640-done <at> debbugs.gnu.org
Subject: Gnu: Add gdcm
Date: Mon, 19 Feb 2024 22:41:54 +0000
[Message part 1 (text/plain, inline)]
Hi,

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

--8<---------------cut here---------------start------------->8---
15caeb745c5d77b69905d38d43b4d09742bc71b6
Author:     Antero Mejr <antero <at> mailbox.org>
AuthorDate: Wed Jun 15 15:39:53 2022 +0000
Commit:     Ludovic Courtès <ludo <at> 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
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 19 Mar 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.