X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/6e1f8d552b73e508bba47dedb5676ce5ccdcc398..1576acbe09d2adc7e3ca46ade0df8009a26b489a:/gnu/packages.scm diff --git a/gnu/packages.scm b/gnu/packages.scm index acb247e114..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) @@ -46,10 +46,8 @@ #:export (search-patch search-patches search-auxiliary-file - search-bootstrap-binary %patch-path %auxiliary-files-path - %bootstrap-binaries-path %package-module-path %default-package-module-path @@ -75,18 +73,13 @@ ;;; ;;; Code: -;; By default, we store patches, auxiliary files and bootstrap binaries +;; By default, we store patches and auxiliary files ;; alongside Guile modules. This is so that these extra files can be ;; found without requiring a special setup, such as a specific ;; installation directory and an extra environment variable. One ;; advantage of this setup is that everything just works in an ;; auto-compilation setting. -(define %bootstrap-binaries-path - (make-parameter - (map (cut string-append <> "/gnu/packages/bootstrap") - %load-path))) - (define %auxiliary-files-path (make-parameter (map (cut string-append <> "/gnu/packages/aux-files") @@ -108,18 +101,6 @@ FILE-NAME found in %PATCH-PATH." (list (search-patch file-name) ...)) -(define (search-bootstrap-binary file-name system) - "Search the bootstrap binary FILE-NAME for SYSTEM. Raise an error if not -found." - (or (search-path (%bootstrap-binaries-path) - (string-append system "/" file-name)) - (raise (condition - (&message - (message - (format #f (G_ "could not find bootstrap binary '~a' \ -for system '~a'") - file-name system))))))) - (define %distro-root-directory ;; Absolute file name of the module hierarchy. Since (gnu packages …) might ;; live in a directory different from (guix), try to get the best match. @@ -247,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)))) @@ -390,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. @@ -412,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