From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uDjPOjLKvWPkCgEAbAwnHQ (envelope-from ) for ; Tue, 10 Jan 2023 21:27:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OGppOjLKvWNRkwAAauVa8A (envelope-from ) for ; Tue, 10 Jan 2023 21:27:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7284929AB8 for ; Tue, 10 Jan 2023 21:27:30 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFLD6-0007zo-Q3; Tue, 10 Jan 2023 15:27:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFLD4-0007zM-MR for guix-patches@gnu.org; Tue, 10 Jan 2023 15:27:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFLD4-0003hs-E4 for guix-patches@gnu.org; Tue, 10 Jan 2023 15:27:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFLD4-0002Up-9b for guix-patches@gnu.org; Tue, 10 Jan 2023 15:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60640] Gnu: Add gdcm Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Jan 2023 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60640 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?UTF-8?Q?Tor-bj=C3=B6rn?= Claesson Cc: 60640@debbugs.gnu.org X-Debbugs-Original-Cc: 60640@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by 60640-submit@debbugs.gnu.org id=B60640.16733823919541 (code B ref 60640); Tue, 10 Jan 2023 20:27:02 +0000 Received: (at 60640) by debbugs.gnu.org; 10 Jan 2023 20:26:31 +0000 Received: from localhost ([127.0.0.1]:41213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFLCZ-0002To-0l for submit@debbugs.gnu.org; Tue, 10 Jan 2023 15:26:31 -0500 Received: from tobias.gr ([80.241.217.52]:52550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFLCS-0002Ta-N6 for 60640@debbugs.gnu.org; Tue, 10 Jan 2023 15:26:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=rhtGKdVtCXDUJ ruUh07HdRwx16+SzRH6DBMIfI+BCaQ=; h=in-reply-to:date:subject:cc:to: from:references; d=tobias.gr; b=YsP5BxBxHfCwnePXxgCMd0XPCAESitDqBb5NLh SAs0xXsym3aAMgCNUBFnwAsvhS5Y3zM5kjjyUtMsYhdWaeM/dJWIOLTYc6Jut3dM7LgQd5 xxrNI6TpJL56/efzWgsA94fG10eiuB3RrvvL5yzhZk3QN0E3NJlf4UaMXzB3Y2KPZTR+V/ f29PHmB89eIw9ZA5fbbtk6ER3Rg/C30fPb3ukTHWwq+Z9Q7wmjwaQFK1/nec15HhoUK1Q7 NVyE0C0W09+lKWaWUIeoSUgzhSm53Kedi6o60XSqqaSrl8KB4W5ycu78YFD7Un8QjgpIcY OXAOS6knlNN68is8ko3ZifxA== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 27214356 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 10 Jan 2023 20:26:18 +0000 (UTC) References: <877cxyp1wf.fsf@gmail.com> Date: Tue, 10 Jan 2023 15:52:49 +0100 In-reply-to: <877cxyp1wf.fsf@gmail.com> BIMI-Selector: v=BIMI1; s=default; Message-ID: <87y1qaxhh7.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=YsP5BxBx; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673382450; a=rsa-sha256; cv=none; b=RKEEG7igGkJ1xUXGjSWbhhe7lgF7Dt+3ab1J8x3eTm+z4IwO6B+iX5YhmEoK6WOKLKk9YB BoBO91Syhb0s9yOtAdKRNDNBTi49Vl4n2tG3WWHRwqjgpuiOiJjPpQJNUB3WDrpEXUGkRp U3WbQymWxbVVfCBuWQABshkHIwdBQifuGf2kKWK/pjqkCi18fBKE32ATF0aQHuaCGJdfXN SdI9miK4TjSflWNqJJyd3C6Fv3OZXTwdjXuqzzeqlDqdbB1If5NSpECZkWY0Mw5mGfYBCF 4aYC+FRVaF2CR3zupdPLsbYXuFAZn7BOB7gSevMar+Ft/W0Mn7tz9DgighrA9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673382450; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=rhtGKdVtCXDUJruUh07HdRwx16+SzRH6DBMIfI+BCaQ=; b=QvtMnkz5ljWSq+Qwm1qxIXvPRfH8o+NTQXeowAhs1ybl1+iPDDX7SLX1WVJuziEPRIA+/E /1OtVS2zhvVUh2nL9c51ybIiAsRhW/XAneRHQlfwzZG+7lN+UpmKykFRBVpAJbN+r2mORc 0uYcpAmuFT2mNe5scnrJ494TLTG/aCXG87kaGMqrcEpNqyXPvPW9TpRJbJGUvwQ3NwKaS7 d5Pi+Xpr60OoUyWJaQwcI2idtyAjagY6e8m4991EwfFMqJXC7Q5Wp5OTZx+Igl+dhjOO5i /Ww/cwbKXB3OgnhmnrSXHUKhoEbpmiwsfAbX5fhaTQ46jvJBIwbQZ7xLdLdeig== X-Migadu-Queue-Id: 7284929AB8 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=YsP5BxBx; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Spam-Score: -5.98 X-Spam-Score: -5.98 X-TUID: yA5OhlFoepWn --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Tor-bj=C3=B6rn Claesson =E5=86=99=E9=81=93=EF=BC=9A > 1. I have not yet been able to build the bin output, > which consists of utilities for manipulating DICOM data.=20 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=20 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=20 comment. Even if it's just =E2=80=98; no test suite=E2=80=99. > 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=20 files, but this needlessly increased the risk of merge conflicts. Instead, just add them wherever they first fit alphabetically;=20 here, I put it above =E2=80=98mia=E2=80=99. > + (version "3.0.20") =E2=80=98guix lint=E2=80=99 says this can be updated to 3.1.0 but I didn't = try, as=20 I'd rather it be tested by an actual user =E2=80=94 i.e., you. > +=20 > "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i")))) > + (build-system cmake-build-system) > + (outputs '("out" "doc")) /share/doc wasn't actually installed into "doc", but to "out", so=20 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=20 > #:allow-other-keys) > + (setenv "LDFLAGS" > + (string-append=20 > "-Wl,-rpath=3D" > + #$output=20 > "/lib")))) > + (add-before 'build 'patch-gdcm-charls.h > + (lambda _ > + (substitute*=20 > "../source/Utilities/gdcm_charls.h" > + (("# include ") Purely as a matter of taste I dropped the =E2=80=98# include =E2=80=99 from= both=20 strings and escaped the =E2=80=98.=E2=80=99 in the regexp. > + "# include "))=20 > #t))) =E2=80=98#t=E2=80=99 endings are also obsolete. Just drop them entirely. = Phases=20 can now safely return anything, including nothing or undefined. I added the following phase to work around log spam, since I=20 didn't find its source (nor did I look very hard) [edit: it was=20 indeed graphviz, thanks]. By default, $HOME is not writable in=20 the build environment. (add-before 'build 'set-HOME ;; The build spams =E2=80=98Fontconfig error: No writable cache ;; directories=E2=80=99 in a seemingly endless loop otherwise. (lambda _ (setenv "HOME" "/tmp"))) > + #:configure-flags #~(list=20 > "-DCMAKE_SKIP_RPATH:BOOL=3DYES" I, opinionated, added newlines after #:phases and=20 #:configure-flags. Some people like the =E2=80=98extreme indentation=E2=80=99 you get by throw= ing=20 away half of your screen width. I find it leads to cramped code=20 and noisy patches once the phases need to get actual work done or=20 an even longer CMAKE_ flag comes along. I also added some newlines and tried to group related flags. > +=20 > "-DCMAKE_C_FLAGS=3D-fvisibility=3Dhidden" > +=20 > "-DCMAKE_CXX_FLAGS=3D-fvisibility=3Dhidden" Should these be explained in a very brief comment? > +=20 > "-DGDCM_USE_SYSTEM_EXPAT:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_ZLIB:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_CHARLS:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_POPPLER:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_LIBXML2:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_JSON:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_UUID:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=3DON" > +=20 > "-DGDCM_USE_SYSTEM_OPENSSL:BOOL=3DON" Thank you for building with system libraries! Also remove the=20 bundled copies when possible. I did so in a (rather strict)=20 source snippet. > +=20 > "-DGDCM_PDF_DOCUMENTATION:BOOL=3DOFF" I cannot get the man pages to build, either. They need something=20 called =E2=80=98xsl-ns=E2=80=99. I've disabled GDCM_BUILD_DOCBOOK_MANPAGES= for=20 now. > +=20 > "-DGCM_BUILD_TESTING:BOOL=3DOFF" Why is this set? It's reported by CMake as having no effect, and=20 a diff of the output confirms that. > +=20 > "-DGDCM_BUILD_APPLICATIONS:BOOL=3DOFF" I added a =E2=80=98TODO=E2=80=99 comment above these bundled projects: > +=20 > "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=3DOFF" > +=20 > "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=3DOFF" > +=20 > "-DGDCM_USE_SYSTEM_LJPEG:BOOL=3DOFF"))) > + (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=20 > DICOM medical files") > + (description > + "Grassroots DICOM (GDCM) is an implementation of the DICOM=20 > standard > +designed to be open source so that researchers may access=20 > clinical data > +directly. GDCM includes a file format definition and a network=20 > communications > +protocol, both of which should be extended to provide a full=20 > set of tools for > +a researcher or small medical imaging vendor to interface with=20 > an existing > +medical database.") I rewrote this just a smidge. Mostly to remove the extra words,=20 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=20 matching our conventions. Kind regards, T G-R --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=v2-0001-gnu-Add-gdcm.patch Content-Transfer-Encoding: quoted-printable From=20e2e2d9e220158aa2fd7dd0f4995c76d7d09ae79b Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Tor-bj=3DC3=3DB6rn=3D20Claesson?=3D 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 =2D-- gnu/packages/image-processing.scm | 105 ++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-process= ing.scm index 70c820e76b..b95cb54964 100644 =2D-- 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.")))) =20 +(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 projec= t, + ;; 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=3D" + #$output "/lib")))) + (add-before 'build 'set-HOME + ;; The build spams =E2=80=98Fontconfig error: No writable= cache + ;; directories=E2=80=99 in a seemingly endless loop other= wise. + (lambda _ + (setenv "HOME" "/tmp"))) + (add-before 'build 'patch-gdcm-charls.h + (lambda _ + (substitute* "../source/Utilities/gdcm_charls.h" + (("") + ""))))) + #:configure-flags + #~(list "-DCMAKE_SKIP_RPATH:BOOL=3DYES" + "-DCMAKE_BUILD_TYPE:STRING=3DRelease" + "-DCMAKE_C_FLAGS=3D-fvisibility=3Dhidden" + "-DCMAKE_CXX_FLAGS=3D-fvisibility=3Dhidden" + "-DGDCM_BUILD_SHARED_LIBS:BOOL=3DON" + + "-DGDCM_DOCUMENTATION:BOOL=3DON" + "-DGDCM_PDF_DOCUMENTATION:BOOL=3DOFF" ; TODO? need texl= ive + (string-append "-DGDCM_INSTALL_DOC_DIR=3D" + #$output:doc "/share/doc/" #$name) + "-DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=3DOFF" ; TODO: need= =E2=80=98xsl-ns=E2=80=99 + + "-DGDCM_USE_SYSTEM_EXPAT:BOOL=3DON" + "-DGDCM_USE_SYSTEM_ZLIB:BOOL=3DON" + "-DGDCM_USE_SYSTEM_CHARLS:BOOL=3DON" + "-DGDCM_USE_SYSTEM_POPPLER:BOOL=3DON" + "-DGDCM_USE_SYSTEM_LIBXML2:BOOL=3DON" + "-DGDCM_USE_SYSTEM_JSON:BOOL=3DON" + "-DGDCM_USE_SYSTEM_UUID:BOOL=3DON" + "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=3DON" + "-DGDCM_USE_SYSTEM_OPENSSL:BOOL=3DON" + + "-DGDCM_BUILD_APPLICATIONS:BOOL=3DOFF" + + ;; TODO: Unbundle these if possible. + "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=3DOFF" + "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=3DOFF" ; socketxx in s= nippet + "-DGDCM_USE_SYSTEM_LJPEG:BOOL=3DOFF"))) ; gdcmjpeg in s= nippet + (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, Digi= tal +Imaging and Communications in Medicine} standard to let researchers access +clinical data directly. GDCM includes a file format definition and a netw= ork +communications protocol, both of which should be extended to provide a ful= l set +of tools for a researcher or small medical imaging vendor to interface wit= h an +existing medical database.") + (license license:bsd-3))) + (define-public mia (package (name "mia") base-commit: e0ed305f2f096e7048af1a117c72895433f4886a =2D-=20 2.38.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCY73KRA0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW150UYA/22EOgxYn3tza7SIMz5MYuv1uNdxvflK0t9gbdou EbDNAP99uQZ1Vr2RMUIEx6OEFAnbzwajjqpuSvqyBmfUoAmRBg== =vJGL -----END PGP SIGNATURE----- --==-=-=--