unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: texlive-texmf-minimal: Prune in snippet.
@ 2016-11-29 11:32 Ricardo Wurmus
  2016-11-29 15:00 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2016-11-29 11:32 UTC (permalink / raw)
  To: guix-devel

* 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(-)

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.")))
 
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: texlive-texmf-minimal: Prune in snippet.
  2016-11-29 11:32 [PATCH] gnu: texlive-texmf-minimal: Prune in snippet Ricardo Wurmus
@ 2016-11-29 15:00 ` Ludovic Courtès
  2016-11-29 22:41   ` Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-11-29 15:00 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: texlive-texmf-minimal: Prune in snippet.
  2016-11-29 15:00 ` Ludovic Courtès
@ 2016-11-29 22:41   ` Ricardo Wurmus
  2016-12-01 13:59     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2016-11-29 22:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


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?

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
http://elephly.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: texlive-texmf-minimal: Prune in snippet.
  2016-11-29 22:41   ` Ricardo Wurmus
@ 2016-12-01 13:59     ` Ludovic Courtès
  2016-12-01 15:04       ` Ricardo Wurmus
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-12-01 13:59 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

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’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: texlive-texmf-minimal: Prune in snippet.
  2016-12-01 13:59     ` Ludovic Courtès
@ 2016-12-01 15:04       ` Ricardo Wurmus
  0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Wurmus @ 2016-12-01 15:04 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


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.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
http://elephly.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-01 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-29 11:32 [PATCH] gnu: texlive-texmf-minimal: Prune in snippet Ricardo Wurmus
2016-11-29 15:00 ` Ludovic Courtès
2016-11-29 22:41   ` Ricardo Wurmus
2016-12-01 13:59     ` Ludovic Courtès
2016-12-01 15:04       ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).