summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-19 16:49:09 +0200
committerLudovic Courtès <ludo@gnu.org>2015-04-19 23:34:53 +0200
commitbbceb0ef8a1e05faaa15c5b4135275fb4572b8d9 (patch)
tree07b08a952584b1413678f856ba8d1e7ca48741d6 /guix/packages.scm
parent42f118010be14b761144efccae9bdeb33a3db212 (diff)
downloadgnu-guix-bbceb0ef8a1e05faaa15c5b4135275fb4572b8d9.tar
gnu-guix-bbceb0ef8a1e05faaa15c5b4135275fb4572b8d9.tar.gz
packages: Add 'supported-package?'.
* guix/packages.scm (supported-package?): New procedure. * tests/packages.scm ("supported-package?"): New test. * build-aux/hydra/gnu-system.scm (package->job): Use it instead of 'package-transitive-supported-systems'.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 8ebe8d06b5..fde46d5d6a 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -95,6 +95,7 @@
package-grafts
%supported-systems
+ supported-package?
&package-error
package-error?
@@ -581,6 +582,11 @@ supported by its dependencies."
(package-supported-systems package)
(bag-direct-inputs (package->bag package))))
+(define* (supported-package? package #:optional (system (%current-system)))
+ "Return true if PACKAGE is supported on SYSTEM--i.e., if PACKAGE and all its
+dependencies are known to build on SYSTEM."
+ (member system (package-transitive-supported-systems package)))
+
(define (bag-direct-inputs bag)
"Same as 'package-direct-inputs', but applied to a bag."
(append (bag-build-inputs bag)