aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-10-16 10:41:37 +0200
committerLudovic Courtès <ludo@gnu.org>2017-11-21 23:09:16 +0100
commit5f93d97005897c2d859f0be1bdff34c88467ec61 (patch)
tree7300a455807b02f7dd416cbb7b33aad7bd83322e /gnu
parentfe9b3ec3ee208c5bac7844f3d0fecce2c6b1297d (diff)
downloadpatches-5f93d97005897c2d859f0be1bdff34c88467ec61.tar
patches-5f93d97005897c2d859f0be1bdff34c88467ec61.tar.gz
Add (guix self) and use it when pulling.
This mitigates <https://bugs.gnu.org/27284>. * guix/self.scm: New file. * Makefile.am (MODULES): Add it. * build-aux/build-self.scm (libgcrypt, zlib, gzip, bzip2, xz) (false-if-wrong-guile, package-for-current-guile, guile-json) (guile-ssh, guile-git, guile-bytestructures): Remove. (build): Rewrite to simply delegate to 'compiled-guix'. * gnu/packages.scm (%distro-root-directory): Rewrite to try different directories. * guix/discovery.scm (guix): Export 'scheme-files'. * guix/scripts/pull.scm (build-and-install): Split into... (install-latest): ... this. New procedure. And... (build-and-install): ... this, which now takes a monadic value argument. (indirect-root-added): Remove. (guix-pull): Call 'add-indirect-root'. Call 'build-from-source' and pass the result to 'build-and-install'.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages.scm21
1 files changed, 19 insertions, 2 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 97e6cb347f..44a56dfde0 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -110,8 +110,25 @@ for system '~a'")
file-name system)))))))
(define %distro-root-directory
- ;; Absolute file name of the module hierarchy.
- (dirname (search-path %load-path "guix.scm")))
+ ;; Absolute file name of the module hierarchy. Since (gnu packages …) might
+ ;; live in a directory different from (guix), try to get the best match.
+ (letrec-syntax ((dirname* (syntax-rules ()
+ ((_ file)
+ (dirname file))
+ ((_ file head tail ...)
+ (dirname (dirname* file tail ...)))))
+ (try (syntax-rules ()
+ ((_ (file things ...) rest ...)
+ (match (search-path %load-path file)
+ (#f
+ (try rest ...))
+ (absolute
+ (dirname* absolute things ...))))
+ ((_)
+ #f))))
+ (try ("gnu/packages/base.scm" gnu/ packages/)
+ ("gnu/packages.scm" gnu/)
+ ("guix.scm"))))
(define %package-module-path
;; Search path for package modules. Each item must be either a directory