aboutsummaryrefslogtreecommitdiff
path: root/guix/build-system/texlive.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build-system/texlive.scm')
-rw-r--r--guix/build-system/texlive.scm71
1 files changed, 31 insertions, 40 deletions
diff --git a/guix/build-system/texlive.scm b/guix/build-system/texlive.scm
index a8545757be..0a69d1f328 100644
--- a/guix/build-system/texlive.scm
+++ b/guix/build-system/texlive.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,7 +21,8 @@
#:use-module (guix store)
#:use-module (guix utils)
#:use-module (guix packages)
- #:use-module (guix derivations)
+ #:use-module (guix monads)
+ #:use-module (guix gexp)
#:use-module (guix search-paths)
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
@@ -100,7 +102,7 @@ level package ID."
#:rest arguments)
"Return a bag for NAME."
(define private-keywords
- '(#:source #:target #:inputs #:native-inputs
+ '(#:target #:inputs #:native-inputs
#:texlive-latex-base #:texlive-bin))
(bag
@@ -120,8 +122,9 @@ level package ID."
(build texlive-build)
(arguments (strip-keyword-arguments private-keywords arguments))))
-(define* (texlive-build store name inputs
+(define* (texlive-build name inputs
#:key
+ source
(tests? #f)
tex-directory
(build-targets #f)
@@ -139,43 +142,31 @@ level package ID."
(guix build utils))))
"Build SOURCE with INPUTS."
(define builder
- `(begin
- (use-modules ,@modules)
- (texlive-build #:name ,name
- #:source ,(match (assoc-ref inputs "source")
- (((? derivation? source))
- (derivation->output-path source))
- ((source)
- source)
- (source
- source))
- #:tex-directory ,tex-directory
- #:build-targets ,build-targets
- #:tex-format ,tex-format
- #:system ,system
- #:tests? ,tests?
- #:phases ,phases
- #:outputs %outputs
- #:search-paths ',(map search-path-specification->sexp
- search-paths)
- #:inputs %build-inputs)))
-
- (define guile-for-build
- (match guile
- ((? package?)
- (package-derivation store guile system #:graft? #f))
- (#f ; the default
- (let* ((distro (resolve-interface '(gnu packages commencement)))
- (guile (module-ref distro 'guile-final)))
- (package-derivation store guile system #:graft? #f)))))
-
- (build-expression->derivation store name builder
- #:inputs inputs
- #:system system
- #:modules imported-modules
- #:outputs outputs
- #:guile-for-build guile-for-build
- #:substitutable? substitutable?))
+ (with-imported-modules imported-modules
+ #~(begin
+ (use-modules #$@modules)
+ (texlive-build #:name #$name
+ #:source #+source
+ #:tex-directory #$tex-directory
+ #:build-targets #$build-targets
+ #:tex-format #$tex-format
+ #:system #$system
+ #:tests? #$tests?
+ #:phases #$phases
+ #:outputs (list #$@(map (lambda (name)
+ #~(cons #$name
+ (ungexp output name)))
+ outputs))
+ #:inputs (map (lambda (tuple)
+ (apply cons tuple))
+ '#$inputs)
+ #:search-paths '#$(map search-path-specification->sexp
+ search-paths)))))
+
+ (gexp->derivation name builder
+ #:system system
+ #:target #f
+ #:substitutable? substitutable?))
(define texlive-build-system
(build-system