[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/110: gnu: Add simple-texlive-package.
From: |
guix-commits |
Subject: |
05/110: gnu: Add simple-texlive-package. |
Date: |
Mon, 22 Jul 2019 15:25:30 -0400 (EDT) |
rekado pushed a commit to branch wip-texlive
in repository guix.
commit bfbc6a7a3c9c2241fce06ffd92d160301c87459b
Author: Ricardo Wurmus <address@hidden>
Date: Sat Jul 6 21:27:19 2019 +0200
gnu: Add simple-texlive-package.
* gnu/packages/tex.scm (simple-texlive-package): New procedure.
---
gnu/packages/tex.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 85c72e0..678e46c 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -75,6 +75,64 @@
#:use-module (ice-9 match)
#:use-module ((srfi srfi-1) #:hide (zip)))
+(define* (simple-texlive-package name locations hash
+ #:key trivial?)
+ "Return a template for a simple TeX Live package with the given NAME,
+downloading from a list of LOCATIONS in the TeX Live repository, and expecting
+the provided output HASH. If TRIVIAL? is provided, all files will simply be
+copied to their outputs; otherwise the TEXLIVE-BUILD-SYSTEM is used."
+ (define with-documentation?
+ (and trivial?
+ (any (lambda (location)
+ (string-prefix? "/doc" location))
+ locations)))
+ (package
+ (name name)
+ (version (number->string %texlive-revision))
+ (source (texlive-origin name version
+ locations hash))
+ (outputs (if with-documentation?
+ '("out" "doc")
+ '("out")))
+ (build-system (if trivial?
+ gnu-build-system
+ texlive-build-system))
+ (arguments
+ (let ((copy-files
+ `(lambda* (#:key outputs inputs #:allow-other-keys)
+ (let (,@(if with-documentation?
+ `((doc (string-append (assoc-ref outputs "doc")
+ "/share/texmf-dist/")))
+ '())
+ (out (string-append (assoc-ref outputs "out")
+ "/share/texmf-dist/")))
+ ,@(if with-documentation?
+ '((mkdir-p doc)
+ (copy-recursively
+ (string-append (assoc-ref inputs "source") "/doc")
+ (string-append doc "/doc")))
+ '())
+ (mkdir-p out)
+ (copy-recursively (assoc-ref inputs "source") out)
+ ,@(if with-documentation?
+ '((delete-file-recursively (string-append out "/doc")))
+ '())
+ #t))))
+ (if trivial?
+ `(#:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build (const #t))
+ (replace 'install ,copy-files)))
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'copy-files ,copy-files))))))
+ (home-page #f)
+ (synopsis #f)
+ (description #f)
+ (license #f)))
+
(define texlive-extra-src
(origin
(method url-fetch)
- branch wip-texlive created (now 5215ddb), guix-commits, 2019/07/22
- 02/110: build: svn-fetch: Use "svn export"., guix-commits, 2019/07/22
- 01/110: gnu: texlive-union: Build font maps., guix-commits, 2019/07/22
- 03/110: guix: Add svn-multi-reference., guix-commits, 2019/07/22
- 05/110: gnu: Add simple-texlive-package.,
guix-commits <=
- 07/110: gnu: Add texlive-hyphen-package., guix-commits, 2019/07/22
- 04/110: build-system/texlive: Add texlive-origin., guix-commits, 2019/07/22
- 06/110: gnu: Add hyph-utf8-scripts., guix-commits, 2019/07/22
- 08/110: gnu: Add texlive-unicode-data., guix-commits, 2019/07/22
- 09/110: gnu: Add texlive-hyphen-base., guix-commits, 2019/07/22
- 13/110: gnu: texlive-fonts-cm: Remove cm-type1., guix-commits, 2019/07/22
- 12/110: gnu: texlive-dvips: Implement with simple-texlive-package., guix-commits, 2019/07/22
- 11/110: gnu: Add texlive-dehyph-exptl., guix-commits, 2019/07/22
- 14/110: gnu: texlive-fonts-cm: Use simple-texlive-package., guix-commits, 2019/07/22
- 19/110: gnu: Add texlive-hyphen-basque., guix-commits, 2019/07/22