aboutsummaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-10-17 23:20:39 +0200
committerLudovic Courtès <ludo@gnu.org>2014-10-17 23:23:21 +0200
commit7c3c0374de446af387c8478f77083fd0e357253c (patch)
tree96901f0b59c5bd7127ec010f541959dd5d47c28f /guix/packages.scm
parent67a86d3b8d17b921728eec7776677582cfdd9266 (diff)
downloadgnu-guix-7c3c0374de446af387c8478f77083fd0e357253c.tar
gnu-guix-7c3c0374de446af387c8478f77083fd0e357253c.tar.gz
packages: Add 'package-transitive-supported-systems'.
* guix/packages.scm (package-transitive-supported-systems): New procedure. * tests/packages.scm ("package-transitive-supported-systems"): New test. * build-aux/hydra/gnu-system.scm (package->job): Use it.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 070eb4e9d5..97a82a4682 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -80,6 +80,7 @@
package-transitive-target-inputs
package-transitive-native-inputs
package-transitive-propagated-inputs
+ package-transitive-supported-systems
package-source-derivation
package-derivation
package-cross-derivation
@@ -537,6 +538,17 @@ for the host system (\"native inputs\"), and not target inputs."
recursively."
(transitive-inputs (package-propagated-inputs package)))
+(define (package-transitive-supported-systems package)
+ "Return the intersection of the systems supported by PACKAGE and those
+supported by its dependencies."
+ (apply lset-intersection string=?
+ (package-supported-systems package)
+ (filter-map (match-lambda
+ ((label (? package? p) . rest)
+ (package-supported-systems p))
+ (_ #f))
+ (package-transitive-inputs package))))
+
(define (bag-transitive-inputs bag)
"Same as 'package-transitive-inputs', but applied to a bag."
(transitive-inputs (append (bag-build-inputs bag)