diff mbox

gnu: texlive-texmf-minimal: Prune in snippet.

Message ID 20161129113203.6922-1-rekado@elephly.net
State New
Headers show

Commit Message

Ricardo Wurmus Nov. 29, 2016, 11:32 a.m. UTC
* gnu/packages/tex.scm (texlive-texmf-minimal)[arguments]: Move contents
of "prune" build phase...
[source]: ...to a snippet here.
---
 gnu/packages/tex.scm | 86 +++++++++++++++++++++++++---------------------------
 1 file changed, 41 insertions(+), 45 deletions(-)

Comments

Ludovic Courtès Nov. 29, 2016, 3 p.m. UTC | #1
Ricardo Wurmus <rekado@elephly.net> skribis:

> * gnu/packages/tex.scm (texlive-texmf-minimal)[arguments]: Move contents
> of "prune" build phase...
> [source]: ...to a snippet here.

It looks nicer this way, but a possible downside is the extra derivation
and recompression of the patched source.

No strong opinion here though.

Ludo’.
Ricardo Wurmus Nov. 29, 2016, 10:41 p.m. UTC | #2
Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> * gnu/packages/tex.scm (texlive-texmf-minimal)[arguments]: Move contents
>> of "prune" build phase...
>> [source]: ...to a snippet here.
>
> It looks nicer this way, but a possible downside is the extra derivation
> and recompression of the patched source.
>
> No strong opinion here though.

My motivation was probably misguided.  My hope was that building
“texlive-texmf-minimal” would no longer require the very large download
of the full texlive-texmf sources but only the much smaller pruned
sources.  If this is the case I think it would be advantageous for
users.  However, if building from source would cause them to download
the big tarball first, then patch and repack, and then build the package
— that would obviously not be great.

Do we provide substitutes for snippet-patched sources?
Ludovic Courtès Dec. 1, 2016, 1:59 p.m. UTC | #3
Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Ricardo Wurmus <rekado@elephly.net> skribis:
>>
>>> * gnu/packages/tex.scm (texlive-texmf-minimal)[arguments]: Move contents
>>> of "prune" build phase...
>>> [source]: ...to a snippet here.
>>
>> It looks nicer this way, but a possible downside is the extra derivation
>> and recompression of the patched source.
>>
>> No strong opinion here though.
>
> My motivation was probably misguided.  My hope was that building
> “texlive-texmf-minimal” would no longer require the very large download
> of the full texlive-texmf sources but only the much smaller pruned
> sources.  If this is the case I think it would be advantageous for
> users.  However, if building from source would cause them to download
> the big tarball first, then patch and repack, and then build the package
> — that would obviously not be great.
>
> Do we provide substitutes for snippet-patched sources?

Yes, as long as there’s a derivation, there’s a substitute.

But really, we should get rid of this monolithic texlive and import
individual CTAN packages, while still providing a big texlive
meta-package for those who want the 4 GiBs.

Ludo’.
Ricardo Wurmus Dec. 1, 2016, 3:04 p.m. UTC | #4
Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> Ricardo Wurmus <rekado@elephly.net> skribis:
>>>
>>>> * gnu/packages/tex.scm (texlive-texmf-minimal)[arguments]: Move contents
>>>> of "prune" build phase...
>>>> [source]: ...to a snippet here.
>>>
>>> It looks nicer this way, but a possible downside is the extra derivation
>>> and recompression of the patched source.
>>>
>>> No strong opinion here though.
>>
>> My motivation was probably misguided.  My hope was that building
>> “texlive-texmf-minimal” would no longer require the very large download
>> of the full texlive-texmf sources but only the much smaller pruned
>> sources.  If this is the case I think it would be advantageous for
>> users.  However, if building from source would cause them to download
>> the big tarball first, then patch and repack, and then build the package
>> — that would obviously not be great.
>>
>> Do we provide substitutes for snippet-patched sources?
>
> Yes, as long as there’s a derivation, there’s a substitute.
>
> But really, we should get rid of this monolithic texlive and import
> individual CTAN packages, while still providing a big texlive
> meta-package for those who want the 4GiBs.

Yes, I agree.

I made the change when I was still hoping to be able to build the Python
science suite (numpy, scipy, matplotlib…) with texlive-minimal, which
turned out to fail in all instances.  It always missing a different tiny
subset of Texlive…

