diff options
Diffstat (limited to 'build-aux/build-self.scm')
-rw-r--r-- | build-aux/build-self.scm | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 5898b6515c..bd285bcedd 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -53,7 +53,7 @@ (define %dependency-variables ;; (guix config) variables corresponding to dependencies. - '(%libgcrypt %libz %xz %gzip %bzip2 %nix-instantiate)) + '(%libgcrypt %libz %xz %gzip %bzip2)) (define %persona-variables ;; (guix config) variables that define Guix's persona. @@ -63,17 +63,14 @@ %guix-home-page-url)) (define %config-variables - ;; (guix config) variables corresponding to Guix configuration (storedir, - ;; localstatedir, etc.) - (sort (filter pair? - (module-map (lambda (name var) - (and (not (memq name %dependency-variables)) - (not (memq name %persona-variables)) - (cons name (variable-ref var)))) - (resolve-interface '(guix config)))) - (lambda (name+value1 name+value2) - (string<? (symbol->string (car name+value1)) - (symbol->string (car name+value2)))))) + ;; (guix config) variables corresponding to Guix configuration. + (letrec-syntax ((variables (syntax-rules () + ((_) + '()) + ((_ variable rest ...) + (cons `(variable . ,variable) + (variables rest ...)))))) + (variables %localstatedir %storedir %sysconfdir %system))) (define* (make-config.scm #:key libgcrypt zlib gzip xz bzip2 (package-name "GNU Guix") @@ -91,12 +88,15 @@ %guix-version %guix-bug-report-address %guix-home-page-url + %store-directory + %state-directory + %store-database-directory + %config-directory %libgcrypt %libz %gzip %bzip2 - %xz - %nix-instantiate)) + %xz)) ;; XXX: Work around <http://bugs.gnu.org/15602>. (eval-when (expand load eval) @@ -105,6 +105,26 @@ #~(define-public #$name #$value))) %config-variables) + (define %store-directory + (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path) + %storedir)) + + (define %state-directory + ;; This must match `NIX_STATE_DIR' as defined in + ;; `nix/local.mk'. + (or (getenv "NIX_STATE_DIR") + (string-append %localstatedir "/guix"))) + + (define %store-database-directory + (or (getenv "NIX_DB_DIR") + (string-append %state-directory "/db"))) + + (define %config-directory + ;; This must match `GUIX_CONFIGURATION_DIRECTORY' as + ;; defined in `nix/local.mk'. + (or (getenv "GUIX_CONFIGURATION_DIRECTORY") + (string-append %sysconfdir "/guix"))) + (define %guix-package-name #$package-name) (define %guix-version #$package-version) (define %guix-bug-report-address #$bug-report-address) @@ -122,10 +142,7 @@ (file-append libgcrypt "/lib/libgcrypt"))) (define %libz #+(and zlib - (file-append zlib "/lib/libz"))) - - (define %nix-instantiate ;for (guix import snix) - "nix-instantiate"))))) + (file-append zlib "/lib/libz"))))))) ;;; |