X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/6cb1ef9ea28ee14b3bb5442e8af1f54c27802f09..24297a9a9cc36de88ed2a6d30ba2ed9acc34407b:/gnu/packages.scm diff --git a/gnu/packages.scm b/gnu/packages.scm index 2d7622d397..d22c992bb1 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2016, 2017 Alex Kost @@ -30,12 +30,12 @@ #:select ((package-name->name+version . hyphen-separated-name->name+version) mkdir-p)) - #:autoload (guix profiles) (packages->manifest) + #:use-module (guix profiles) #:use-module (guix describe) #:use-module (guix deprecation) #:use-module (ice-9 vlist) #:use-module (ice-9 match) - #:autoload (ice-9 binary-ports) (put-bytevector) + #:use-module (ice-9 binary-ports) #:autoload (system base compile) (compile) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) @@ -228,9 +228,7 @@ package module." #:outputs (package-outputs package) #:location (package-location package) #:supported? - (->bool - (member (%current-system) - (package-supported-systems package))) + (->bool (supported-package? package)) #:deprecated? (->bool (package-superseded package)))) @@ -371,6 +369,9 @@ VERSION." (string=? (package-version p) highest)) matches)))))) +;; Prevent Guile 3 from inlining this procedure so we can mock it in tests. +(set! find-best-packages-by-name find-best-packages-by-name) + (define (generate-package-cache directory) "Generate under DIRECTORY a cache of all the available packages. @@ -393,9 +394,7 @@ reducing the memory footprint." ,(module-name module) ,symbol ,(package-outputs package) - ,(->bool - (member (%current-system) - (package-supported-systems package))) + ,(->bool (supported-package? package)) ,(->bool (package-superseded package)) ,@(let ((loc (package-location package))) (if loc @@ -515,14 +514,18 @@ optionally contain a version number and an output name, as in these examples: guile@2.0.9:debug If SPEC does not specify a version number, return the preferred newest -version; if SPEC does not specify an output, return OUTPUT." +version; if SPEC does not specify an output, return OUTPUT. + +When OUTPUT is false and SPEC does not specify any output, return #f as the +output." (let-values (((name version sub-drv) (package-specification->name+version+output spec output))) (match (%find-package spec name version) (#f (values #f #f)) (package - (if (member sub-drv (package-outputs package)) + (if (or (and (not output) (not sub-drv)) + (member sub-drv (package-outputs package))) (values package sub-drv) (leave (G_ "package `~a' lacks output `~a'~%") (package-full-name package)