GNU bug report logs - #60824
[PATCH core-updates] Update and wrap perl-xml-xpath.

Previous Next

Package: guix-patches;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Sun, 15 Jan 2023 01:22:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Bruno Victal <mirai <at> makinata.eu>
To: 60824 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates v4 1/2] gnu: perl-xml-xpath: Wrap xpath command.
Date: Thu, 24 Aug 2023 17:08:56 +0100
* gnu/packages/xml.scm (perl-xml-xpath)[arguments]: Wrap xpath. Add test for
wrapped xpath.
[description]: Document xpath command presence.
---
 gnu/packages/xml.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 555f0ab624..ca7aaf29ed 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021 David Larsson <david.larsson <at> selfhosted.xyz>
 ;;; Copyright © 2021 Matthew James Kraai <kraai <at> ftbfs.org>
+;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1044,6 +1045,25 @@ (define-public perl-xml-xpath
                (base32
                 "03yxj7w5a43ibbpiqsvb3lswj2b71dydsx4rs2fw0p8n0l3i3j8w"))))
     (build-system perl-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'wrap 'wrap-xpath
+            (lambda _
+              (let ((xpath (string-append #$output "/bin/xpath"))
+                    (perl5lib
+                     (search-path-as-list
+                      '("/lib/perl5/site_perl")
+                      (list #$(this-package-input "perl-xml-parser")
+                            #$output))))
+                (wrap-program xpath
+                  `("PERL5LIB" ":" prefix ,perl5lib)))))
+          (add-after 'wrap-xpath 'check-wrap
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (unsetenv "PERL5LIB")
+                (invoke/quiet (string-append #$output "/bin/xpath"))))))))
     (native-inputs
      (list perl-path-tiny))
     (propagated-inputs
@@ -1053,7 +1073,7 @@ (define-public perl-xml-xpath
     (description
      "This module aims to comply exactly to the @url{XPath specification,
 https://www.w3.org/TR/xpath} and yet allow extensions to be added in
-the form of functions.")
+the form of functions.  It also provides the command @command{xpath}.")
     (license license:perl-license)))
 
 (define-public pugixml

base-commit: c365cc69881f3aec633b88ba22c7fe8faec3597e
-- 
2.40.1





This bug report was last modified 1 year and 226 days ago.

Previous Next


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