(address . guix-patches@gnu.org)
This makes it so that new-style inputs can be optional using regular Guile
patterns, e.g. (and (target-x86-64?) rust).
* guix/packages.scm (sanitize-inputs): Filter inputs by identity before adding
labels.
---
Note that this patch was prepared using master, but since it affects the
package record, it needs to go to core-updates. I don' think there should
be a merge conflict here.
guix/packages.scm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Toggle diff (24 lines)
diff --git a/guix/packages.scm b/guix/packages.scm
index 94e464cd01..5bb2e81e18 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -430,11 +430,12 @@ (define %cuirass-supported-systems
(define-inlinable (sanitize-inputs inputs)
"Sanitize INPUTS by turning it into a list of name/package tuples if it's
not already the case."
- (cond ((null? inputs) inputs)
- ((and (pair? (car inputs))
- (string? (caar inputs)))
- inputs)
- (else (map add-input-label inputs))))
+ (let ((inputs (filter identity inputs)))
+ (cond ((null? inputs) inputs)
+ ((and (pair? (car inputs))
+ (string? (caar inputs)))
+ inputs)
+ (else (map add-input-label inputs)))))
(define-syntax current-location-vector
(lambda (s)
--
2.37.2