gnu: Use synopses from the Womb.
[jackhill/guix/guix.git] / gnu / packages / ncurses.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
4050e5d6 2;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
c44899a2 3;;;
233e7676 4;;; This file is part of GNU Guix.
c44899a2 5;;;
233e7676 6;;; GNU Guix is free software; you can redistribute it and/or modify it
c44899a2
LC
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;;;
233e7676 11;;; GNU Guix is distributed in the hope that it will be useful, but
c44899a2
LC
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
233e7676 17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
c44899a2 18
1ffa7090 19(define-module (gnu packages ncurses)
4a44e743 20 #:use-module (guix licenses)
c44899a2 21 #:use-module (guix packages)
87f5d366 22 #:use-module (guix download)
c44899a2
LC
23 #:use-module (guix build-system gnu))
24
25(define-public ncurses
49f5a216
LC
26 (let ((patch-makefile-phase
27 '(lambda _
feddc16c
LC
28 (for-each patch-makefile-SHELL
29 (find-files "." "Makefile.in"))))
30 (configure-phase
31 '(lambda* (#:key inputs outputs configure-flags
32 #:allow-other-keys)
33 ;; The `ncursesw5-config' has a #!/bin/sh. We want to patch
34 ;; it to point to libc's embedded Bash, to avoid retaining a
35 ;; reference to the bootstrap Bash.
36 (let* ((libc (assoc-ref inputs "libc"))
37 (bash (string-append libc "/bin/bash"))
38 (out (assoc-ref outputs "out")))
39 (format #t "configure flags: ~s~%" configure-flags)
40 (zero? (apply system* bash "./configure"
41 (string-append "SHELL=" bash)
42 (string-append "CONFIG_SHELL=" bash)
43 (string-append "--prefix=" out)
44 configure-flags)))))
49f5a216 45 (post-install-phase
c44899a2
LC
46 '(lambda* (#:key outputs #:allow-other-keys)
47 (let ((out (assoc-ref outputs "out")))
48 ;; When building a wide-character (Unicode) build, create backward
49 ;; compatibility links from the the "normal" libraries to the
50 ;; wide-character libraries (e.g. libncurses.so to libncursesw.so).
51 (with-directory-excursion (string-append out "/lib")
52 (for-each (lambda (lib)
53 (define libw.a
54 (string-append "lib" lib "w.a"))
55 (define lib.a
56 (string-append "lib" lib ".a"))
57 (define libw.so.x
58 (string-append "lib" lib "w.so.5"))
59 (define lib.so.x
60 (string-append "lib" lib ".so.5"))
61 (define lib.so
62 (string-append "lib" lib ".so"))
63
64 (when (file-exists? libw.a)
65 (format #t "creating symlinks for `lib~a'~%" lib)
66 (symlink libw.a lib.a)
67 (symlink libw.so.x lib.so.x)
68 (false-if-exception (delete-file lib.so))
69 (call-with-output-file lib.so
70 (lambda (p)
71 (format p "INPUT (-l~aw)~%" lib)))))
72 '("curses" "ncurses" "form" "panel" "menu")))))))
73 (package
74 (name "ncurses")
75 (version "5.9")
76 (source (origin
87f5d366 77 (method url-fetch)
0db342a5 78 (uri (string-append "mirror://gnu/ncurses/ncurses-"
c44899a2
LC
79 version ".tar.gz"))
80 (sha256
81 (base32
82 "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"))))
83 (build-system gnu-build-system)
84 (arguments
21c203a5
LC
85 `(#:configure-flags
86 `("--with-shared" "--without-debug" "--enable-widec"
c44899a2 87
21c203a5
LC
88 ;; By default headers land in an `ncursesw' subdir, which is not
89 ;; what users expect.
90 ,(string-append "--includedir=" (assoc-ref %outputs "out")
91 "/include")
c44899a2 92
21c203a5
LC
93 ;; C++ bindings fail to build on
94 ;; `i386-pc-solaris2.11' with GCC 3.4.3:
95 ;; <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6395191>.
96 ,,@(if (string=? (%current-system) "i686-solaris")
97 '("--without-cxx-binding")
98 '()))
99 #:tests? #f ; no "check" target
100 #:phases (alist-cons-after
101 'install 'post-install ,post-install-phase
102 (alist-cons-before
103 'configure 'patch-makefile-SHELL
104 ,patch-makefile-phase
105 (alist-replace
106 'configure
107 ,configure-phase
108 %standard-phases)))))
c44899a2 109 (self-native-input? #t)
f50d2669 110 (synopsis "Terminal emulation (termcap, terminfo) library")
c44899a2
LC
111 (description
112 "The Ncurses (new curses) library is a free software emulation of curses
113in System V Release 4.0, and more. It uses Terminfo format, supports pads
114and color and multiple highlights and forms characters and function-key
115mapping, and has all the other SYSV-curses enhancements over BSD Curses.
116
117The ncurses code was developed under GNU/Linux. It has been in use for some
118time with OpenBSD as the system curses library, and on FreeBSD and NetBSD as
119an external package. It should port easily to any ANSI/POSIX-conforming
120UNIX. It has even been ported to OS/2 Warp!")
4a44e743 121 (license x11)
c44899a2 122 (home-page "http://www.gnu.org/software/ncurses/"))))