gnu: Add emacs-slime.
[jackhill/guix/guix.git] / gnu / packages / slang.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages slang)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix utils)
25 #:use-module (guix build-system gnu)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (gnu packages readline)
28 #:use-module (gnu packages ncurses)
29 #:use-module (gnu packages popt)
30 #:use-module (gnu packages fribidi)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages image)
33 #:use-module (gnu packages pcre)
34 #:use-module (gnu packages python))
35
36 (define-public slang
37 (package
38 (name "slang")
39 (version "2.3.0")
40 (source (origin
41 (method url-fetch)
42 (uri (string-append
43 "http://www.jedsoft.org/releases/slang/slang-"
44 version
45 ".tar.gz"))
46 (sha256
47 (base32
48 "0aqd2cjabj6nhd4r3dc4vhqif2bf3dmqnrn2gj0xm4gqyfd177jy"))
49 (modules '((guix build utils)))
50 (snippet
51 '(begin
52 (substitute* "src/Makefile.in"
53 (("/bin/ln") "ln"))
54 (substitute* "configure"
55 (("-ltermcap") ""))))))
56 (build-system gnu-build-system)
57 (arguments
58 '(#:parallel-tests? #f
59 #:parallel-build? #f)) ; there's at least one race
60 (inputs
61 `(("readline" ,readline)
62 ("zlib" ,zlib)
63 ("libpng" ,libpng)
64 ("pcre" ,pcre)
65 ("ncurses" ,ncurses)))
66 (home-page "http://www.jedsoft.org/slang/")
67 (synopsis "Library for interactive applications and extensibility")
68 (description
69 "S-Lang is a multi-platform programmer's library designed to allow a
70 developer to create robust multi-platform software. It provides facilities
71 required by interactive applications such as display/screen management,
72 keyboard input, keymaps, and so on. The most exciting feature of the library
73 is the slang interpreter that may be easily embedded into a program to make it
74 extensible. While the emphasis has always been on the embedded nature of the
75 interpreter, it may also be used in a stand-alone fashion through the use of
76 slsh, which is part of the S-Lang distribution.")
77 (license license:gpl2+)))
78
79 (define-public newt
80 (package
81 (name "newt")
82 (version "0.52.18")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append "https://fedorahosted.org/releases/n/e/"
86 name "/" name "-" version ".tar.gz"))
87 (sha256
88 (base32
89 "07n9f2mqsjfj35wx5ldhvl9sqcjqpcl0g4fdd9mawmny9rihw6vp"))))
90 (build-system gnu-build-system)
91 (outputs '("out" "python"))
92 (inputs
93 `(("slang" ,slang)
94 ("popt" ,popt)
95 ("python" ,python)
96 ("fribidi" ,fribidi)))
97 (arguments
98 `(#:tests? #f ; no test suite
99 #:configure-flags
100 ;; Set the correct RUNPATH in binaries.
101 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
102 #:make-flags
103 ;; configure does not allow us to override this variable from the
104 ;; command-line. Fortunately, the Makefile does, so provide it here.
105 (list (string-append "PYTHONVERS=python"
106 ,(version-major+minor (package-version python))))
107 #:phases
108 (modify-phases %standard-phases
109 (add-after
110 'unpack 'patch-/usr/bin/install
111 (lambda _
112 (substitute* "po/Makefile"
113 (("/usr/bin/install") "install"))
114 #t))
115 (add-after
116 'install 'move-python
117 (lambda* (#:key outputs #:allow-other-keys)
118 (let ((out (assoc-ref outputs "out"))
119 (py (assoc-ref outputs "python"))
120 (ver ,(version-major+minor (package-version python))))
121 (mkdir-p (string-append py "/lib"))
122 (rename-file (string-append out "/lib/python" ver)
123 (string-append py "/lib/python" ver))
124 #t))))))
125 (home-page "https://fedorahosted.org/newt/")
126 (synopsis "Not Erik's Windowing Toolkit - text mode windowing with slang")
127 (description
128 "Newt is a windowing toolkit for text mode built from the slang library.
129 It allows color text mode applications to easily use stackable windows, push
130 buttons, check boxes, radio buttons, lists, entry fields, labels, and
131 displayable text. Scrollbars are supported, and forms may be nested to
132 provide extra functionality.")
133 (license license:lgpl2.0)))