1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages readline)
21 #:use-module (guix licenses)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages ncurses)
24 #:use-module (gnu packages perl)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu))
29 (define-public readline
30 (let ((post-install-phase
31 '(lambda* (#:key outputs #:allow-other-keys)
32 (let* ((out (assoc-ref outputs "out"))
33 (lib (string-append out "/lib")))
34 ;; Make libraries writable so that `strip' can work.
35 ;; Failing to do that, it bails out with "Permission
37 (for-each (lambda (f) (chmod f #o755))
38 (find-files lib "\\.so"))
39 (for-each (lambda (f) (chmod f #o644))
40 (find-files lib "\\.a"))))))
46 (uri (string-append "mirror://gnu/readline/readline-"
50 "0d13sg9ksf982rrrmv5mb6a2p4ys9rvg9r71d6il0vr8hmql63bm"))
51 (patches (search-patches "readline-link-ncurses.patch"))
52 (patch-flags '("-p0"))))
53 (build-system gnu-build-system)
54 (propagated-inputs `(("ncurses" ,ncurses)))
55 (arguments `(#:configure-flags
56 (list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
57 (assoc-ref %build-inputs "ncurses")
60 ;; This test does an 'AC_TRY_RUN', which aborts when
61 ;; cross-compiling, so provide the correct answer.
62 ,@(if (%current-target-system)
63 '("bash_cv_wcwidth_broken=no")
66 #:phases (alist-cons-after
67 'install 'post-install
70 (synopsis "Edit command lines while typing, with history support")
72 "The GNU readline library allows users to edit command lines as they
73 are typed in. It can maintain a searchable history of previously entered
74 commands, letting you easily recall, edit and re-enter past commands. It
75 features both Emacs-like and vi-like keybindings, making its usage
76 comfortable for anyone.")
78 (home-page "http://savannah.gnu.org/projects/readline/"))))
80 (define-public readline-6.2
81 (package (inherit readline)
83 (source (origin (inherit (package-source readline))
85 (uri (string-append "mirror://gnu/readline/readline-"
89 "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))))
98 (uri (string-append "http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-"
102 "0i3yz303wscrysyzpdq04h4nrl9ajz9dbwi80risdl5rkm3dhw2s"))))
103 (build-system gnu-build-system)
104 (native-inputs `(("perl" ,perl)))
106 `(("readline" ,readline)))
107 (synopsis "Wrapper to allow the editing of keyboard commands")
109 "Rlwrap is a 'readline wrapper', a small utility that uses the GNU
110 readline library to allow the editing of keyboard input for any command. You
111 should consider rlwrap especially when you need user-defined completion (by way
112 of completion word lists) and persistent history, or if you want to program
113 'special effects' using the filter mechanism.")
114 (home-page "http://utopia.knoware.nl/~hlub/uck/rlwrap/")