From 7c3c0374de446af387c8478f77083fd0e357253c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 17 Oct 2014 23:20:39 +0200 Subject: 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. --- guix/packages.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'guix') 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 @@ (define-module (guix packages) 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 @@ (define (package-transitive-propagated-inputs package) 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) -- cgit v1.2.3