summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-01-11 22:38:24 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-01-11 22:38:24 +0100
commitb7bf02a418e946b610ef68e8c5131f2350835956 (patch)
tree6d84387279b9870dc0b151bb9d3dce7f9d9de73d /guix/gexp.scm
parent233c1be0a30846f6646b1f4edc6257037d0835fc (diff)
parent13efb24850bc40fab2448771c87c77c9a69fc231 (diff)
downloadpatches-b7bf02a418e946b610ef68e8c5131f2350835956.tar
patches-b7bf02a418e946b610ef68e8c5131f2350835956.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm35
1 files changed, 33 insertions, 2 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index cacc2bf183..8fea42c757 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
@@ -79,6 +79,9 @@
file-append-base
file-append-suffix
+ raw-derivation-file
+ raw-derivation-file?
+
load-path-expression
gexp-modules
@@ -265,6 +268,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.
@@ -1597,7 +1623,12 @@ imported modules in its search path. Look up EXP's modules in MODULE-PATH."
(chmod port #o555))))
#:system system
#:target target
- #:module-path module-path)))
+ #:module-path module-path
+
+ ;; These derivations are not worth offloading or
+ ;; substituting.
+ #:local-build? #t
+ #:substitutable? #f)))
(define* (gexp->file name exp #:key
(set-load-path? #t)