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