gnu: Add groff.
[jackhill/guix/guix.git] / gnu / packages / readline.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
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.
10 ;;;
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.
15 ;;;
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/>.
18
19 (define-module (gnu packages readline)
20 #:use-module (guix licenses)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages ncurses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix utils)
26 #:use-module (guix build-system gnu))
27
28 (define-public readline
29 (let ((post-install-phase
30 '(lambda* (#:key outputs #:allow-other-keys)
31 (let* ((out (assoc-ref outputs "out"))
32 (lib (string-append out "/lib")))
33 ;; Make libraries writable so that `strip' can work.
34 ;; Failing to do that, it bails out with "Permission
35 ;; denied".
36 (for-each (lambda (f) (chmod f #o755))
37 (find-files lib "\\.so"))
38 (for-each (lambda (f) (chmod f #o644))
39 (find-files lib "\\.a"))))))
40 (package
41 (name "readline")
42 (version "6.2")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "mirror://gnu/readline/readline-"
46 version ".tar.gz"))
47 (sha256
48 (base32
49 "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))
50 (build-system gnu-build-system)
51 (propagated-inputs `(("ncurses" ,ncurses)))
52 (inputs `(("patch/link-ncurses"
53 ,(search-patch "readline-link-ncurses.patch"))))
54 (arguments `(#:patches (list (assoc-ref %build-inputs
55 "patch/link-ncurses"))
56 #:patch-flags '("-p0")
57 #:configure-flags
58 (list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
59 (assoc-ref %build-inputs "ncurses")
60 "/lib"))
61
62 #:phases (alist-cons-after
63 'install 'post-install
64 ,post-install-phase
65 %standard-phases)))
66 (synopsis "GNU Readline, a library for interactive line editing")
67 (description
68 "The GNU Readline library provides a set of functions for use by
69 applications that allow users to edit command lines as they are typed in.
70 Both Emacs and vi editing modes are available. The Readline library includes
71 additional functions to maintain a list of previously-entered command lines,
72 to recall and perhaps reedit those lines, and perform csh-like history
73 expansion on previous commands.
74
75 The history facilites are also placed into a separate library, the History
76 library, as part of the build process. The History library may be used
77 without Readline in applications which desire its capabilities.")
78 (license gpl3+)
79 (home-page "http://savannah.gnu.org/projects/readline/"))))