[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
21/29: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'.
From: |
guix-commits |
Subject: |
21/29: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'. |
Date: |
Mon, 8 Mar 2021 06:24:54 -0500 (EST) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit f48e728b5e1cf39599859e1fe923fcb356c01d8a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Feb 28 22:40:06 2021 +0100
build-system: Use 'input-tuples->gexp' and 'outputs->gexp'.
* guix/gexp.scm (input-tuples->gexp, outputs->gexp): Make public.
* guix/build-system/cargo.scm (cargo-build): Use them.
* guix/build-system/gnu.scm (gnu-cross-build): Likewise.
* guix/build-system/ocaml.scm (ocaml-build): Likewise.
* guix/build-system/cmake.scm (cmake-cross-build): Likewise.
---
guix/build-system/cargo.scm | 9 ++-------
guix/build-system/cmake.scm | 14 ++++----------
guix/build-system/gnu.scm | 14 ++++----------
guix/build-system/ocaml.scm | 9 ++-------
guix/gexp.scm | 3 +++
5 files changed, 15 insertions(+), 34 deletions(-)
diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm
index 82fcdac..b77936d 100644
--- a/guix/build-system/cargo.scm
+++ b/guix/build-system/cargo.scm
@@ -109,13 +109,8 @@ to NAME and VERSION."
#:phases #$(if (pair? phases)
(sexp->gexp phases)
phases)
- #:outputs (list #$@(map (lambda (name)
- #~(cons #$name
- (ungexp output name)))
- outputs))
- #:inputs (map (lambda (tuple)
- (apply cons tuple))
- '#$inputs)
+ #:outputs #$(outputs->gexp outputs)
+ #:inputs #$(input-tuples->gexp inputs)
#:search-paths '#$(sexp->gexp
(map search-path-specification->sexp
search-paths))))))
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index 4e58bf7..1ac9e98 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -204,20 +204,14 @@ build system."
(use-modules #$@(sexp->gexp modules))
(define %build-host-inputs
- (map (lambda (tuple)
- (apply cons tuple))
- '#+(append build-inputs target-inputs)))
+ #+(input-tuples->gexp build-inputs))
(define %build-target-inputs
- (map (lambda (tuple)
- (apply cons tuple))
- '#$host-inputs))
+ (append #$(input-tuples->gexp host-inputs)
+ #+(input-tuples->gexp target-inputs)))
(define %outputs
- (list #$@(map (lambda (name)
- #~(cons #$name
- (ungexp output name)))
- outputs)))
+ #$(outputs->gexp outputs))
(cmake-build #:source #+source
#:system #$system
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index 3fb1a24..a1b2b65 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -510,20 +510,14 @@ platform."
(use-modules #$@(sexp->gexp modules))
(define %build-host-inputs
- (map (lambda (tuple)
- (apply cons tuple))
- '#+build-inputs))
+ #+(input-tuples->gexp build-inputs))
(define %build-target-inputs
- (map (lambda (tuple)
- (apply cons tuple))
- (append '#$host-inputs '#+target-inputs)))
+ (append #$(input-tuples->gexp host-inputs)
+ #+(input-tuples->gexp target-inputs)))
(define %outputs
- (list #$@(map (lambda (name)
- #~(cons #$name
- (ungexp output name)))
- outputs)))
+ #$(outputs->gexp outputs))
(gnu-build #:source #+source
#:system #$system
diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm
index 2f60f0d..e7d6d96 100644
--- a/guix/build-system/ocaml.scm
+++ b/guix/build-system/ocaml.scm
@@ -260,13 +260,8 @@ provides a 'setup.ml' file as its build system."
(use-modules #$@modules)
(ocaml-build #:source #$source
#:system #$system
- #:outputs (list #$@(map (lambda (name)
- #~(cons #$name
- (ungexp output name)))
- outputs))
- #:inputs (map (lambda (tuple)
- (apply cons tuple))
- '#$inputs)
+ #:outputs #$(outputs->gexp outputs)
+ #:inputs #$(input-tuples->gexp inputs)
#:search-paths '#$(map search-path-specification->sexp
search-paths)
#:phases #$phases
diff --git a/guix/gexp.scm b/guix/gexp.scm
index efa8e57..73eb79b 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -106,6 +106,9 @@
lowered-gexp-load-compiled-path
with-build-variables
+ input-tuples->gexp
+ outputs->gexp
+
gexp->derivation
gexp->file
gexp->script
- 04/29: grafts: Inline 'grafting?' and 'set-grafting'., (continued)
- 04/29: grafts: Inline 'grafting?' and 'set-grafting'., guix-commits, 2021/03/08
- 08/29: gexp: Keep 'lower-inputs' private., guix-commits, 2021/03/08
- 01/29: store: Object cache profiling shows the number of entries., guix-commits, 2021/03/08
- 06/29: gexp: 'gexp-inputs' returns a list of <gexp-input> records., guix-commits, 2021/03/08
- 07/29: gexp: 'gexp-inputs' returns both native and non-native inputs., guix-commits, 2021/03/08
- 11/29: gexp: Reduce allocations in 'gexp-attribute'., guix-commits, 2021/03/08
- 09/29: gexp: Micro-optimize 'gexp->sexp' and 'lower-inputs'., guix-commits, 2021/03/08
- 13/29: gexp: Optimize 'with-build-variables'., guix-commits, 2021/03/08
- 10/29: gexp: Reduce allocations while traversing lists., guix-commits, 2021/03/08
- 20/29: build-system: Use 'sexp->gexp' for plain sexps., guix-commits, 2021/03/08
- 21/29: build-system: Use 'input-tuples->gexp' and 'outputs->gexp'.,
guix-commits <=
- 02/29: store: Micro-optimize object cache lookup., guix-commits, 2021/03/08
- 28/29: grafts: Add 'without-grafting'., guix-commits, 2021/03/08
- 29/29: gexp: Allowed/disallowed references and graphs never refer to grafted inputs., guix-commits, 2021/03/08
- 14/29: build-system: Rewrite using gexps., guix-commits, 2021/03/08
- 15/29: packages: Turn 'bag->derivation' into a monadic procedure., guix-commits, 2021/03/08
- 16/29: packages: Simplify patch instantiation., guix-commits, 2021/03/08
- 25/29: tests: Refer to '%derivation-cache' in the right module., guix-commits, 2021/03/08
- 26/29: packages: 'expand-input' accepts any file-like object., guix-commits, 2021/03/08
- 17/29: packages: Core procedures are written in monadic style., guix-commits, 2021/03/08
- 19/29: gexp: Add 'sexp->gexp'., guix-commits, 2021/03/08