[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/11: DRAFT gexp: Add 'raw-derivation-file'.
From: |
guix-commits |
Subject: |
03/11: DRAFT gexp: Add 'raw-derivation-file'. |
Date: |
Wed, 11 Dec 2019 18:21:51 -0500 (EST) |
civodul pushed a commit to branch wip-system-bootstrap
in repository guix.
commit 5e0f3d19477fdd7e248c1b3f2dd97a7910ac805f
Author: Ludovic Courtès <address@hidden>
Date: Fri Dec 6 23:12:49 2019 +0100
DRAFT gexp: Add 'raw-derivation-file'.
DRAFT: Add tests.
* guix/gexp.scm (<raw-derivation-file>): New record type.
(raw-derivation-file-compiler): New gexp compiler.
---
guix/gexp.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index a96592a..34df49f 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -78,6 +78,9 @@
file-append-base
file-append-suffix
+ raw-derivation-file
+ raw-derivation-file?
+
load-path-expression
gexp-modules
@@ -264,6 +267,29 @@ The expander specifies how an object is converted to its
sexp representation."
(with-monad %store-monad
(return drv)))
+;; Expand to a raw ".drv" file for the lowerable object it wraps. In other
+;; words, this gives the raw ".drv" file instead of its build result.
+(define-record-type <raw-derivation-file>
+ (raw-derivation-file obj)
+ raw-derivation-file?
+ (obj raw-derivation-file-object)) ;lowerable object
+
+(define-gexp-compiler raw-derivation-file-compiler <raw-derivation-file>
+ compiler => (lambda (obj system target)
+ (mlet %store-monad ((obj (lower-object
+ (raw-derivation-file-object obj)
+ system #:target target)))
+ ;; Returning the .drv file name instead of the <derivation>
+ ;; record ensures that 'lower-gexp' will classify it as a
+ ;; "source" and not as an "input".
+ (return (if (derivation? obj)
+ (derivation-file-name obj)
+ obj))))
+ expander => (lambda (obj lowered output)
+ (if (derivation? lowered)
+ (derivation-file-name lowered)
+ lowered)))
+
;;;
;;; File declarations.
- branch wip-system-bootstrap created (now f97e759), guix-commits, 2019/12/11
- 01/11: utils: 'version-compare' delays 'dynamic-link' code., guix-commits, 2019/12/11
- 03/11: DRAFT gexp: Add 'raw-derivation-file'.,
guix-commits <=
- 02/11: monads: Add portability to Guile 2.0., guix-commits, 2019/12/11
- 04/11: DRAFT gexp: Add 'raw-derivation-closure'., guix-commits, 2019/12/11
- 07/11: guile-build-system: Add #:implicit-inputs., guix-commits, 2019/12/11
- 08/11: gnu: Add guile-hashing., guix-commits, 2019/12/11
- 10/11: DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0., guix-commits, 2019/12/11
- 05/11: DRAFT gexp: Add 'object-sources'., guix-commits, 2019/12/11
- 09/11: bootstrap: Add %bootstrap-guile+guild., guix-commits, 2019/12/11
- 11/11: system: bootstrap: Compute and print the result's hash., guix-commits, 2019/12/11
- 06/11: DRAFT system: Add (gnu system bootstrap)., guix-commits, 2019/12/11