summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorKei Kebreau <kei@openmailbox.org>2017-03-12 17:46:28 -0400
committerKei Kebreau <kei@openmailbox.org>2017-03-14 15:57:54 -0400
commit9099a45792306fade2d9ca55138e49ef4f01f1ea (patch)
tree08faa2d721b28689a5c1b5c08a7c882d80f0e744 /gnu
parent5895ec8aa234ec9a4ce68ab8f94e795807630168 (diff)
downloadguix-9099a45792306fade2d9ca55138e49ef4f01f1ea.tar.gz
gnu: asciidoc: Add XML and XSLT support.
* gnu/packages/documentation.scm (asciidoc)[arguments]: Add
set-xml-binary-paths phase.
[inputs]: Add libxml2 and libxslt.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/documentation.scm22
1 files changed, 21 insertions, 1 deletions
diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index bbc25e8797..94e979c881 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014, 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
+;;; Copyright © 2017 Kei Kebreau <kei@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -53,6 +54,23 @@
      `(#:tests? #f                     ; no 'check' target
        #:phases
        (modify-phases %standard-phases
+         ;; Some XML-related binaries are required for asciidoc's proper usage.
+         ;; Without these, asciidoc fails when parsing XML documents, either
+         ;; reporting a missing "xmllint" binary or, when passed the
+         ;; "--no-xmllint" option, a missing "xsltproc" binary.
+         ;; The following phase enables asciidoc to find some of them.
+         (add-before 'configure 'set-xml-binary-paths
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (let* ((libxml2 (assoc-ref inputs "libxml2"))
+                              (xmllint (string-append libxml2 "/bin/xmllint"))
+                              (libxslt (assoc-ref inputs "libxslt"))
+                              (xsltproc (string-append libxslt "/bin/xsltproc")))
+                         (substitute* "a2x.py"
+                           (("XMLLINT = 'xmllint'")
+                            (string-append "XMLLINT = '" xmllint "'"))
+                           (("XSLTPROC = 'xsltproc'")
+                            (string-append "XSLTPROC = '" xsltproc "'")))
+                         #t)))
          ;; Make asciidoc use the local docbook-xsl package instead of fetching
          ;; it from the internet at run-time.
          (add-before 'install 'make-local-docbook-xsl
@@ -67,7 +85,9 @@ release/xsl/current")
                                           ,(package-version docbook-xsl)))))
                        #t)))))
     (inputs `(("python" ,python-2)
-              ("docbook-xsl" ,docbook-xsl)))
+              ("docbook-xsl" ,docbook-xsl)
+              ("libxml2" ,libxml2)
+              ("libxslt" ,libxslt)))
     (home-page "http://www.methods.co.nz/asciidoc/")
     (synopsis "Text-based document generation system")
     (description