aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/docbook.scm
diff options
context:
space:
mode:
authorBruno Victal <mirai@makinata.eu>2023-03-11 17:54:12 +0000
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-04-21 00:44:00 -0400
commite9ba6d2c47bacae433be1a6c629d4d307206245a (patch)
tree1c90ec8da1a8fb7249b86fd284fbb1178d37abdf /gnu/packages/docbook.scm
parenta29754b4f152db15b8a7622d7319cfee62f8d7d8 (diff)
downloadguix-e9ba6d2c47bacae433be1a6c629d4d307206245a.tar
guix-e9ba6d2c47bacae433be1a6c629d4d307206245a.tar.gz
gnu: docbook-xml: Use XSLT to patch catalog.xml.
(sxml transforms) are unsuited here due to guile-bug #20339. * gnu/packages/aux-files/xml/patch-catalog-xml.xsl: New file. * Makefile.am: Register it. * gnu/packages/docbook.scm (docbook-xml-5)[native-inputs]: Add libxslt. [arguments]: Add phase to patch catalog.xml using XSLT. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/packages/docbook.scm')
-rw-r--r--gnu/packages/docbook.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index 1816b19685..a9c92459c2 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2021 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 Andrew Whatson <whatson@gmail.com>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -71,11 +72,22 @@
(lambda _
;; XXX: These files do not need 0755 permission.
(for-each (cut chmod <> #o644) (find-files "."))))
+ (add-before 'install 'patch-catalog-xml
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((xsltproc (search-input-file inputs "/bin/xsltproc"))
+ (dtd-path (string-append #$output "/xml/dtd/docbook")))
+ (invoke xsltproc "--nonet" "--noout"
+ "--stringparam" "prefix" dtd-path
+ "--output" "catalog.xml.new"
+ #$(local-file
+ (search-auxiliary-file "xml/patch-catalog-xml.xsl"))
+ "catalog.xml")
+ (rename-file "catalog.xml.new" "catalog.xml"))))
(replace 'install
(lambda _
(let ((dtd-path (string-append #$output "/xml/dtd/docbook")))
(copy-recursively "." dtd-path)))))))
- (native-inputs (list unzip))
+ (native-inputs (list libxslt unzip))
(home-page "https://docbook.org")
(synopsis "DocBook XML DTDs for document authoring")
(description