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