gnu: ocaml-linenoise: Update to 1.4.0.
[jackhill/guix/guix.git] / gnu / packages / slang.scm
CommitLineData
e9257d37
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
cac8bc38 3;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
e5930e5a 4;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
3928f69d 5;;; Copyright © 2018, 2019, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
e9257d37
LC
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)
3928f69d 25 #:use-module (guix gexp)
e5930e5a 26 #:use-module (guix utils)
e9257d37
LC
27 #:use-module (guix build-system gnu)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (gnu packages readline)
30 #:use-module (gnu packages ncurses)
cac8bc38
MW
31 #:use-module (gnu packages popt)
32 #:use-module (gnu packages fribidi)
e9257d37
LC
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages image)
e5930e5a
EB
35 #:use-module (gnu packages pcre)
36 #:use-module (gnu packages python))
e9257d37
LC
37
38(define-public slang
39 (package
40 (name "slang")
eb87b634 41 (version "2.3.2")
e9257d37
LC
42 (source (origin
43 (method url-fetch)
61faf24d
TGR
44 (uri (string-append "http://www.jedsoft.org/releases/slang/slang-"
45 version ".tar.bz2"))
e9257d37
LC
46 (sha256
47 (base32
eb87b634 48 "06p379fqn6w38rdpqi98irxi2bf4llb0rja3dlgkqz7nqh7kp7pw"))
e9257d37
LC
49 (modules '((guix build utils)))
50 (snippet
479d9ea0
TGR
51 #~(begin
52 (substitute* "src/Makefile.in"
53 (("/bin/ln") "ln"))))))
e9257d37
LC
54 (build-system gnu-build-system)
55 (arguments
479d9ea0
TGR
56 (list #:parallel-tests? #f
57 #:parallel-build? #f ; race to build/use elfobj
58 #:phases
59 #~(modify-phases %standard-phases
60 (add-after 'unpack 'reduce-array-test-size
61 ;; Fix array.sl/array.slc failure on 32-bit systems ("Unable to
62 ;; to create a multi-dimensional array of the desired size").
63 (lambda _
64 (substitute* "src/test/array.sl"
65 (("10000,10000,10000,10000,10000,10000")
66 "10,10,10,10,10,10"))))
67 (add-before 'configure 'fix-configure-script
68 ;; Don't try to link to the long-obsolete (and gone) -ltermcap.
69 (lambda _
70 (substitute* "configure"
71 (("(MISC_TERMINFO_DIRS)=.*" _ variable)
72 (format #f "~a=\"~a/share/terminfo\"\n" variable
73 #$(this-package-input "ncurses")))))))))
e9257d37 74 (inputs
8394619b 75 (list readline zlib libpng pcre ncurses))
77dbc1c5 76 (home-page "https://www.jedsoft.org/slang/")
e9257d37
LC
77 (synopsis "Library for interactive applications and extensibility")
78 (description
79 "S-Lang is a multi-platform programmer's library designed to allow a
e881752c 80developer to create robust multi-platform software. It provides facilities
e9257d37 81required by interactive applications such as display/screen management,
e881752c 82keyboard input, keymaps, and so on. The most exciting feature of the library
e9257d37 83is the slang interpreter that may be easily embedded into a program to make it
e881752c 84extensible. While the emphasis has always been on the embedded nature of the
e9257d37
LC
85interpreter, it may also be used in a stand-alone fashion through the use of
86slsh, which is part of the S-Lang distribution.")
87 (license license:gpl2+)))
cac8bc38 88
3928f69d
TGR
89(define-public most
90 (package
91 (name "most")
92 (version "5.1.0")
93 (source
94 (origin
95 (method url-fetch)
96 (uri (string-append "http://www.jedsoft.org/releases/most/most-"
97 version ".tar.gz"))
98 (sha256
99 (base32 "008537ns659pw2aag15imwjrxj73j26aqq90h285is6kz8gmv06v"))
100 (modules '((guix build utils)))
101 (snippet
102 #~(begin
103 (substitute* "src/Makefile.in"
104 (("/bin/cp") "cp"))))))
105 (build-system gnu-build-system)
106 (arguments
107 (list #:configure-flags
108 #~(list (string-append "--with-slang="
109 #$(this-package-input "slang")))
110 #:tests? #f ; no test suite
111 #:phases
112 #~(modify-phases %standard-phases
113 (add-before 'configure 'fix-configure-script
114 ;; Don't try to link to the long-obsolete (and gone) -ltermcap.
115 (lambda _
116 (substitute* "configure"
117 (("(MISC_TERMINFO_DIRS)=.*" _ variable)
118 (format #f "~a=\"~a/share/terminfo\"\n" variable
119 #$(this-package-input "ncurses")))))))))
120 (inputs
121 (list ncurses slang))
122 (home-page "https://www.jedsoft.org/most/")
123 (synopsis
124 "@dfn{Pager} (terminal text viewer) with multiple windows and filters")
125 (description
126 "Most is a paging text viewer. It displays the contents of a file or the
127output of a command on the terminal, one screenful at a time, and lets you
128scroll up and down to (re)view the entire text.
129
130You can open multiple windows within @command{most} to view different files, or
131to inspect different parts of the same file, at the same time.")
132 (license license:gpl2+)))
133
cac8bc38
MW
134(define-public newt
135 (package
136 (name "newt")
de7f9b23 137 (version "0.52.21")
cac8bc38
MW
138 (source (origin
139 (method url-fetch)
9828859c
TGR
140 (uri (string-append "https://pagure.io/releases/newt/"
141 "newt-" version ".tar.gz"))
cac8bc38
MW
142 (sha256
143 (base32
de7f9b23 144 "0cdvbancr7y4nrj8257y5n45hmhizr8isynagy4fpsnpammv8pi6"))))
cac8bc38 145 (build-system gnu-build-system)
e5930e5a 146 (outputs '("out" "python"))
cac8bc38 147 (inputs
8394619b 148 (list slang popt python fribidi))
cac8bc38 149 (arguments
c0e713f6
JPDJD
150 (list
151 #:tests? #f ; no test suite
cac8bc38
MW
152 #:configure-flags
153 ;; Set the correct RUNPATH in binaries.
c0e713f6 154 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
e5930e5a 155 #:make-flags
982dab0b
TGR
156 ;; configure uses a hard-coded search of /usr/include/python* to set
157 ;; this variable, and does not allow us to override it from the
158 ;; command line. Fortunately, the Makefile does, so provide it here.
c0e713f6
JPDJD
159 #~(list
160 (string-append "PYTHONVERS=python"
161 #$(version-major+minor (package-version python))))
cac8bc38 162 #:phases
c0e713f6
JPDJD
163 #~(modify-phases %standard-phases
164 (add-after 'unpack 'patch-/usr/bin/install
165 (lambda _
166 (substitute* "po/Makefile"
167 (("/usr/bin/install") "install"))))
168 (add-before 'build 'add-python-config-to-path
169 (lambda* (#:key target #:allow-other-keys)
170 ;; When cross-compiling python-config is not present in $PATH.
171 ;;
172 ;; It is a shell script without dependencies on target binaries
173 ;; so it can be run on the host to allow cross-compilation.
174 (when target
175 (let ((path (getenv "PATH"))
176 (py (string-append #$python "/bin")))
177 (setenv "PATH" (string-append path ":" py))))))
178 (add-after 'install 'move-python
179 (lambda* _
180 (let ((ver #$(version-major+minor (package-version python))))
181 (mkdir-p (string-append #$output:python "/lib"))
182 (rename-file
183 (string-append #$output "/lib/python" ver)
184 (string-append #$output:python "/lib/python" ver))))))))
65375f74 185 (home-page "https://pagure.io/newt")
cac8bc38
MW
186 (synopsis "Not Erik's Windowing Toolkit - text mode windowing with slang")
187 (description
188 "Newt is a windowing toolkit for text mode built from the slang library.
189It allows color text mode applications to easily use stackable windows, push
190buttons, check boxes, radio buttons, lists, entry fields, labels, and
191displayable text. Scrollbars are supported, and forms may be nested to
192provide extra functionality.")
193 (license license:lgpl2.0)))