gnu: miniupnpc: Update to 2.0.
[jackhill/guix/guix.git] / gnu / packages / readline.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
f6d47eb6 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
a2285798 3;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
c44899a2 4;;;
233e7676 5;;; This file is part of GNU Guix.
c44899a2 6;;;
233e7676 7;;; GNU Guix is free software; you can redistribute it and/or modify it
c44899a2
LC
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.
11;;;
233e7676 12;;; GNU Guix is distributed in the hope that it will be useful, but
c44899a2
LC
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.
16;;;
17;;; You should have received a copy of the GNU General Public License
233e7676 18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
c44899a2 19
1ffa7090 20(define-module (gnu packages readline)
4a44e743 21 #:use-module (guix licenses)
59a43334 22 #:use-module (gnu packages)
1ffa7090 23 #:use-module (gnu packages ncurses)
a2285798 24 #:use-module (gnu packages perl)
c44899a2 25 #:use-module (guix packages)
87f5d366 26 #:use-module (guix download)
c44899a2
LC
27 #:use-module (guix build-system gnu))
28
29(define-public readline
530c1695
LC
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
36 ;; denied".
37 (for-each (lambda (f) (chmod f #o755))
38 (find-files lib "\\.so"))
39 (for-each (lambda (f) (chmod f #o644))
c0895112 40 (find-files lib "\\.a"))))))
530c1695
LC
41 (package
42 (name "readline")
0c64d856 43 (version "7.0")
530c1695
LC
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://gnu/readline/readline-"
47 version ".tar.gz"))
48 (sha256
49 (base32
0c64d856 50 "0d13sg9ksf982rrrmv5mb6a2p4ys9rvg9r71d6il0vr8hmql63bm"))
fc1adab1 51 (patches (search-patches "readline-link-ncurses.patch"))
de80b504 52 (patch-flags '("-p0"))))
530c1695
LC
53 (build-system gnu-build-system)
54 (propagated-inputs `(("ncurses" ,ncurses)))
de80b504 55 (arguments `(#:configure-flags
530c1695
LC
56 (list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
57 (assoc-ref %build-inputs "ncurses")
f6d47eb6
LC
58 "/lib")
59
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")
64 '()))
4500581a 65
530c1695
LC
66 #:phases (alist-cons-after
67 'install 'post-install
68 ,post-install-phase
56c092ce 69 %standard-phases)))
f50d2669 70 (synopsis "Edit command lines while typing, with history support")
530c1695 71 (description
79c311b8 72 "The GNU readline library allows users to edit command lines as they
a22dc0c4
LC
73are typed in. It can maintain a searchable history of previously entered
74commands, letting you easily recall, edit and re-enter past commands. It
75features both Emacs-like and vi-like keybindings, making its usage
76comfortable for anyone.")
530c1695
LC
77 (license gpl3+)
78 (home-page "http://savannah.gnu.org/projects/readline/"))))
50322c84
LC
79
80(define-public readline-6.2
81 (package (inherit readline)
82 (version "6.2")
83 (source (origin (inherit (package-source readline))
84 (method url-fetch)
85 (uri (string-append "mirror://gnu/readline/readline-"
86 version ".tar.gz"))
d9721bcf
LF
87 (patches (search-patches "readline-6.2-CVE-2014-2524.patch"))
88 (patch-flags '("-p0"))
50322c84
LC
89 (sha256
90 (base32
91 "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))))
a2285798
EF
92
93(define-public rlwrap
94 (package
95 (name "rlwrap")
96 (version "0.42")
97 (source
98 (origin
99 (method url-fetch)
100 (uri (string-append "http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-"
101 version ".tar.gz"))
102 (sha256
103 (base32
104 "0i3yz303wscrysyzpdq04h4nrl9ajz9dbwi80risdl5rkm3dhw2s"))))
105 (build-system gnu-build-system)
106 (native-inputs `(("perl" ,perl)))
107 (inputs
108 `(("readline" ,readline)))
109 (synopsis "Wrapper to allow the editing of keyboard commands")
110 (description
111 "Rlwrap is a 'readline wrapper', a small utility that uses the GNU
112readline library to allow the editing of keyboard input for any command. You
113should consider rlwrap especially when you need user-defined completion (by way
114of completion word lists) and persistent history, or if you want to program
115'special effects' using the filter mechanism.")
116 (home-page "http://utopia.knoware.nl/~hlub/uck/rlwrap/")
117 (license gpl2+)))