summaryrefslogtreecommitdiff
path: root/guix/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-03-17 21:46:00 +0100
committerLudovic Courtès <ludo@gnu.org>2015-03-17 22:25:55 +0100
commit9d8100f4c7d9f44a3623419039ac985be7ba9bb3 (patch)
tree2acde3a2bd38fb2e71c988cefa83b6654235f586 /guix/derivations.scm
parentbcb132876370fc2e51ea9ba137b92932e9e956e4 (diff)
packages: Move grafting parameter to (guix derivations).
* guix/packages.scm (%graft?, set-grafting): Move to... * guix/derivations.scm: ... here.
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r--guix/derivations.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index e5922365a0..4b0048b54b 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -97,6 +97,9 @@
build-derivations
built-derivations
+ %graft?
+ set-grafting
+
build-expression->derivation)
;; Re-export it from here for backward compatibility.
@@ -1287,3 +1290,16 @@ ALLOWED-REFERENCES, and LOCAL-BUILD?."
(define built-derivations
(store-lift build-derivations))
+
+;; The following might feel more at home in (guix packages) but since (guix
+;; gexp), which is a lower level, needs them, we put them here.
+
+(define %graft?
+ ;; Whether to honor package grafts by default.
+ (make-parameter #t))
+
+(define (set-grafting enable?)
+ "This monadic procedure enables grafting when ENABLE? is true, and disables
+it otherwise. It returns the previous setting."
+ (lambda (store)
+ (values (%graft? enable?) store)))