mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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'.
This commit is contained in:
parent
42f118010b
commit
bbceb0ef8a
3 changed files with 15 additions and 2 deletions
|
@ -204,8 +204,7 @@ (define package->job
|
|||
valid."
|
||||
(cond ((member package base-packages)
|
||||
#f)
|
||||
((member system
|
||||
(package-transitive-supported-systems package))
|
||||
((supported-package? package system)
|
||||
(package-job store (job-name package) package system))
|
||||
(else
|
||||
#f)))))
|
||||
|
|
|
@ -95,6 +95,7 @@ (define-module (guix packages)
|
|||
package-grafts
|
||||
|
||||
%supported-systems
|
||||
supported-package?
|
||||
|
||||
&package-error
|
||||
package-error?
|
||||
|
@ -581,6 +582,11 @@ (define-memoized/v (package-transitive-supported-systems package)
|
|||
(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)
|
||||
|
|
|
@ -166,6 +166,14 @@ (define read-at
|
|||
`("does-not-exist" "foobar" ,@%supported-systems)))))
|
||||
(package-transitive-supported-systems p)))
|
||||
|
||||
(test-assert "supported-package?"
|
||||
(let ((p (dummy-package "foo"
|
||||
(build-system gnu-build-system)
|
||||
(supported-systems '("x86_64-linux" "does-not-exist")))))
|
||||
(and (supported-package? p "x86_64-linux")
|
||||
(not (supported-package? p "does-not-exist"))
|
||||
(not (supported-package? p "i686-linux")))))
|
||||
|
||||
(test-skip (if (not %store) 8 0))
|
||||
|
||||
(test-assert "package-source-derivation, file"
|
||||
|
|
Loading…
Reference in a new issue