guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add tinyproxy.


From: Ludovic Courtès
Subject: Re: [PATCH] gnu: Add tinyproxy.
Date: Thu, 12 Jun 2014 13:59:02 +0200
User-agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux)

Hello!

John Darrington <address@hidden> skribis:

> * gnu/packages/web.scm (tinyproxy): New variable.
> * gnu/packages/docbook.scm: Remove #select (tar)

Should be “#:select”.

OK to push, modulo the tiny things below:

> +        (alist-replace
> +         'build
> +         (lambda* (#:key inputs #:allow-other-keys #:rest args)
> +           ;; This stuff is needed, because without it, xmlint etc tries
> +           ;; to download docbookx.dtd and docbook.xsl from the net
> +           (let ((build (assoc-ref %standard-phases 'build))
> +                 (docbook-xml (assoc-ref inputs "docbook-xml"))
> +                 (docbook-xsl (assoc-ref inputs "docbook-xsl"))
> +                 (our-catalog "/tmp/docbook-xml.xml"))
> +             (setenv "XML_CATALOG_FILES" our-catalog)
> +             (if (with-output-to-file our-catalog (lambda ()
> +                         (display (string-append
> +                          "<?xml version=\"1.0\"?>
> +<!DOCTYPE catalog PUBLIC \"-//OASIS//DTD XML Catalogs V1.0//EN\"
> +\"file:///usr/share/xml/schema/xml-core/catalog.dtd\">
> +<catalog xmlns=\"urn:oasis:names:tc:entity:xmlns:xml:catalog\">
> +<system systemId=\"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\";
> +uri=\"file://" docbook-xml  "/xml/dtd/docbook/docbookx.dtd\"/>
> +<system 
> systemId=\"http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl\";
> +uri=\"file://" docbook-xsl  
> "/xml/xsl/docbook-xsl-1.72.0/manpages/docbook.xsl\"/>
> +</catalog>\n"))))
> +                 (apply build args) #f)))
> +         %standard-phases)))

Thanks for digging into it.  This will be useful for a number of things,
such as building the Git man pages, so perhaps eventually we’ll
factorize that.

Note that ‘with-output-to-file’ returns *unspecified*, so the else arm
of the ‘if’ is never taken.  Also, write “(lambda ()” on the next line.
Lastly, prefer adding a phase before ‘build’ rather than replacing
‘build’ just to call it afterwards.

So, like this:

  (alist-cons-before
   'build 'pre-build
    (lambda ...
      ...
      (with-output-to-file our-catalog
        (lambda ()
          ...))
      #t)
    %standard-phases)

> +    ;; All of the below are used to generate the documentation
> +    ;; (Should they be propagated inputs of asciidoc ??)

Not sure.  Asciidoc can be used without an XML tool chain, no?

> +    (native-inputs `(("asciidoc" ,asciidoc)
> +                     ("libxml2" ,libxml2) 
> +                     ("docbook-xml" ,docbook-xml)
> +                     ("docbook-xsl" ,docbook-xsl)
> +                     ("libxslt" ,libxslt) 
> +                     ("python" ,python-2)))

Why Python?  Is it build-time only?

Thanks!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]