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, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
22 (define-module (gnu packages slang)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix gexp)
26 #:use-module (guix utils)
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)
31 #:use-module (gnu packages popt)
32 #:use-module (gnu packages fribidi)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages image)
35 #:use-module (gnu packages pcre)
36 #:use-module (gnu packages python))
44 (uri (string-append "http://www.jedsoft.org/releases/slang/slang-"
48 "06p379fqn6w38rdpqi98irxi2bf4llb0rja3dlgkqz7nqh7kp7pw"))
49 (modules '((guix build utils)))
52 (substitute* "src/Makefile.in"
53 (("/bin/ln") "ln"))))))
54 (build-system gnu-build-system)
56 (list #:parallel-tests? #f
57 #:parallel-build? #f ; race to build/use elfobj
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").
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.
70 (substitute* "configure"
71 (("(MISC_TERMINFO_DIRS)=.*" _ variable)
72 (format #f "~a=\"~a/share/terminfo\"\n" variable
73 #$(this-package-input "ncurses")))))))))
75 (list readline zlib libpng pcre ncurses))
76 (home-page "https://www.jedsoft.org/slang/")
77 (synopsis "Library for interactive applications and extensibility")
79 "S-Lang is a multi-platform programmer's library designed to allow a
80 developer to create robust multi-platform software. It provides facilities
81 required by interactive applications such as display/screen management,
82 keyboard input, keymaps, and so on. The most exciting feature of the library
83 is the slang interpreter that may be easily embedded into a program to make it
84 extensible. While the emphasis has always been on the embedded nature of the
85 interpreter, it may also be used in a stand-alone fashion through the use of
86 slsh, which is part of the S-Lang distribution.")
87 (license license:gpl2+)))
96 (uri (string-append "http://www.jedsoft.org/releases/most/most-"
99 (base32 "008537ns659pw2aag15imwjrxj73j26aqq90h285is6kz8gmv06v"))
100 (modules '((guix build utils)))
103 (substitute* "src/Makefile.in"
104 (("/bin/cp") "cp"))))))
105 (build-system gnu-build-system)
107 (list #:configure-flags
108 #~(list (string-append "--with-slang="
109 #$(this-package-input "slang")))
110 #:tests? #f ; no test suite
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.
116 (substitute* "configure"
117 (("(MISC_TERMINFO_DIRS)=.*" _ variable)
118 (format #f "~a=\"~a/share/terminfo\"\n" variable
119 #$(this-package-input "ncurses")))))))))
121 (list ncurses slang))
122 (home-page "https://www.jedsoft.org/most/")
124 "@dfn{Pager} (terminal text viewer) with multiple windows and filters")
126 "Most is a paging text viewer. It displays the contents of a file or the
127 output of a command on the terminal, one screenful at a time, and lets you
128 scroll up and down to (re)view the entire text.
130 You can open multiple windows within @command{most} to view different files, or
131 to inspect different parts of the same file, at the same time.")
132 (license license:gpl2+)))
140 (uri (string-append "https://pagure.io/releases/newt/"
141 "newt-" version ".tar.gz"))
144 "0cdvbancr7y4nrj8257y5n45hmhizr8isynagy4fpsnpammv8pi6"))))
145 (build-system gnu-build-system)
146 (outputs '("out" "python"))
148 (list slang popt python fribidi))
151 #:tests? #f ; no test suite
153 ;; Set the correct RUNPATH in binaries.
154 #~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
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.
160 (string-append "PYTHONVERS=python"
161 #$(version-major+minor (package-version python))))
163 #~(modify-phases %standard-phases
164 (add-after 'unpack 'patch-/usr/bin/install
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.
172 ;; It is a shell script without dependencies on target binaries
173 ;; so it can be run on the host to allow cross-compilation.
175 (let ((path (getenv "PATH"))
176 (py (string-append #$python "/bin")))
177 (setenv "PATH" (string-append path ":" py))))))
178 (add-after 'install 'move-python
180 (let ((ver #$(version-major+minor (package-version python))))
181 (mkdir-p (string-append #$output:python "/lib"))
183 (string-append #$output "/lib/python" ver)
184 (string-append #$output:python "/lib/python" ver))))))))
185 (home-page "https://pagure.io/newt")
186 (synopsis "Not Erik's Windowing Toolkit - text mode windowing with slang")
188 "Newt is a windowing toolkit for text mode built from the slang library.
189 It allows color text mode applications to easily use stackable windows, push
190 buttons, check boxes, radio buttons, lists, entry fields, labels, and
191 displayable text. Scrollbars are supported, and forms may be nested to
192 provide extra functionality.")
193 (license license:lgpl2.0)))