Texlive is one of the biggest annoyances here at the MDC.  The huge
package together with slow storage (and our users’ dependence on things
like numpy) means that I’m rebuilding Texlive for half a day each time I
update our shared Guix installation.  I’m *very* motivated to change
this.

I’ll build a CTAN (bulk) importer soon and will see where that leads us.
diff mbox

Patch

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 7c84ed7..d7d5866 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -316,51 +316,47 @@  This package contains the complete TeX Live distribution.")
 ;; in particular dropping documentation and fonts.  It weighs in at 470 MiB
 ;; instead of 4 GiB.
 (define texlive-texmf-minimal
-  (package (inherit texlive-texmf)
-   (name "texlive-texmf-minimal")
-   (arguments
-    (substitute-keyword-arguments
-     (package-arguments texlive-texmf)
-     ((#:modules modules)
-      `((ice-9 ftw)
-        (srfi srfi-1)
-        ,@modules))
-     ((#:phases phases)
-      `(modify-phases ,phases
-         (add-after 'unpack 'prune
-           (lambda _
-             (define (delete subdir exclude)
-               "Delete all files and directories in SUBDIR except for those
-given in the list EXCLUDE."
-               (with-directory-excursion subdir
-                 (for-each delete-file-recursively
-                           (lset-difference equal?
-                                            (scandir ".")
-                                            (append '("." "..")
-                                                    exclude)))))
-             (with-directory-excursion "texmf-dist"
-               (for-each delete-file-recursively
-                         '("doc" "source" "tex4ht"))
-               ;; Delete all subdirectories of "fonts", except for "tfm" and
-               ;; any directories named "cm".
-               (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
-               (delete "fonts/afm" '("public"))
-               (delete "fonts/afm/public" '("amsfonts"))
-               (delete "fonts/afm/public/amsfonts" '("cm"))
-               (delete "fonts/map" '("dvips"))
-               (delete "fonts/map/dvips" '("cm"))
-               (delete "fonts/source" '("public"))
-               (delete "fonts/source/public" '("cm"))
-               (delete "fonts/tfm" '("public"))
-               (delete "fonts/type1" '("public"))
-               (delete "fonts/type1/public" '("amsfonts"))
-               (delete "fonts/type1/public/amsfonts" '("cm")))
-             #t))))))
-   (description
-    "TeX Live provides a comprehensive TeX document production system.
-It includes all the major TeX-related programs, macro packages, and fonts
-that are free software, including support for many languages around the
-world.
+  (package
+    (inherit texlive-texmf)
+    (name "texlive-texmf-minimal")
+    (source
+     (origin (inherit (package-source texlive-texmf))
+             (modules '((guix build utils)
+                        (ice-9 ftw)
+                        (srfi srfi-1)))
+             (snippet
+              '(begin
+                 (define (delete subdir exclude)
+                   "Delete all files and directories in SUBDIR except for
+those given in the list EXCLUDE."
+                   (with-directory-excursion subdir
+                     (for-each delete-file-recursively
+                               (lset-difference equal?
+                                                (scandir ".")
+                                                (append '("." "..")
+                                                        exclude)))))
+                 (with-directory-excursion "texmf-dist"
+                   (for-each delete-file-recursively
+                             '("doc" "source" "tex4ht"))
+                   ;; Delete all subdirectories of "fonts", except for "tfm" and
+                   ;; any directories named "cm".
+                   (delete "fonts" '("afm" "map" "pk" "source" "tfm" "type1"))
+                   (delete "fonts/afm" '("public"))
+                   (delete "fonts/afm/public" '("amsfonts"))
+                   (delete "fonts/afm/public/amsfonts" '("cm"))
+                   (delete "fonts/map" '("dvips"))
+                   (delete "fonts/map/dvips" '("cm"))
+                   (delete "fonts/source" '("public"))
+                   (delete "fonts/source/public" '("cm"))
+                   (delete "fonts/tfm" '("public"))
+                   (delete "fonts/type1" '("public"))
+                   (delete "fonts/type1/public" '("amsfonts"))
+                   (delete "fonts/type1/public/amsfonts" '("cm")))
+                 #t))))
+    (description
+     "TeX Live provides a comprehensive TeX document production system.
+It includes all the major TeX-related programs, macro packages, and fonts that
+are free software, including support for many languages around the world.
 
 This package contains a small subset of the texmf-dist data.")))