guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

33/35: gnu: Add texlive-union.


From: Ricardo Wurmus
Subject: 33/35: gnu: Add texlive-union.
Date: Thu, 15 Jun 2017 11:04:10 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit cb7bc20a4da7fab4fd8f31c8a2837987b0b8808e
Author: Ricardo Wurmus <address@hidden>
Date:   Fri Jun 9 12:31:45 2017 +0200

    gnu: Add texlive-union.
    
    * gnu/packages/tex.scm (texlive-union): New procedure.
---
 gnu/packages/tex.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 5e9370b..e89f5b0 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -61,6 +61,7 @@
   #:use-module (gnu packages zip)
   #:autoload   (gnu packages texinfo) (texinfo)
   #:use-module (ice-9 ftw)
+  #:use-module (ice-9 match)
   #:use-module ((srfi srfi-1) #:hide (zip)))
 
 (define texlive-extra-src
@@ -1354,6 +1355,91 @@ font metrics.  The bundle as a whole is part of the 
LaTeX required set of
 packages.")
     (license license:lppl1.2+)))
 
+(define-public texlive-union
+  (lambda* (#:optional (packages '()))
+    "Return 'texlive-union' package which is a union of PACKAGES and the
+standard LaTeX packages."
+    (let ((default-packages
+            (list texlive-bin
+                  texlive-dvips
+                  texlive-fonts-cm
+                  texlive-fonts-latex
+                  texlive-metafont-base
+                  texlive-latex-base
+                  ;; LaTeX packages from the "required" set.
+                  texlive-latex-amsmath
+                  texlive-latex-amscls
+                  texlive-latex-babel
+                  texlive-latex-cyrillic
+                  texlive-latex-graphics
+                  texlive-latex-psnfss
+                  texlive-latex-tools)))
+      (package
+        (name "texlive-union")
+        (version (number->string %texlive-revision))
+        (source #f)
+        (build-system trivial-build-system)
+        (arguments
+         '(#:modules ((guix build union)
+                      (guix build utils)
+                      (guix build texlive-build-system)
+                      (guix build gnu-build-system)
+                      (guix build gremlin)
+                      (guix elf))
+           #:builder
+           (begin
+             (use-modules (ice-9 match)
+                          (srfi srfi-26)
+                          (guix build union)
+                          (guix build utils)
+                          (guix build texlive-build-system))
+             (let* ((out       (assoc-ref %outputs "out"))
+                    (texmf.cnf (string-append out 
"/share/texmf-dist/web2c/texmf.cnf")))
+               ;; Build a modifiable union of all inputs (but exclude bash)
+               (match (filter (match-lambda
+                                ((name . _)
+                                 (not (string=? "bash" name))))
+                              %build-inputs)
+                 (((names . directories) ...)
+                  (union-build (assoc-ref %outputs "out")
+                               directories
+                               #:create-all-directories? #t)))
+
+               ;; The configuration file "texmf.cnf" is provided by the
+               ;; "texlive-bin" package.  We take it and override only the
+               ;; setting for TEXMFROOT and TEXMF.  This file won't be 
consulted
+               ;; by default, though, so we still need to set TEXMFCNF.
+               (substitute* texmf.cnf
+                 (("^TEXMFROOT = .*")
+                  (string-append "TEXMFROOT = " out "/share\n"))
+                 (("^TEXMF = .*")
+                  "TEXMF = $TEXMFROOT/share/texmf-dist\n"))
+               (setenv "PATH" (string-append (assoc-ref %build-inputs "bash")
+                                             "/bin"))
+               (for-each
+                (cut wrap-program <>
+                     `("TEXMFCNF" ":" = (,(dirname texmf.cnf)))
+                     `("TEXMF"    ":" = (,(string-append out 
"/share/texmf-dist"))))
+                (find-files (string-append out "/bin") ".*"))
+               #t))))
+        (inputs
+         `(("bash" ,bash)
+           ,@(map (lambda (package)
+                    (list (package-name package) package))
+                  (append default-packages packages))))
+        (home-page (package-home-page texlive-bin))
+        (synopsis "Union of TeX Live packages")
+        (description "This package provides a subset of the TeX Live
+distribution.")
+        (license (fold (lambda (package result)
+                         (match (package-license package)
+                           ((lst ...)
+                            (append lst result))
+                           ((? license:license? license)
+                            (cons license result))))
+                       '()
+                       (append default-packages packages)))))))
+
 (define texlive-texmf
   (package
    (name "texlive-texmf")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]