Update license headers.
[jackhill/guix/guix.git] / distro / packages / ncurses.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 (distro packages ncurses)
20 #:use-module (guix licenses)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix utils)
24 #:use-module (guix build-system gnu))
25
26 (define-public ncurses
27 (let ((post-install-phase
28 '(lambda* (#:key outputs #:allow-other-keys)
29 (let ((out (assoc-ref outputs "out")))
30 ;; When building a wide-character (Unicode) build, create backward
31 ;; compatibility links from the the "normal" libraries to the
32 ;; wide-character libraries (e.g. libncurses.so to libncursesw.so).
33 (with-directory-excursion (string-append out "/lib")
34 (for-each (lambda (lib)
35 (define libw.a
36 (string-append "lib" lib "w.a"))
37 (define lib.a
38 (string-append "lib" lib ".a"))
39 (define libw.so.x
40 (string-append "lib" lib "w.so.5"))
41 (define lib.so.x
42 (string-append "lib" lib ".so.5"))
43 (define lib.so
44 (string-append "lib" lib ".so"))
45
46 (when (file-exists? libw.a)
47 (format #t "creating symlinks for `lib~a'~%" lib)
48 (symlink libw.a lib.a)
49 (symlink libw.so.x lib.so.x)
50 (false-if-exception (delete-file lib.so))
51 (call-with-output-file lib.so
52 (lambda (p)
53 (format p "INPUT (-l~aw)~%" lib)))))
54 '("curses" "ncurses" "form" "panel" "menu")))))))
55 (package
56 (name "ncurses")
57 (version "5.9")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append "mirror://gnu/ncurses/ncurses-"
61 version ".tar.gz"))
62 (sha256
63 (base32
64 "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"))))
65 (build-system gnu-build-system)
66 (arguments
67 (case-lambda
68 ((system)
69 `(#:configure-flags
70 `("--with-shared" "--without-debug" "--enable-widec"
71
72 ;; By default headers land in an `ncursesw' subdir, which is not
73 ;; what users expect.
74 ,(string-append "--includedir=" (assoc-ref %outputs "out")
75 "/include")
76
77 ;; C++ bindings fail to build on
78 ;; `i386-pc-solaris2.11' with GCC 3.4.3:
79 ;; <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6395191>.
80 ,,@(if (string=? system "i686-solaris")
81 '("--without-cxx-binding")
82 '()))
83 #:tests? #f ; no "check" target
84 #:phases (alist-cons-after 'install 'post-install
85 ,post-install-phase
86 %standard-phases)
87
88 ;; The `ncursesw5-config' has a #!/bin/sh that we don't want to
89 ;; patch, to avoid retaining a reference to the build-time Bash.
90 #:patch-shebangs? #f))
91 ((system cross-system)
92 (arguments cross-system))))
93 (self-native-input? #t)
94 (synopsis
95 "GNU Ncurses, a free software emulation of curses in SVR4 and more")
96 (description
97 "The Ncurses (new curses) library is a free software emulation of curses
98 in System V Release 4.0, and more. It uses Terminfo format, supports pads
99 and color and multiple highlights and forms characters and function-key
100 mapping, and has all the other SYSV-curses enhancements over BSD Curses.
101
102 The ncurses code was developed under GNU/Linux. It has been in use for some
103 time with OpenBSD as the system curses library, and on FreeBSD and NetBSD as
104 an external package. It should port easily to any ANSI/POSIX-conforming
105 UNIX. It has even been ported to OS/2 Warp!")
106 (license x11)
107 (home-page "http://www.gnu.org/software/ncurses/"))))