gnu: perl-file-pushd: Update to 1.016.
[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.1a")
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 "0dlcy0hn0j6cj9qj5x6hpb0axifnvzzmv5jqq0wq14fygw0c7w2l"))
48 (modules '((guix build utils)))
49 (snippet
50 '(begin
51 (substitute* "src/Makefile.in"
52 (("/bin/ln") "ln"))
53 (substitute* "configure"
54 (("-ltermcap") ""))))))
55 (build-system gnu-build-system)
56 (arguments
57 '(#:parallel-tests? #f
58 #:parallel-build? #f)) ; there's at least one race
59 (inputs
60 `(("readline" ,readline)
61 ("zlib" ,zlib)
62 ("libpng" ,libpng)
63 ("pcre" ,pcre)
64 ("ncurses" ,ncurses)))
65 (home-page "http://www.jedsoft.org/slang/")
66 (synopsis "Library for interactive applications and extensibility")
67 (description
68 "S-Lang is a multi-platform programmer's library designed to allow a
69 developer to create robust multi-platform software. It provides facilities
70 required by interactive applications such as display/screen management,
71 keyboard input, keymaps, and so on. The most exciting feature of the library
72 is the slang interpreter that may be easily embedded into a program to make it
73 extensible. While the emphasis has always been on the embedded nature of the
74 interpreter, it may also be used in a stand-alone fashion through the use of
75 slsh, which is part of the S-Lang distribution.")
76 (license license:gpl2+)))
77
78 (define-public newt
79 (package
80 (name "newt")
81 (version "0.52.20")
82 (source (origin
83 (method url-fetch)
84 (uri (string-append "https://pagure.io/releases/"
85 name "/" name "-" version ".tar.gz"))
86 (sha256
87 (base32
88 "1g3dpfnvaw7vljbr7nzq1rl88d6r8cmrvvng9inphgzwxxmvlrld"))))
89 (build-system gnu-build-system)
90 (outputs '("out" "python"))
91 (inputs
92 `(("slang" ,slang)
93 ("popt" ,popt)
94 ("python" ,python)
95 ("fribidi" ,fribidi)))
96 (arguments
97 `(#:tests? #f ; no test suite
98 #:configure-flags
99 ;; Set the correct RUNPATH in binaries.
100 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
101 #:make-flags
102 ;; configure uses a hard-coded search of /usr/include/python* to set
103 ;; this variable, and does not allow us to override it 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://pagure.io/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)))