distro: bash, readline: Patch so that `make' uses the right shell.
* distro/packages/readline.scm (readline): Add `pre-configure-phase' to patch `MAKE_SHELL' in `configure. Move `post-install-phase' body to a variable. * distro/packages/bash.scm (bash): Likewise.master
parent
c20313637f
commit
530c169561
|
@ -32,7 +32,20 @@
|
||||||
"-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")
|
||||||
" ")))
|
" "))
|
||||||
|
(pre-configure-phase
|
||||||
|
'(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
;; Use the right shell for makefiles.
|
||||||
|
(let ((bash (assoc-ref inputs "bash")))
|
||||||
|
(substitute* "configure"
|
||||||
|
(("MAKE_SHELL=[^ ]+")
|
||||||
|
(format #f "MAKE_SHELL=~a/bin/bash" bash))))))
|
||||||
|
(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")
|
||||||
|
@ -67,15 +80,12 @@
|
||||||
;; for now.
|
;; for now.
|
||||||
#:tests? #f
|
#:tests? #f
|
||||||
|
|
||||||
#:phases
|
#:phases (alist-cons-before
|
||||||
(alist-cons-after 'install 'post-install
|
'configure 'pre-configure
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
,pre-configure-phase
|
||||||
;; Add a `bash' -> `sh' link.
|
(alist-cons-after 'install 'post-install
|
||||||
(let ((out (assoc-ref outputs "out")))
|
,post-install-phase
|
||||||
(with-directory-excursion
|
%standard-phases))))
|
||||||
(string-append out "/bin")
|
|
||||||
(symlink "bash" "sh"))))
|
|
||||||
%standard-phases)))
|
|
||||||
(synopsis "GNU Bourne-Again Shell")
|
(synopsis "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
|
||||||
|
|
|
@ -26,44 +26,56 @@
|
||||||
#:use-module (guix build-system gnu))
|
#:use-module (guix build-system gnu))
|
||||||
|
|
||||||
(define-public readline
|
(define-public readline
|
||||||
(package
|
(let ((post-install-phase
|
||||||
(name "readline")
|
'(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(version "6.2")
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
(source (origin
|
(lib (string-append out "/lib")))
|
||||||
(method url-fetch)
|
;; Make libraries writable so that `strip' can work.
|
||||||
(uri (string-append "mirror://gnu/readline/readline-"
|
;; Failing to do that, it bails out with "Permission
|
||||||
version ".tar.gz"))
|
;; denied".
|
||||||
(sha256
|
(for-each (lambda (f) (chmod f #o755))
|
||||||
(base32
|
(find-files lib "\\.so"))
|
||||||
"10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))
|
(for-each (lambda (f) (chmod f #o644))
|
||||||
(build-system gnu-build-system)
|
(find-files lib "\\.a")))))
|
||||||
(propagated-inputs `(("ncurses" ,ncurses)))
|
(pre-configure-phase
|
||||||
(inputs `(("patch/link-ncurses"
|
'(lambda* (#:key inputs #:allow-other-keys)
|
||||||
,(search-patch "readline-link-ncurses.patch"))))
|
;; Use the right shell for makefiles.
|
||||||
(arguments `(#:patches (list (assoc-ref %build-inputs
|
(let ((bash (assoc-ref inputs "bash")))
|
||||||
"patch/link-ncurses"))
|
(substitute* "configure"
|
||||||
#:patch-flags '("-p0")
|
(("^MAKE_SHELL=.*")
|
||||||
#:configure-flags
|
(format #f "MAKE_SHELL=~a/bin/bash" bash)))))))
|
||||||
(list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
|
(package
|
||||||
(assoc-ref %build-inputs "ncurses")
|
(name "readline")
|
||||||
"/lib"))
|
(version "6.2")
|
||||||
|
(source (origin
|
||||||
|
(method url-fetch)
|
||||||
|
(uri (string-append "mirror://gnu/readline/readline-"
|
||||||
|
version ".tar.gz"))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))
|
||||||
|
(build-system gnu-build-system)
|
||||||
|
(propagated-inputs `(("ncurses" ,ncurses)))
|
||||||
|
(inputs `(("patch/link-ncurses"
|
||||||
|
,(search-patch "readline-link-ncurses.patch"))))
|
||||||
|
(arguments `(#:patches (list (assoc-ref %build-inputs
|
||||||
|
"patch/link-ncurses"))
|
||||||
|
#:patch-flags '("-p0")
|
||||||
|
#:configure-flags
|
||||||
|
(list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
|
||||||
|
(assoc-ref %build-inputs "ncurses")
|
||||||
|
"/lib"))
|
||||||
|
|
||||||
#:phases (alist-cons-after
|
#:phases (alist-cons-after
|
||||||
'install 'post-install
|
'install 'post-install
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
,post-install-phase
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(alist-cons-before
|
||||||
(lib (string-append out "/lib")))
|
'configure 'pre-configure
|
||||||
;; Make libraries writable so that `strip' can
|
,pre-configure-phase
|
||||||
;; work. Failing to do that, it bails out with
|
%standard-phases))))
|
||||||
;; "Permission denied".
|
(synopsis "GNU Readline, a library for interactive line editing")
|
||||||
(for-each (lambda (f) (chmod f #o755))
|
(description
|
||||||
(find-files lib "\\.so"))
|
"The GNU Readline library provides a set of functions for use by
|
||||||
(for-each (lambda (f) (chmod f #o644))
|
|
||||||
(find-files lib "\\.a"))))
|
|
||||||
%standard-phases)))
|
|
||||||
(synopsis "GNU Readline, a library for interactive line editing")
|
|
||||||
(description
|
|
||||||
"The GNU Readline library provides a set of functions for use by
|
|
||||||
applications that allow users to edit command lines as they are typed in.
|
applications that allow users to edit command lines as they are typed in.
|
||||||
Both Emacs and vi editing modes are available. The Readline library includes
|
Both Emacs and vi editing modes are available. The Readline library includes
|
||||||
additional functions to maintain a list of previously-entered command lines,
|
additional functions to maintain a list of previously-entered command lines,
|
||||||
|
@ -73,5 +85,5 @@ expansion on previous commands.
|
||||||
The history facilites are also placed into a separate library, the History
|
The history facilites are also placed into a separate library, the History
|
||||||
library, as part of the build process. The History library may be used
|
library, as part of the build process. The History library may be used
|
||||||
without Readline in applications which desire its capabilities.")
|
without Readline in applications which desire its capabilities.")
|
||||||
(license gpl3+)
|
(license gpl3+)
|
||||||
(home-page "http://savannah.gnu.org/projects/readline/")))
|
(home-page "http://savannah.gnu.org/projects/readline/"))))
|
||||||
|
|
Reference in New Issue