Subject: bug#27296: [PATCH 35/35] guix: Add texlive importer.

From: [email-masked] (Ludovic Courtès)
Date: Fri, 09 Jun 2017 17:05:56 +0200

Ricardo Wurmus <[email-masked]> skribis:

> * guix/import/texlive.scm: New file.
> * guix/scripts/import/texlive.scm: New file.
> * Makefile.am (MODULES): Add them.
> * guix/scripts/import.scm (importers): Add texlive importer.

Could you add a note in guix.texi as well as a basic test (possibly
with mock of ‘http-get’) in tests/texlive.scm?

> +(define* (sxml->package sxml #:optional (component "latex"))
> +  "Return the `package' s-expression for a Texlive package from the SXML
> +expression describing it."
> +  (define (sxml-value path)
> +    (match ((sxpath path) sxml)
> +      (() #f)
> +      ((val) val)))
> +  (let* ((id         (sxml-value '(entry @ id *text*)))
> +         (synopsis   (sxml-value '(entry caption *text*)))
> +         (version    (or (sxml-value '(entry version @ number *text*))
> +                         (sxml-value '(entry version @ date *text*))))
> +         (license    (string->license (sxml-value '(entry license @ type *text*))))
> +         (home-page  (string-append "http://www.ctan.org/pkg/" id))
> +         (ref        (texlive-ref component id))

‘sxml-match’ might work better for this, depending on the structure of
the XML tree.

> +         (checkout   (with-store store (download-svn-to-store store ref))))

Note that as soon as we leave the dynamic extent of ‘with-store’, the
checkout can be GC’d.  Thus, it’s safer to wrap the whole body in
‘with-store’.

Otherwise LGTM.

Any plans for an updater in that module?

Woow, that’s an impressive piece of work, and that was fast!  I only
commented on a couple of packages, the others look good to me.

I think we’ll probably want a ‘texlive-full’ meta-package equivalent to
our current ‘texlive’ package for some or our users (hi Andreas! :-)).
Apart from that it’ll be interesting to see how many of the packages
currently depending on ‘texlive’ can use ‘texlive-tiny’.

A big thank you for this change that we had all been waiting for!

Ludo’.