summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-07-20 22:23:15 +0200
committerLudovic Courtès <ludo@gnu.org>2016-07-20 22:53:02 +0200
commit13cee334f1a31e7d8f7124d045b136106fe8d356 (patch)
tree74af2900ae0ef80b8b752c51481e47f0b3abcf38 /guix
parent0b0086e94c68769bfcada7c2b3b426873aac8efc (diff)
pull: Install (guix config) module to override the user's one.
* build-aux/build-self.scm (zlib, gzip, bzip2, xz): New variables. (build)[storedir, localstatedir, sysconfdir, sbindir]: New variables. [builder]: Pass them to 'build-guix'. * guix/build/pull.scm (build-guix): Add #:system, #:storedir, #:localstatedir, #:sysconfdir, #:sbindir, #:package-name, #:package-version, #:bug-report-address, #:home-page-url, #:libgcrypt, #:zlib, #:gzip, #:bzip2, and #:xz. Remove #:gcrypt. Instantiate all the substitution variables in (guix config). Remove code to delete OUT/guix/config.{scm,go}. * guix/config.scm.in: Add note about (guix script pull).
Diffstat (limited to 'guix')
-rw-r--r--guix/build/pull.scm39
-rw-r--r--guix/config.scm.in3
2 files changed, 31 insertions, 11 deletions
diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 4ddb12ac04..ccf1868516 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;;
;;; This file is part of GNU Guix.
@@ -36,7 +36,17 @@
;;; Code:
(define* (build-guix out source
- #:key gcrypt
+ #:key
+ system
+ storedir localstatedir sysconfdir sbindir
+
+ (package-name "GNU Guix")
+ (package-version "0")
+ (bug-report-address "bug-guix@gnu.org")
+ (home-page-url "https://gnu.org/s/guix")
+
+ libgcrypt zlib gzip bzip2 xz
+
(debug-port (%make-void-port "w"))
(log-port (current-error-port)))
"Build and install Guix in directory OUT using SOURCE, a directory
@@ -55,13 +65,26 @@ containing the source code. Write any debugging output to DEBUG-PORT."
(copy-file "guix.scm" (string-append out "/guix.scm"))
(copy-file "gnu.scm" (string-append out "/gnu.scm"))
- ;; Add a fake (guix config) module to allow the other modules to be
- ;; compiled. The user's (guix config) is the one that will be used.
+ ;; Instantiate a (guix config) module that preserves the original
+ ;; settings.
(copy-file "guix/config.scm.in"
(string-append out "/guix/config.scm"))
(substitute* (string-append out "/guix/config.scm")
- (("@LIBGCRYPT@")
- (string-append gcrypt "/lib/libgcrypt")))
+ (("@PACKAGE_NAME@") package-name)
+ (("@PACKAGE_VERSION@") package-version)
+ (("@PACKAGE_BUGREPORT@") bug-report-address)
+ (("@PACKAGE_URL@") home-page-url)
+ (("@storedir@") storedir)
+ (("@guix_localstatedir@") localstatedir)
+ (("@guix_sysconfdir@") sysconfdir)
+ (("@guix_sbindir@") sbindir)
+ (("@guix_system@") system)
+ (("@LIBGCRYPT@") (string-append libgcrypt "/lib/libgcrypt"))
+ (("@LIBZ@") (string-append zlib "/lib/libz"))
+ (("@GZIP@") (string-append gzip "/bin/gzip"))
+ (("@BZIP2@") (string-append bzip2 "/bin/bzip2"))
+ (("@XZ@") (string-append xz "/bin/xz"))
+ (("@NIX_INSTANTIATE@") "")) ;remnants from the past
;; Augment the search path so Scheme code can be compiled.
(set! %load-path (cons out %load-path))
@@ -119,10 +142,6 @@ containing the source code. Write any debugging output to DEBUG-PORT."
(set! completed (+ 1 completed))))
files))))
- ;; Remove the "fake" (guix config).
- (delete-file (string-append out "/guix/config.scm"))
- (delete-file (string-append out "/guix/config.go"))
-
(newline)
#t)
diff --git a/guix/config.scm.in b/guix/config.scm.in
index 7a420401ce..8f2c4abd8e 100644
--- a/guix/config.scm.in
+++ b/guix/config.scm.in
@@ -42,7 +42,8 @@
;;; Commentary:
;;;
-;;; Compile-time configuration of Guix.
+;;; Compile-time configuration of Guix. When adding a substitution variable
+;;; here, make sure to equip (guix scripts pull) to substitute it.
;;;
;;; Code: