Subject: bug#27217: texlive is too big

From: Ludovic Courtès <[email-masked]>
Date: Thu, 10 Jan 2019 10:27:59 +0100

Hello!

I was also looking at the remaining dependencies on ‘texlive’.  For
‘teximpatient’, it looks like we’d need
<https://ctan.org/pkg/mflogo-font> but:

--8<---------------cut here---------------start------------->8---
$ guix import texlive mflogo-font
ni sekvas la redirektigon al 'https://ctan.org/xml/1.2/pkg/mflogo-font'...
Backtrace:
          10 (primitive-load "/home/ludo/.config/guix/current/bin/guix")
In guix/ui.scm:
  1644:12  9 (run-guix-command _ . _)
In guix/scripts/import.scm:
   115:11  8 (guix-import . _)
In guix/scripts/import/texlive.scm:
    91:19  7 (guix-import-texlive . _)
In guix/memoization.scm:
     98:0  6 (_ #<hash-table 20cd220 0/31> ("mflogo-font" "latex") _)
In unknown file:
           5 (_ #<procedure 20e66e0 at guix/memoization.scm:179:32 ()> #<procedure list _> #<undefined>)
In guix/import/texlive.scm:
   146:23  4 (sxml->package (*TOP* (entry (@ (id "mflogo-font")) (name "mflogo-font") (caption "Metafont…") …)) _)
In guix/utils.scm:
    632:8  3 (call-with-temporary-directory #<procedure 2291180 at guix/svn-download.scm:92:3 (temp)>)
In guix/svn-download.scm:
    95:14  2 (_ "/tmp/guix-directory.lVf6gO")
In guix/build/svn.scm:
     38:2  1 (svn-fetch "svn://www.tug.org/texlive/tags/texlive-2017.1/Master/texmf-dist/source/latex/mflogo-fo…" …)
In guix/build/utils.scm:
    616:6  0 (invoke _ . _)

guix/build/utils.scm:616:6: In procedure invoke:
Throw to key `srfi-34' with args `(#<condition &invoke-error [program: "svn" arguments: ("checkout" "--non-interactive" "--trust-server-cert" "-r" "44591" "svn://www.tug.org/texlive/tags/texlive-2017.1/Master/texmf-dist/source/latex/mflogo-font" "/tmp/guix-directory.lVf6gO") exit-status: 1 term-signal: #f stop-signal: #f] 2219000>)'.
ludo@ribbon ~/src/guix$ guix describe
Generacio 51	Jan 08 2019 10:45:12	(nuna)
  guix b509381
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: b50938108947d47c9e3d37608df83a11020a4d8d
--8<---------------cut here---------------end--------------->8---

WIP patch:

--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -4399,9 +4399,16 @@ develop documents with LaTeX, in a single application.")
                                (assoc-ref inputs "automake")
                                "^install-sh$"))
                              srcdir)
-               (chdir srcdir)))))))
+               (chdir srcdir))))
+         (add-after 'unpack 'set-home
+           (lambda _
+             ;; XXX: Currently tex wants to generate fonts in
+             ;; ~/.texlive2018/texmf-var/fonts, hence this hack.
+             (setenv "HOME" (getcwd))
+             #t)))))
     (native-inputs
-     `(("texlive" ,texlive)
+     `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts
+                                        texlive-fonts-ec)))
        ("automake" ,automake)))
     (home-page "https://www.gnu.org/software/teximpatient/")
     (synopsis "Book on TeX, plain TeX and Eplain")

Ludo’.