summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-09-17 10:04:15 +0200
committerLudovic Courtès <ludo@gnu.org>2018-09-21 17:04:37 +0200
commiteee8b303f6d82c1400fd8fd3b097406358ed7875 (patch)
tree425e55c2f106990c92606c770d958c461a46ec58 /guix
parent6030396aec325b3c3287a472014bc2d530abb99d (diff)
inferior: Add 'inferior-package-search-paths' & co.
* guix/inferior.scm (%inferior-package-search-paths) (inferior-package-native-search-paths) (inferior-package-search-paths) (inferior-package-transitive-native-search-paths): New procedures. * tests/inferior.scm ("inferior-package-search-paths"): New test.
Diffstat (limited to 'guix')
-rw-r--r--guix/inferior.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index ca819c6eff..3fa4930095 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -32,6 +32,7 @@
#:use-module ((guix derivations)
#:select (read-derivation-from-file))
#:use-module (guix gexp)
+ #:use-module (guix search-paths)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
@@ -58,6 +59,9 @@
inferior-package-native-inputs
inferior-package-propagated-inputs
inferior-package-transitive-propagated-inputs
+ inferior-package-native-search-paths
+ inferior-package-transitive-native-search-paths
+ inferior-package-search-paths
inferior-package-derivation))
;;; Commentary:
@@ -322,6 +326,28 @@ inferior package."
(define inferior-package-transitive-propagated-inputs
(cut inferior-package-input-field <> 'package-transitive-propagated-inputs))
+(define (%inferior-package-search-paths package field)
+ "Return the list of search path specificiations of PACKAGE, an inferior
+package."
+ (define paths
+ (inferior-package-field package
+ `(compose (lambda (paths)
+ (map (@ (guix search-paths)
+ search-path-specification->sexp)
+ paths))
+ ,field)))
+
+ (map sexp->search-path-specification paths))
+
+(define inferior-package-native-search-paths
+ (cut %inferior-package-search-paths <> 'package-native-search-paths))
+
+(define inferior-package-search-paths
+ (cut %inferior-package-search-paths <> 'package-search-paths))
+
+(define inferior-package-transitive-native-search-paths
+ (cut %inferior-package-search-paths <> 'package-transitive-native-search-paths))
+
(define (proxy client backend) ;adapted from (guix ssh)
"Proxy communication between CLIENT and BACKEND until CLIENT closes the
connection, at which point CLIENT is closed (both CLIENT and BACKEND must be