summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-13 23:38:32 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-13 23:38:32 +0100
commit9d1d434cd07d8a0372b113c2c0efacd2eb6e258a (patch)
tree593ef61debceb015a049e6c2f021a0582fad2b45 /guix
parentcb1427dd0835379fa1e05af87c1c6ea585d478e3 (diff)
downloadguix-patches-9d1d434cd07d8a0372b113c2c0efacd2eb6e258a.tar
guix-patches-9d1d434cd07d8a0372b113c2c0efacd2eb6e258a.tar.gz
build-system/gnu: Avoid using /bin/sh.
* guix/build/gnu-build-system.scm (configure): Add `inputs' keyword parameter. Take Bash from there, falling back to /bin/sh. Set `CONFIG_SHELL' and `SHELL' to that Bash. Run "bash ./configure" instead of just "./configure". * distro/packages/bootstrap.scm (%bootstrap-inputs): Add "bash". * distro/packages/base.scm (gcc-boot0-wrapped): Use "bash" from %BOOT1-INPUTS instead of /bin/sh.
Diffstat (limited to 'guix')
-rw-r--r--guix/build/gnu-build-system.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 2b7d1c180e..efee570292 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -90,12 +90,17 @@
(append patch-flags (list "--input" p)))))
patches))
-(define* (configure #:key outputs (configure-flags '()) out-of-source?
+(define* (configure #:key inputs outputs (configure-flags '()) out-of-source?
#:allow-other-keys)
(let* ((prefix (assoc-ref outputs "out"))
(libdir (assoc-ref outputs "lib"))
(includedir (assoc-ref outputs "include"))
- (flags `(,(string-append "--prefix=" prefix)
+ (bash (or (and=> (assoc-ref inputs "bash")
+ (cut string-append <> "/bin/bash"))
+ "/bin/sh"))
+ (flags `(,(string-append "CONFIG_SHELL=" bash)
+ ,(string-append "SHELL=" bash)
+ ,(string-append "--prefix=" prefix)
"--enable-fast-install" ; when using Libtool
;; Produce multiple outputs when specific output names
@@ -121,10 +126,15 @@
(format #t "build directory: ~s~%" (getcwd))
(format #t "configure flags: ~s~%" flags)
+ ;; Use BASH to reduce reliance on /bin/sh since it may not always be
+ ;; reliable (see
+ ;; <http://thread.gmane.org/gmane.linux.distributions.nixos/9748>
+ ;; for a summary of the situation.)
+ ;;
;; Call `configure' with a relative path. Otherwise, GCC's build system
;; (for instance) records absolute source file names, which typically
;; contain the hash part of the `.drv' file, leading to a reference leak.
- (zero? (apply system*
+ (zero? (apply system* bash
(string-append srcdir "/configure")
flags))))