all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andreas Enge <andreas@enge.fr>
Cc: guix-devel@gnu.org
Subject: Re: Small texlive variant
Date: Tue, 19 Jan 2016 10:20:42 +0100	[thread overview]
Message-ID: <87vb6qc4d1.fsf@gnu.org> (raw)
In-Reply-To: <20160115152153.GA9454@debian> (Andreas Enge's message of "Fri, 15 Jan 2016 16:21:53 +0100")

Andreas Enge <andreas@enge.fr> skribis:

> the first attached patch adds a small texlive variant. I spent quite some
> time determining things to delete from texlive-texmf so that the result
> would still be usable, but I am certain the result is not minimal in the
> strict sense of the word. So I wondered whether the package should not be
> called "texlive-small" instead, but we already have a certain convention
> of using the suffix "-minimal" internally. I export the variable, but as
> I see it, its main use will be as a native-input to build documentation
> in packages. In my case, I am interested in pari-gp, which is modified
> by the second patch to build its documentation. For testing, you may call
>    `./pre-inst-env guix build texlive-minimal`/bin/xdvi `./pre-inst-env guix build pari-gp`/share/pari/doc/tutorial
> after applying the patches.

That makes sense, and it’s already an improvement!  I guess most of the
packages that currently depend on ‘texlive’ could switch to
‘texlive-minimal’ as well.

> From texlive-texmf, I deleted the subdirectory "doc" (1753 MB) and "source"
> (250 MB), and large chunks of "fonts", bringing it down from 1591 MB
> to 116 MB. There are probably parts of the 267 MB of "tex" that could be
> deleted as well, but I do not feel motivated to investigate further.

OK.

> ./pre-inst-env guix size texlive
> /gnu/store/pjmxca0nww2bp6hkwz7cjlh4s26ymxs2-texlive-2015          4223.2     0.3   0.0%
> /gnu/store/0wkmf926dv9ck8y1pk5p2lxw95kf7z9d-texlive-texmf-2015    4222.9  3710.3  87.9%
> /gnu/store/0h4cs6krz1rsfjl17rpy5mjr3bfap5lp-texlive-bin-2015       507.2    49.5   1.2%
> ...
>
> ./pre-inst-env guix size texlive-minimal
> /gnu/store/9flmncm9plf7y3bs6yj0nnpr7zlwagi2-texlive-minimal-2015         937.5     0.3   0.0%
> /gnu/store/y8shfzsg82b37zlzx29bza686gcr5162-texlive-texmf-minimal-2015   937.1   428.4  45.7%
> /gnu/store/0h4cs6krz1rsfjl17rpy5mjr3bfap5lp-texlive-bin-2015             507.2    49.5   5.3%

Yay!  :-)

> It should be possible to build texlive-minimal with a stripped-down variant
> of texlive-bin, but I do not feel it is worth the effort.
>
> The next thing to do would be to replace the occurrences of "texlive" in
> packages by "texlive-minimal" (and to make sure they are in native-inputs),
> to have the branch built by hydra and to check whether texlive-minimal is
> not too minimal for building all documentation.

Agreed.

> From f8a4aabcdf2ec156f42a87708078c065ad4fe43f Mon Sep 17 00:00:00 2001
> From: Andreas Enge <andreas@enge.fr>
> Date: Fri, 15 Jan 2016 16:00:47 +0100
> Subject: [PATCH 1/2] gnu: Add texlive-minimal.
>
> * gnu/packages/texlive.scm (texlive-texmf-minimal, texlive-minimal):
>   New variables.

[...]

> +             (with-directory-excursion "texmf-dist"
> +               (for-each delete-file-recursively
> +                         '("doc" "source" "tex4ht"))
> +               ;; Delete all subdirectories of "fonts", except for those
> +               ;; named "cm", that is, "afm/public/amsfonts/cm",
> +               ;; "map/dvips/cm", "pk/ljfour/public/cm" (which is effectively
> +               ;; all of "pk"), "source/public/cm", "tfm/public/cm" and
> +               ;; "type1/public/amsfonts/cm".
> +               ;; Inside "tfm", apparently more subdirectories are needed for
> +               ;; successful bootstrapping of the formats, so we keep
> +               ;; "tfm/public".
> +               (with-directory-excursion "fonts"
> +                 (for-each delete-file-recursively
> +                           (lset-difference equal?
> +                                            (scandir ".")
> +                                            '("." ".." "afm" "map" "pk"
> +                                              "source" "tfm" "type1")))
> +                 (with-directory-excursion "afm"
> +                   (for-each delete-file-recursively
> +                             (lset-difference equal?
> +                                              (scandir ".")
> +                                              '("." ".." "public")))
> +                   (with-directory-excursion "public"
> +                     (for-each delete-file-recursively
> +                               (lset-difference equal?
> +                                                (scandir ".")
> +                                                '("." ".." "amsfonts")))

This is a bit verbose.  I think it would be nice to have a data
structure to describe what we are deleting, along these lines
(untested):

  (define to-delete
    '(("texmf-dist" except "doc" "source" "tex4ht")
      ("texmf-dist/afm" except "amsfonts")
      ;; …
      ))

  (define (expand-file-specification spec)
    (match spec
      ((directory) directory)
      ((directory 'except exceptions ...)
       (map (cut string-append directory "/" <>)
            (lset-difference string=?
                             (scandir directory)
                             (cons* "." ".." exceptions))))))

  (with-directory-excursion out
    (for-each delete-file-recursively
              (map expand-file-specification to-delete)))

WDYT?

> From b6c445622d5308c905b9fd7d799638335a627496 Mon Sep 17 00:00:00 2001
> From: Andreas Enge <andreas@enge.fr>
> Date: Fri, 15 Jan 2016 16:02:29 +0100
> Subject: [PATCH 2/2] gnu: pari-gp: Build documentation.
>
> * gnu/packages/algebra.scm (pari-gp)[native-inputs]: Add texlive-minimal.
>   [arguments]: Modify make-flags to build documentation.

[...]

>     (build-system gnu-build-system)
> +   (native-inputs `(("texlive" ,texlive-minimal)))

Doesn’t PARI want to use TeX at run time too?  If that is the case, this
should go to ‘inputs’.

Otherwise LGTM.

Thanks for working on this thankless yet very useful task!  :-)

Ludo’.

  reply	other threads:[~2016-01-19  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 15:21 Small texlive variant Andreas Enge
2016-01-19  9:20 ` Ludovic Courtès [this message]
2016-02-09 21:49   ` Andreas Enge
2016-02-11 10:45     ` Ludovic Courtès
2016-02-13 10:17       ` Andreas Enge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vb6qc4d1.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=andreas@enge.fr \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.