gnu: slang: Update to 2.3.2.
[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 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 (substitute* "configure"
54 (("-ltermcap") ""))
55 #t))))
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.20")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append "https://pagure.io/releases/"
86 name "/" name "-" version ".tar.gz"))
87 (sha256
88 (base32
89 "1g3dpfnvaw7vljbr7nzq1rl88d6r8cmrvvng9inphgzwxxmvlrld"))))
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 uses a hard-coded search of /usr/include/python* to set
104 ;; this variable, and does not allow us to override it from the
105 ;; command line. Fortunately, the Makefile does, so provide it here.
106 (list (string-append "PYTHONVERS=python"
107 ,(version-major+minor (package-version python))))
108 #:phases
109 (modify-phases %standard-phases
110 (add-after
111 'unpack 'patch-/usr/bin/install
112 (lambda _
113 (substitute* "po/Makefile"
114 (("/usr/bin/install") "install"))
115 #t))
116 (add-after
117 'install 'move-python
118 (lambda* (#:key outputs #:allow-other-keys)
119 (let ((out (assoc-ref outputs "out"))
120 (py (assoc-ref outputs "python"))
121 (ver ,(version-major+minor (package-version python))))
122 (mkdir-p (string-append py "/lib"))
123 (rename-file (string-append out "/lib/python" ver)
124 (string-append py "/lib/python" ver))
125 #t))))))
126 (home-page "https://pagure.io/newt")
127 (synopsis "Not Erik's Windowing Toolkit - text mode windowing with slang")
128 (description
129 "Newt is a windowing toolkit for text mode built from the slang library.
130 It allows color text mode applications to easily use stackable windows, push
131 buttons, check boxes, radio buttons, lists, entry fields, labels, and
132 displayable text. Scrollbars are supported, and forms may be nested to
133 provide extra functionality.")
134 (license license:lgpl2.0)))