summaryrefslogtreecommitdiff
path: root/gnu/packages/xml.scm
diff options
context:
space:
mode:
authorBruno Victal <mirai@makinata.eu>2023-08-24 17:08:56 +0100
committerChristopher Baines <mail@cbaines.net>2024-06-26 16:58:37 +0100
commit7db520ad23826df7e78f976e1a567baed54a9257 (patch)
tree1876eae304c3aa7b658fe36bc4912a32e69bf4ad /gnu/packages/xml.scm
parent46acec5e9f0c28cc9d41cd59fa104cc44f769484 (diff)
gnu: perl-xml-xpath: Wrap xpath command.
* gnu/packages/xml.scm (perl-xml-xpath)[arguments]: Wrap xpath. Add test for wrapped xpath. [description]: Document xpath command presence. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/packages/xml.scm')
-rw-r--r--gnu/packages/xml.scm22
1 files changed, 21 insertions, 1 deletions
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index c6ddae50ae..1cd0e1a615 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -33,6 +33,7 @@
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1046,6 +1047,25 @@ RSS 0.91, RSS 1.0, RSS 2.0, Atom")
(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
@@ -1055,7 +1075,7 @@ RSS 0.91, RSS 1.0, RSS 2.0, Atom")
(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