From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: Re: Small texlive variant Date: Tue, 9 Feb 2016 22:49:06 +0100 Message-ID: <20160209214906.GA18201@debian> References: <20160115152153.GA9454@debian> <87vb6qc4d1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="SLDf9lqlvOQaIe6s" Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60549) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTG9p-0003Qz-K5 for guix-devel@gnu.org; Tue, 09 Feb 2016 16:49:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTG9n-0003T1-EX for guix-devel@gnu.org; Tue, 09 Feb 2016 16:49:13 -0500 Received: from mailrelay6.public.one.com ([91.198.169.200]:24635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTG9n-0003SV-5O for guix-devel@gnu.org; Tue, 09 Feb 2016 16:49:11 -0500 Content-Disposition: inline In-Reply-To: <87vb6qc4d1.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 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Jan 19, 2016 at 10:20:42AM +0100, Ludovic Courtès wrote: > 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): I agree, computer science 101 tells us to use a function when repeating the same sequence of statements on separate data. This is what I did in the new attached patch; I also "flattened out" the deletion as you suggest. However, the data structure thing was too complicated for me and I think not really needed. Comments are again welcome. Andreas --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-gnu-Add-texlive-minimal.patch" >From 8a2ebb8163c54f80f2a5e4708956b87b134ada85 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 | 83 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm index 0b2dec4..f51f853 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 @@ -284,6 +287,84 @@ 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 _ + (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 + ;; all of "tfm/public". + (let ((delete + ;; delete all files and directories in SUBDIR + ;; except for those given in the list EXCLUDE + (lambda (subdir exclude) + (with-directory-excursion subdir + (for-each delete-file-recursively + (lset-difference equal? + (scandir ".") + (append '("." "..") + exclude))))))) + (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 --SLDf9lqlvOQaIe6s--