diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2018-03-23 15:36:12 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2018-04-08 17:41:08 +0200 |
| commit | eaae07ec2878707744fed76029a28ab9a494fc2e (patch) | |
| tree | 6c2cd2dfec1d1f2aa951dcc66907d0c1cbfac137 /gnu | |
| parent | 278c16579dfe59833155b1e7678a727e60fa6540 (diff) | |
Add (guix self).
* guix/self.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/packages.scm (%distro-root-directory): Rewrite to try different
directories.
* guix/discovery.scm (guix): Export 'scheme-files'.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages.scm | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm index 97e6cb347f2..44a56dfde07 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm | |||
| @@ -110,8 +110,25 @@ for system '~a'") | |||
| 110 | file-name system))))))) | 110 | file-name system))))))) |
| 111 | 111 | ||
| 112 | (define %distro-root-directory | 112 | (define %distro-root-directory |
| 113 | ;; Absolute file name of the module hierarchy. | 113 | ;; Absolute file name of the module hierarchy. Since (gnu packages …) might |
| 114 | (dirname (search-path %load-path "guix.scm"))) | 114 | ;; live in a directory different from (guix), try to get the best match. |
| 115 | (letrec-syntax ((dirname* (syntax-rules () | ||
| 116 | ((_ file) | ||
| 117 | (dirname file)) | ||
| 118 | ((_ file head tail ...) | ||
| 119 | (dirname (dirname* file tail ...))))) | ||
| 120 | (try (syntax-rules () | ||
| 121 | ((_ (file things ...) rest ...) | ||
| 122 | (match (search-path %load-path file) | ||
| 123 | (#f | ||
| 124 | (try rest ...)) | ||
| 125 | (absolute | ||
| 126 | (dirname* absolute things ...)))) | ||
| 127 | ((_) | ||
| 128 | #f)))) | ||
| 129 | (try ("gnu/packages/base.scm" gnu/ packages/) | ||
| 130 | ("gnu/packages.scm" gnu/) | ||
| 131 | ("guix.scm")))) | ||
| 115 | 132 | ||
| 116 | (define %package-module-path | 133 | (define %package-module-path |
| 117 | ;; Search path for package modules. Each item must be either a directory | 134 | ;; Search path for package modules. Each item must be either a directory |
