From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Re: Small texlive variant Date: Sat, 13 Feb 2016 11:17:57 +0100 Message-ID: <20160213101757.GA18982@debian> References: <20160115152153.GA9454@debian> <87vb6qc4d1.fsf@gnu.org> <20160209214906.GA18201@debian> <87r3gjsez6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUXHD-0004jm-50 for guix-devel@gnu.org; Sat, 13 Feb 2016 05:18:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUXH9-0000pY-3E for guix-devel@gnu.org; Sat, 13 Feb 2016 05:18:07 -0500 Received: from mailrelay1.public.one.com ([91.198.169.124]:53092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUXH8-0000pL-Mh for guix-devel@gnu.org; Sat, 13 Feb 2016 05:18:03 -0500 Content-Disposition: inline In-Reply-To: <87r3gjsez6.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?iso-8859-15?Q?Court=E8s?= Cc: guix-devel@gnu.org --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Thanks for the comments! On Thu, Feb 11, 2016 at 11:45:01AM +0100, Ludovic Courtès wrote: > This comment is too indented and redundant with the code below, I think. Okay, I kept a shorter and clearer comment. > Make it an inner ‘define’, to reduce indentation. Done. > Also the docstring should be below the formal parameter list, and should > be a sentence. I took inspiration from other files; is it okay/required to start the second line of a real docstring in the first column? I am attaching the patch again mainly for that reason. > > + (lambda (subdir exclude) > I’d make exclude a keyword parameter, for clarity. Well, I think it would make sense if the procedure were exported globally; here it is really one with two parameters, so I am not following your advice. I also made the texlive-texmf-minimal variable private. As mentioned quickly on irc yesterday, I would like to do the same with texlive-texmf, to avoid mistakes (someone mentioned they had installed texlive-texmf and texlive into the same profile). As long as texlive-bin remains public, one can still download texlive-bin (which takes a while to compile) from hydra and unpack the data locally; the step from texlive-texmf to texlive is trivial and consists only of adding symlinks. What do you think? Andreas --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-gnu-Add-texlive-minimal.patch" >From 481a18d13e977ec259b6ab3dfc4bd9369fba5abd Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Fri, 15 Jan 2016 16:00:47 +0100 Subject: [PATCH] gnu: Add texlive-minimal. * gnu/packages/texlive.scm (texlive-texmf-minimal, texlive-minimal): New variables. --- gnu/packages/texlive.scm | 78 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm index 0b2dec4..a9673a0 100644 --- a/gnu/packages/texlive.scm +++ b/gnu/packages/texlive.scm @@ -24,6 +24,7 @@ #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) + #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages bash) #:use-module (gnu packages compression) @@ -45,7 +46,9 @@ #:use-module (gnu packages xorg) #:use-module (gnu packages xdisorg) #:use-module (gnu packages zip) - #:autoload (gnu packages texinfo) (texinfo)) + #:autoload (gnu packages texinfo) (texinfo) + #:use-module (ice-9 ftw) + #:use-module (srfi srfi-1)) (define texlive-extra-src (origin @@ -226,7 +229,7 @@ This package contains the complete tree of texmf-dist data.") (license (license:fsf-free "http://tug.org/texlive/copying.html")) (home-page "http://www.tug.org/texlive/"))) -(define-public texlive +(define texlive (package (name "texlive") (version "2015") @@ -284,6 +287,77 @@ This package contains the complete TeX Live distribution.") (license (license:fsf-free "http://tug.org/texlive/copying.html")) (home-page "http://www.tug.org/texlive/"))) + +;; texlive-texmf-minimal is a pruned, small version of the texlive tree, +;; in particular dropping documentation and fonts. +(define-public 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. + +This package contains a small subset of the texmf-dist data."))) + + +;; texlive-minimal is the same as texlive, but using texlive-texmf-minimal +;; instead of the full texlive-texmf. It can be used, for instance, as a +;; native input to packages that need texlive to build their documentation. +(define-public texlive-minimal + (package (inherit texlive) + (name "texlive-minimal") + (inputs + `(("texlive-texmf" ,texlive-texmf-minimal) + ,@(alist-delete "texlive-texmf" (package-inputs texlive)))) + (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 working part of the TeX Live distribution."))) + + (define-public rubber (package (name "rubber") -- 2.6.3 --6TrnltStXW4iwmi0--