gnu: bash: Fix cross-compilation.

* gnu/packages/bash.scm (bash): Pass "bash_cv_job_control_missing=no"
  when (%current-target-system) is true.
master
Ludovic Courtès 2013-05-26 22:48:22 +02:00
parent aa289a3e82
commit 9a97b8144d
1 changed files with 33 additions and 24 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -26,19 +26,29 @@
#:use-module (guix build-system gnu)) #:use-module (guix build-system gnu))
(define-public bash (define-public bash
(let ((cppflags (string-join '("-DSYS_BASHRC='\"/etc/bashrc\"'" (let* ((cppflags (string-join '("-DSYS_BASHRC='\"/etc/bashrc\"'"
"-DSYS_BASH_LOGOUT='\"/etc/bash_logout\"'" "-DSYS_BASH_LOGOUT='\"/etc/bash_logout\"'"
"-DDEFAULT_PATH_VALUE='\"/no-such-path\"'" "-DDEFAULT_PATH_VALUE='\"/no-such-path\"'"
"-DSTANDARD_UTILS_PATH='\"/no-such-path\"'" "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
"-DNON_INTERACTIVE_LOGIN_SHELLS" "-DNON_INTERACTIVE_LOGIN_SHELLS"
"-DSSH_SOURCE_BASHRC") "-DSSH_SOURCE_BASHRC")
" ")) " "))
(post-install-phase (configure-flags
'(lambda* (#:key outputs #:allow-other-keys) ``("--with-installed-readline"
;; Add a `bash' -> `sh' link. ,,(string-append "CPPFLAGS=" cppflags)
(let ((out (assoc-ref outputs "out"))) ,(string-append
(with-directory-excursion (string-append out "/bin") "LDFLAGS=-Wl,-rpath -Wl,"
(symlink "bash" "sh")))))) (assoc-ref %build-inputs "readline")
"/lib"
" -Wl,-rpath -Wl,"
(assoc-ref %build-inputs "ncurses")
"/lib")))
(post-install-phase
'(lambda* (#:key outputs #:allow-other-keys)
;; Add a `bash' -> `sh' link.
(let ((out (assoc-ref outputs "out")))
(with-directory-excursion (string-append out "/bin")
(symlink "bash" "sh"))))))
(package (package
(name "bash") (name "bash")
(version "4.2") (version "4.2")
@ -53,15 +63,12 @@
(inputs `(("readline" ,readline) (inputs `(("readline" ,readline)
("ncurses" ,ncurses))) ; TODO: add texinfo ("ncurses" ,ncurses))) ; TODO: add texinfo
(arguments (arguments
`(#:configure-flags `("--with-installed-readline" `(;; When cross-compiling, `configure' incorrectly guesses that job
,,(string-append "CPPFLAGS=" cppflags) ;; control is missing.
,(string-append #:configure-flags ,(if (%current-target-system)
"LDFLAGS=-Wl,-rpath -Wl," `(cons* "bash_cv_job_control_missing=no"
(assoc-ref %build-inputs "readline") ,configure-flags)
"/lib" configure-flags)
" -Wl,-rpath -Wl,"
(assoc-ref %build-inputs "ncurses")
"/lib"))
;; Bash is reportedly not parallel-safe. See, for instance, ;; Bash is reportedly not parallel-safe. See, for instance,
;; <http://patches.openembedded.org/patch/32745/> and ;; <http://patches.openembedded.org/patch/32745/> and
@ -75,7 +82,9 @@
#:phases (alist-cons-after 'install 'post-install #:phases (alist-cons-after 'install 'post-install
,post-install-phase ,post-install-phase
%standard-phases))) ,(if (%current-target-system)
'%standard-cross-phases
'%standard-phases))))
(synopsis "The GNU Bourne-Again SHell") (synopsis "The GNU Bourne-Again SHell")
(description (description
"Bash is the shell, or command language interpreter, that will appear in "Bash is the shell, or command language interpreter, that will appear in