+ ;; 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)))