1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages bash)
20 #:use-module (guix licenses)
21 #:use-module (gnu packages ncurses)
22 #:use-module (gnu packages readline)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix utils)
26 #:use-module (guix build-system gnu))
29 (let* ((cppflags (string-join '("-DSYS_BASHRC='\"/etc/bashrc\"'"
30 "-DSYS_BASH_LOGOUT='\"/etc/bash_logout\"'"
31 "-DDEFAULT_PATH_VALUE='\"/no-such-path\"'"
32 "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
33 "-DNON_INTERACTIVE_LOGIN_SHELLS"
34 "-DSSH_SOURCE_BASHRC")
37 ``("--with-installed-readline"
38 ,,(string-append "CPPFLAGS=" cppflags)
40 "LDFLAGS=-Wl,-rpath -Wl,"
41 (assoc-ref %build-inputs "readline")
44 (assoc-ref %build-inputs "ncurses")
47 '(lambda* (#:key outputs #:allow-other-keys)
48 ;; Add a `bash' -> `sh' link.
49 (let ((out (assoc-ref outputs "out")))
50 (with-directory-excursion (string-append out "/bin")
51 (symlink "bash" "sh"))))))
58 "mirror://gnu/bash/bash-" version ".tar.gz"))
61 "1m14s1f61mf6bijfibcjm9y6pkyvz6gibyl8p4hxq90fisi8gimg"))))
62 (build-system gnu-build-system)
63 (inputs `(("readline" ,readline)
64 ("ncurses" ,ncurses))) ; TODO: add texinfo
66 `(;; When cross-compiling, `configure' incorrectly guesses that job
67 ;; control is missing.
68 #:configure-flags ,(if (%current-target-system)
69 `(cons* "bash_cv_job_control_missing=no"
73 ;; Bash is reportedly not parallel-safe. See, for instance,
74 ;; <http://patches.openembedded.org/patch/32745/> and
75 ;; <http://git.buildroot.net/buildroot/commit/?h=79e2d802ae7e376a413c02097790493e1f65c3a4>.
79 ;; XXX: The tests have a lot of hard-coded paths, so disable them
83 #:phases (alist-cons-after 'install 'post-install
86 (synopsis "The GNU Bourne-Again SHell")
88 "Bash is the shell, or command-line interpreter, of the GNU system. It
89 is compatible with the Bourne Shell, but it also integrates useful features
90 from the Korn Shell and the C Shell and new improvements of its own. It
91 allows command-line editing, unlimited command history, shell functions and
92 aliases, and job control while still allowing most sh scripts to be run
93 without modification.")
95 (home-page "http://www.gnu.org/software/bash/"))))
97 (define-public bash-light
98 ;; A stripped-down Bash for non-interactive use.
99 (package (inherit bash)
101 (inputs '()) ; no readline, no curses
103 (let ((args `(#:modules ((guix build gnu-build-system)
107 ,@(package-arguments bash))))
108 (substitute-keyword-arguments args
109 ((#:configure-flags flags)
110 `(list "--without-bash-malloc"
113 "--disable-help-builtin"
115 "--disable-net-redirections"
118 ,@(if (%current-target-system)
119 '("bash_cv_job_control_missing=no")