diff options
| -rw-r--r-- | gnu/packages.scm | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm index 0aa289d56c0..10ca3bb314d 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2013 Mark H Weaver <mhw@netris.org> | 3 | ;;; Copyright © 2013 Mark H Weaver <mhw@netris.org> |
| 4 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> | 4 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> |
| 5 | ;;; Copyright © 2016 Alex Kost <alezost@gmail.com> | 5 | ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com> |
| 6 | ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> | 6 | ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> |
| 7 | ;;; | 7 | ;;; |
| 8 | ;;; This file is part of GNU Guix. | 8 | ;;; This file is part of GNU Guix. |
| @@ -40,8 +40,10 @@ | |||
| 40 | #:use-module (srfi srfi-39) | 40 | #:use-module (srfi srfi-39) |
| 41 | #:export (search-patch | 41 | #:export (search-patch |
| 42 | search-patches | 42 | search-patches |
| 43 | search-auxiliary-file | ||
| 43 | search-bootstrap-binary | 44 | search-bootstrap-binary |
| 44 | %patch-path | 45 | %patch-path |
| 46 | %auxiliary-files-path | ||
| 45 | %bootstrap-binaries-path | 47 | %bootstrap-binaries-path |
| 46 | %package-module-path | 48 | %package-module-path |
| 47 | 49 | ||
| @@ -62,17 +64,27 @@ | |||
| 62 | ;;; | 64 | ;;; |
| 63 | ;;; Code: | 65 | ;;; Code: |
| 64 | 66 | ||
| 65 | ;; By default, we store patches and bootstrap binaries alongside Guile | 67 | ;; By default, we store patches, auxiliary files and bootstrap binaries |
| 66 | ;; modules. This is so that these extra files can be found without | 68 | ;; alongside Guile modules. This is so that these extra files can be |
| 67 | ;; requiring a special setup, such as a specific installation directory | 69 | ;; found without requiring a special setup, such as a specific |
| 68 | ;; and an extra environment variable. One advantage of this setup is | 70 | ;; installation directory and an extra environment variable. One |
| 69 | ;; that everything just works in an auto-compilation setting. | 71 | ;; advantage of this setup is that everything just works in an |
| 72 | ;; auto-compilation setting. | ||
| 70 | 73 | ||
| 71 | (define %bootstrap-binaries-path | 74 | (define %bootstrap-binaries-path |
| 72 | (make-parameter | 75 | (make-parameter |
| 73 | (map (cut string-append <> "/gnu/packages/bootstrap") | 76 | (map (cut string-append <> "/gnu/packages/bootstrap") |
| 74 | %load-path))) | 77 | %load-path))) |
| 75 | 78 | ||
| 79 | (define %auxiliary-files-path | ||
| 80 | (make-parameter | ||
| 81 | (map (cut string-append <> "/gnu/packages/aux-files") | ||
| 82 | %load-path))) | ||
| 83 | |||
| 84 | (define (search-auxiliary-file file-name) | ||
| 85 | "Search the auxiliary FILE-NAME. Return #f if not found." | ||
| 86 | (search-path (%auxiliary-files-path) file-name)) | ||
| 87 | |||
| 76 | (define (search-patch file-name) | 88 | (define (search-patch file-name) |
| 77 | "Search the patch FILE-NAME. Raise an error if not found." | 89 | "Search the patch FILE-NAME. Raise an error if not found." |
| 78 | (or (search-path (%patch-path) file-name) | 90 | (or (search-path (%patch-path) file-name) |
