Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / terminals.scm
CommitLineData
6a7e1a18 1;;; GNU Guix --- Functional package management for GNU
97600613 2;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
89978a0a 3;;; Copyright © 2016 Mckinley Olsen <mck.olsen@gmail.com>
98b9732c 4;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
af39609b 5;;; Copyright © 2016 David Craven <david@craven.ch>
c2ffcc44 6;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
abe2ec73 7;;; Copyright © 2016, 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
ed3094ce 8;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
90bf2608 9;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
f2b7be09 10;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
f9ff014b 11;;; Copyright © 2017 Petter <petter@mykolab.ch>
46ddcf4a 12;;; Copyright © 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
6a7e1a18
EF
13;;;
14;;; This file is part of GNU Guix.
15;;;
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages terminals)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix build utils)
90bf2608 32 #:use-module (guix build-system cmake)
6a7e1a18 33 #:use-module (guix build-system gnu)
99e28bbf 34 #:use-module (guix build-system glib-or-gtk)
d0c2f81c 35 #:use-module (guix build-system go)
cb55f9c6 36 #:use-module (guix build-system python)
6a7e1a18 37 #:use-module (guix download)
89978a0a 38 #:use-module (guix git-download)
6a7e1a18 39 #:use-module (guix packages)
f9ff014b 40 #:use-module (gnu packages)
6a7e1a18 41 #:use-module (gnu packages autotools)
46ddcf4a 42 #:use-module (gnu packages check)
78a81e37 43 #:use-module (gnu packages docbook)
e8bb4336 44 #:use-module (gnu packages freedesktop)
6a7e1a18 45 #:use-module (gnu packages gettext)
e8bb4336 46 #:use-module (gnu packages gl)
6a7e1a18
EF
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages gtk)
e8bb4336 50 #:use-module (gnu packages linux)
78a81e37 51 #:use-module (gnu packages ncurses)
db913ac4 52 #:use-module (gnu packages perl)
5ccde207 53 #:use-module (gnu packages perl-check)
6a7e1a18 54 #:use-module (gnu packages pkg-config)
cb55f9c6 55 #:use-module (gnu packages python)
589e3f4e 56 #:use-module (gnu packages python-web)
78a81e37 57 #:use-module (gnu packages qt)
cf71edee 58 #:use-module (gnu packages textutils)
89978a0a 59 #:use-module (gnu packages wm)
78325fa8 60 #:use-module (gnu packages xdisorg)
7326944b 61 #:use-module (gnu packages xml)
90bf2608 62 #:use-module (gnu packages xorg)
78325fa8 63 #:use-module (srfi srfi-26))
6a7e1a18
EF
64
65(define-public tilda
66 (package
67 (name "tilda")
97600613 68 (version "1.4.1")
6a7e1a18
EF
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "https://github.com/lanoxx/tilda/archive/"
d2a52108 72 "tilda-" version ".tar.gz"))
6a7e1a18
EF
73 (sha256
74 (base32
97600613 75 "0w2hry2bqcqrkik4l100b1a9jlsih6sq8zwhfpl8zzfq20i00lfs"))))
99e28bbf 76 (build-system glib-or-gtk-build-system)
6a7e1a18 77 (arguments
97600613
EF
78 '(#:phases (modify-phases %standard-phases
79 (add-before 'patch-source-shebangs 'bootstrap
80 (lambda _
81 (setenv "NOCONFIGURE" "true")
82 (invoke "sh" "autogen.sh"))))))
6a7e1a18
EF
83 (native-inputs
84 `(("autoconf" ,autoconf)
85 ("automake" ,automake)
b94a6ca0 86 ("gettext" ,gettext-minimal)
d2a52108 87 ("pkg-config" ,pkg-config)))
6a7e1a18 88 (inputs
99e28bbf 89 `(("libconfuse" ,libconfuse)
d2a52108 90 ("vte" ,vte)))
6a7e1a18
EF
91 (synopsis "GTK+-based drop-down terminal")
92 (description "Tilda is a terminal emulator similar to normal terminals like
93gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
94from the edge of a screen when a certain configurable hotkey is pressed. This
95is similar to the built-in consoles in some applications. Tilda is highly
d1e4ad1b 96configurable through a graphical wizard.")
6a7e1a18
EF
97 (home-page "https://github.com/lanoxx/tilda")
98 (license license:gpl2+)))
89978a0a
MO
99
100(define-public termite
101 (package
102 (name "termite")
98bd11cf 103 (version "13")
89978a0a
MO
104 (source
105 (origin
106 (method git-fetch)
107 (uri (git-reference
108 (url (string-append "https://github.com/thestinger/"
109 name ".git"))
110 (commit (string-append "v" version))
111 (recursive? #t)))
112 (file-name (string-append name "-" version "-checkout"))
113 (sha256
ebe3515f 114 (base32
98bd11cf 115 "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj"))))
89978a0a
MO
116 (build-system gnu-build-system)
117 (arguments
66bb5db7
EF
118 `(#:phases
119 (modify-phases %standard-phases
120 (delete 'configure))
89978a0a
MO
121 #:tests? #f
122 ;; This sets the destination when installing the necessary terminal
123 ;; capability data, which are not provided by 'ncurses'. See
124 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
125 #:make-flags (list "PREFIX="
126 (string-append "VERSION=v" (version))
127 (string-append "DESTDIR="
128 (assoc-ref %outputs "out")))))
129 (inputs
c695fb76
TGR
130 `(("vte" ,vte-ng)
131 ("gtk+" ,gtk+)
132 ("ncurses" ,ncurses)))
89978a0a
MO
133 (native-inputs
134 `(("pkg-config" ,pkg-config)))
135
136 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
137 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
138 (native-search-paths
139 (list (search-path-specification
140 (variable "TERMINFO_DIRS")
141 (files '("share/terminfo")))))
142 (home-page "https://github.com/thestinger/termite/")
143 (synopsis "Keyboard-centric, VTE-based terminal")
144 (description "Termite is a minimal terminal emulator designed for use with
145tiling window managers. It is a modal application, similar to Vim, with an
146insert mode and command mode where keybindings have different functions.")
147
148 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
149 (license license:lgpl2.0+)))
cb55f9c6
AG
150
151(define-public asciinema
152 (package
153 (name "asciinema")
98b9732c 154 (version "1.4.0")
cb55f9c6
AG
155 (source
156 (origin
157 (method url-fetch)
98b9732c 158 (uri (pypi-uri "asciinema" version))
cb55f9c6
AG
159 (sha256
160 (base32
98b9732c 161 "1jrf8c8711gkdilmvyv3d37kp8xfvdc5cqighw5k92a6g9z4acgv"))))
cb55f9c6
AG
162 (build-system python-build-system)
163 (arguments
164 `(#:phases
165 (modify-phases %standard-phases
166 (add-before 'build 'patch-exec-paths
167 (lambda* (#:key inputs #:allow-other-keys)
168 (let ((ncurses (assoc-ref inputs "ncurses")))
169 (substitute* "asciinema/recorder.py"
170 (("'tput'")
171 (string-append "'" ncurses "/bin/tput'"))))
172 #t)))))
f3b98f4f 173 (inputs `(("ncurses" ,ncurses)))
39d0de33
MB
174 (native-inputs
175 ;; For tests.
176 `(("python-requests" ,python-requests)))
cb55f9c6
AG
177 (home-page "https://asciinema.org")
178 (synopsis "Terminal session recorder")
179 (description
180 "Use asciinema to record and share your terminal sessions, the right way.
181Forget screen recording apps and blurry video. Enjoy a lightweight, purely
182text-based approach to terminal recording.")
183 (license license:gpl3)))
af39609b
DC
184
185(define-public libtsm
186 (package
187 (name "libtsm")
188 (version "3")
189 (source (origin
190 (method url-fetch)
191 (uri (string-append
192 "https://freedesktop.org/software/kmscon/releases/"
193 "libtsm-" version ".tar.xz"))
194 (sha256
195 (base32
196 "01ygwrsxfii0pngfikgqsb4fxp8n1bbs47l7hck81h9b9bc1ah8i"))))
197 (build-system gnu-build-system)
198 (native-inputs
199 `(("pkg-config" ,pkg-config)))
200 (inputs
201 `(("libxkbcommon" ,libxkbcommon)))
202 (synopsis "Xterm state machine library")
203 (description "TSM is a state machine for DEC VT100-VT520 compatible
204terminal emulators. It tries to support all common standards while keeping
205compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
206 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
d7af202b
DC
207 ;; Hash table implementation is lgpl2.1+ licensed.
208 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
209 ;; derived from ISC.
210 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
211 ;; under the bsd 2 license.
212 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2))))
e8bb4336
DC
213
214(define-public kmscon
215 (package
216 (name "kmscon")
217 (version "8")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append
221 "https://freedesktop.org/software/kmscon/releases/"
222 "kmscon-" version ".tar.xz"))
223 (sha256
224 (base32
5acf00f9
LC
225 "0axfwrp3c8f4gb67ap2sqnkn75idpiw09s35wwn6kgagvhf1rc0a"))
226 (modules '((guix build utils)))
227 (snippet
228 ;; Use elogind instead of systemd.
229 '(begin
230 (substitute* "configure"
231 (("libsystemd-daemon libsystemd-login")
232 "libelogind"))
233 (substitute* "src/uterm_systemd.c"
234 (("#include <systemd/sd-login.h>")
235 "#include <elogind/sd-login.h>")
236 ;; We don't have this header.
237 (("#include <systemd/sd-daemon\\.h>")
238 "")
239 ;; Replace the call to 'sd_booted' by the truth value.
240 (("sd_booted\\(\\)")
6cbee49d
MW
241 "1"))
242 #t))))
e8bb4336
DC
243 (build-system gnu-build-system)
244 (native-inputs
7326944b
LC
245 `(("pkg-config" ,pkg-config)
246 ("libxslt" ,libxslt) ;to build the man page
247 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
248 ("docbook-xsl" ,docbook-xsl)))
e8bb4336 249 (inputs
c2ffcc44 250 `(("libdrm" ,libdrm)
e8bb4336
DC
251 ("libtsm" ,libtsm)
252 ("libxkbcommon" ,libxkbcommon)
253 ("logind" ,elogind)
254 ("mesa" ,mesa)
255 ("pango" ,pango)
256 ("udev" ,eudev)))
78325fa8
LC
257 (synopsis "Linux KMS-based terminal emulator")
258 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
259mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
260implementation with a user-space console. Compared to the Linux console,
261kmscon provides enhanced features including XKB-compatible internationalized
262keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
263multi-seat support, a replacement for @command{mingetty}, and more.")
e8bb4336 264 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
3eb2fca6
DC
265 ;; Hash table implementation is lgpl2.1+ licensed.
266 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
267 ;; derived from ISC.
268 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
269 ;; under the bsd 2 license.
270 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
271 ;; under the terms of the GNU GPL.
78325fa8
LC
272 (license (list license:expat license:lgpl2.1+ license:bsd-2
273 license:gpl2+))
274 (supported-systems (filter (cut string-suffix? "-linux" <>)
275 %supported-systems))))
a3af70ac 276
db913ac4
JMSG
277(define-public libtermkey
278 (package
279 (name "libtermkey")
b5b46f87 280 (version "0.20")
db913ac4
JMSG
281 (source (origin
282 (method url-fetch)
283 (uri (string-append "http://www.leonerd.org.uk/code/"
284 name "/" name "-" version ".tar.gz"))
285 (sha256
b5b46f87 286 (base32 "1xfj6lchhfljmbcl6dz8dpakppyy13nbl4ykxiv5x4dr9b4qf3bc"))))
db913ac4
JMSG
287 (build-system gnu-build-system)
288 (arguments
289 '(#:make-flags (list
290 "CC=gcc"
291 (string-append "PREFIX=" (assoc-ref %outputs "out")))
292 #:phases (modify-phases %standard-phases
293 (delete 'configure))
294 #:test-target "test"))
c695fb76
TGR
295 (inputs `(("ncurses" ,ncurses)))
296 (native-inputs `(("libtool" ,libtool)
db913ac4 297 ("perl-test-harness" ,perl-test-harness)
c695fb76 298 ("pkg-config" ,pkg-config)))
db913ac4
JMSG
299 (synopsis "Keyboard entry processing library for terminal-based programs")
300 (description
301 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
302combining, and so on, with a simple interface.")
303 (home-page "http://www.leonerd.org.uk/code/libtermkey")
304 (license license:expat)))
305
a3af70ac
DC
306(define-public picocom
307 (package
308 (name "picocom")
d0cddec2 309 (version "2.2")
a3af70ac
DC
310 (source (origin
311 (method url-fetch)
312 (uri (string-append
313 "https://github.com/npat-efault/picocom"
314 "/archive/" version ".tar.gz"))
315 (file-name (string-append name "-" version ".tar.gz"))
316 (sha256
317 (base32
d0cddec2 318 "1knl6dglnrynx1fhy21nylw56i1q3dkizkgxzkq42mb7ilah8f9y"))))
a3af70ac
DC
319 (build-system gnu-build-system)
320 (arguments
321 `(#:make-flags '("CC=gcc")
322 #:tests? #f ; No tests
323 #:phases
324 (modify-phases %standard-phases
325 (delete 'configure)
326 (replace 'install
327 (lambda* (#:key outputs #:allow-other-keys)
328 (let* ((out (assoc-ref outputs "out"))
329 (bin (string-append out "/bin"))
330 (man (string-append out "/share/man/man1")))
331 (install-file "picocom" bin)
332 (install-file "picocom.1" man)))))))
333 (home-page "https://github.com/npat-efault/picocom")
334 (synopsis "Minimal dumb-terminal emulation program")
335 (description "It was designed to serve as a simple, manual, modem
336configuration, testing, and debugging tool. It has also serves well
337as a low-tech serial communications program to allow access to all
338types of devices that provide serial consoles.")
339 (license license:gpl2+)))
abe2ec73
JMSG
340
341(define-public beep
342 (package
343 (name "beep")
344 (version "1.3")
345 (source (origin
346 (method url-fetch)
347 (uri (string-append "http://www.johnath.com/" name "/"
348 name "-" version ".tar.gz"))
349 (sha256
350 (base32
351 "0bgch6jq5cahakk3kbr9549iysf2dik09afixxy5brbxk1xfzb2r"))))
352 (build-system gnu-build-system)
353 (arguments
354 `(#:tests? #f ; no tests.
355 #:phases
356 (modify-phases %standard-phases
357 (delete 'configure)
358 (add-after 'unpack 'patch-makefile
359 (lambda* (#:key outputs #:allow-other-keys)
12c15242
TGR
360 (substitute* "Makefile" (("/usr") (assoc-ref outputs "out")))
361 #t))
abe2ec73
JMSG
362 (add-before 'install 'create-output-directories
363 (lambda* (#:key outputs #:allow-other-keys)
364 (let ((out (assoc-ref %outputs "out")))
365 (mkdir-p (string-append out "/bin"))
366 (mkdir-p (string-append out "/man/man1"))))))))
367 (synopsis "Linux command-line utility to control the PC speaker")
368 (description "beep allows the user to control the PC speaker with precision,
369allowing different sounds to indicate different events. While it can be run
370quite happily on the command line, its intended place of residence is within
371scripts, notifying the user when something interesting occurs. Of course, it
372has no notion of what's interesing, but it's very good at that notifying part.")
373 (home-page "http://www.johnath.com/beep")
374 (license license:gpl2+)))
f2b7be09
RW
375
376(define-public unibilium
377 (package
378 (name "unibilium")
ed3094ce 379 (version "1.2.1")
f2b7be09
RW
380 (source
381 (origin
382 (method url-fetch)
383 (uri (string-append "https://github.com/mauke/unibilium/"
384 "archive/v" version ".tar.gz"))
385 (file-name (string-append name "-" version ".tar.gz"))
386 (sha256
387 (base32
ed3094ce 388 "1hbf011d8nzsp7c96fidjiq8yw8zlxf6f1s050ii2yyampvb8ib0"))))
f2b7be09
RW
389 (build-system gnu-build-system)
390 (arguments
391 `(#:make-flags
392 (list "CC=gcc"
393 (string-append "PREFIX=" (assoc-ref %outputs "out")))
394 #:test-target "test"
395 ;; FIXME: tests require "prove"
396 #:tests? #f
397 #:phases
398 (modify-phases %standard-phases
399 (delete 'configure))))
400 (native-inputs
401 `(("libtool" ,libtool)))
402 (home-page "https://github.com/mauke/unibilium")
403 (synopsis "Terminfo parsing library")
404 (description "Unibilium is a basic C terminfo library. It doesn't depend
405on curses or any other library. It also doesn't use global variables, so it
406should be thread-safe.")
407 (license license:lgpl3+)))
ee869cd6
RW
408
409(define-public libvterm
410 (package
411 (name "libvterm")
412 (version "0+bzr681")
413 (source
414 (origin
415 (method url-fetch)
416 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
417 "libvterm-" version ".tar.gz"))
418 (sha256
419 (base32
420 "1s56c8p1qz6frkcri0hg4qyydv2wcccj6n2xmz1dwcdqn38ldsmb"))))
421 (build-system gnu-build-system)
422 (arguments
423 `(#:make-flags
424 (list "CC=gcc"
425 (string-append "PREFIX=" (assoc-ref %outputs "out")))
426 #:test-target "test"
427 #:phases
428 (modify-phases %standard-phases
429 (delete 'configure))))
430 (native-inputs
431 `(("libtool" ,libtool)
432 ("perl" ,perl)))
433 (home-page "http://www.leonerd.org.uk/code/libvterm/")
434 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
435 (description "Libvterm is an abstract C99 library which implements a VT220
436or xterm-like terminal emulator. It doesn't use any particular graphics
437toolkit or output system, instead it invokes callback function pointers that
438its embedding program should provide it to draw on its behalf. It avoids
439calling @code{malloc} during normal running state, allowing it to be used in
440embedded kernel situations.")
441 (license license:expat)))
f9ff014b
P
442
443(define-public cool-retro-term
306d8630 444 (let ((commit "dd799cf5c0eda92cf44f3938c0c2dcae5651a99e")
f9ff014b
P
445 (revision "1"))
446 (package
447 (name "cool-retro-term")
306d8630 448 (version (string-append "1.0.1-" revision "." (string-take commit 7)))
f9ff014b
P
449 (source (origin
450 (method git-fetch)
451 (file-name (string-append name "-" version "-checkout"))
452 (uri (git-reference
453 (url (string-append "https://github.com/Swordfish90/" name))
454 (commit commit)
455 (recursive? #t)))
456 (sha256
306d8630 457 (base32 "08mrvj8zk9ck15q90ipjzza1acnnsjhprv2rxg8yyck0xl9p40jd"))
f9ff014b 458 (patches
306d8630 459 (search-patches "cool-retro-term-fix-array-size.patch"
f9ff014b
P
460 "cool-retro-term-dont-check-uninit-member.patch"
461 "cool-retro-term-memory-leak-1.patch"))
306d8630
EB
462 (modules '((guix build utils)
463 (srfi srfi-1)
464 (srfi srfi-26)
465 (ice-9 rdelim)
466 (ice-9 regex)))
f9ff014b 467 (snippet
306d8630
EB
468 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
469 ;"1975-knight-tv" ; GPL
470 "1977-apple2" ; Non-Free
471 "1977-commodore-pet" ; Non-Free
472 "1979-atari-400-800" ; Non-Free
473 "1982-commodore64" ; Non-Free
474 "1985-atari-st" ; ?
475 "1985-ibm-pc-vga" ; Unclear
476 ;"modern-fixedsys-excelsior" ; Redistributable
477 ;"modern-hermit" ; SIL
478 ;"modern-inconsolata"; SIL
479 ;"modern-pro-font-win-tweaked" ; X11
480 ;"modern-proggy-tiny"; X11
481 ;"modern-terminus" ; SIL
482 "modern-monaco")) ; Apple Non-Free
483 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
484 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
485 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
486 (names
487 ;; Gather font names from all Fonts*.qml files.
488 ;; These will be used to remove items from the
489 ;; default profiles.
490 (fold
491 (lambda (font-file names)
492 (call-with-input-file font-file
493 (lambda (port)
494 (let loop ((name #f) (names names))
495 (let ((line (read-line port)))
496 (cond
497 ((eof-object? line) (pk 'names names))
498 ((regexp-exec name-rx line)
499 => (lambda (m)
500 (loop (match:substring m 1) names)))
501 ((regexp-exec source-rx line)
502 => (lambda (m)
503 (let ((font (match:substring m 1)))
504 (if (member font fonts)
505 (loop #f (lset-adjoin string=?
506 names name))
507 (loop #f names)))))
508 (else (loop name names))))))))
509 '() (find-files "app/qml" "Font.*\\.qml"))))
510 ;; Remove the font files themselves
6cbee49d
MW
511 (for-each (lambda (font)
512 (delete-file-recursively
306d8630
EB
513 (string-append "app/qml/fonts/" font)))
514 fonts)
515 ;; Remove mention of those fonts in the source
516 (substitute* "app/qml/resources.qrc"
517 (((string-append " *<file>fonts/("
518 (string-join fonts "|")
519 ").*"))
520 ""))
521 (for-each
522 (lambda (file)
523 (let ((start-rx (make-regexp " *ListElement\\{"))
524 (end-rx (make-regexp " *\\}")))
525 (with-atomic-file-replacement file
526 (lambda (in out)
527 (let loop ((line-buffer '())
528 (hold? #f)
529 (discard? #f))
530 (let ((line (read-line in 'concat)))
531 (cond
532 ((eof-object? line) #t) ;done
533 ((regexp-exec start-rx line)
534 (loop (cons line line-buffer) #t #f))
535 ((or (regexp-exec source-rx line)
536 (regexp-exec fontname-rx line))
537 => (lambda (m)
538 (let ((font-or-name (match:substring m 1)))
539 (if (or (member font-or-name fonts)
540 (member font-or-name names))
541 (loop '() #f #t)
542 (loop (cons line line-buffer)
543 hold? #f)))))
544 ((regexp-exec end-rx line)
545 (unless discard?
546 (for-each (cut display <> out)
547 (reverse line-buffer))
548 (display line out))
549 (loop '() #f #f))
550 (hold? (loop (cons line line-buffer)
551 hold? discard?))
552 (discard? (loop line-buffer #f #t))
553 (else (display line out)
554 (loop '() #f #f)))))))))
555 '("app/qml/FontPixels.qml"
556 "app/qml/FontScanlines.qml"
557 "app/qml/Fonts.qml"
558 "app/qml/ApplicationSettings.qml"))
559 ;; Final substitution for default scanline and pixel fonts
560 (substitute* "app/qml/ApplicationSettings.qml"
c52872bf 561 (("COMMODORE_PET") "PROGGY_TINY"))
6cbee49d 562 #t))))
f9ff014b
P
563 (build-system gnu-build-system)
564 (inputs
565 `(("qtbase" ,qtbase)
566 ("qtdeclarative" ,qtdeclarative)
567 ("qtgraphicaleffects" ,qtgraphicaleffects)
568 ("qtquickcontrols" ,qtquickcontrols)))
569 (arguments
570 `(#:phases
571 (modify-phases %standard-phases
572 (replace 'configure
573 (lambda* (#:key outputs #:allow-other-keys)
306d8630 574 (let ((out (assoc-ref outputs "out")))
f9ff014b
P
575 (substitute* '("qmltermwidget/qmltermwidget.pro")
576 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
669be6ac 577 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
306d8630
EB
578 (substitute* '("cool-retro-term.pro" "app/app.pro")
579 (("/usr") out))
580 (invoke "qmake"))))
f9ff014b
P
581 (add-after 'install 'wrap-executable
582 (lambda* (#:key inputs outputs #:allow-other-keys)
306d8630
EB
583 (let ((out (assoc-ref outputs "out"))
584 (qml "/lib/qt5/qml"))
f9ff014b
P
585 (wrap-program (string-append out "/bin/cool-retro-term")
586 `("QML2_IMPORT_PATH" ":" prefix
587 (,(string-append out qml)
306d8630
EB
588 ,@(map (lambda (i)
589 (string-append (assoc-ref inputs i) qml))
590 '("qtdeclarative"
591 "qtgraphicaleffects"
592 "qtquickcontrols")))))
593 #t)))
f9ff014b
P
594 (add-after 'install 'add-alternate-name
595 (lambda* (#:key outputs #:allow-other-keys)
306d8630 596 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
f9ff014b 597 (symlink (string-append bin "/cool-retro-term")
306d8630
EB
598 (string-append bin "/crt")))))
599 (add-after 'install 'install-man
600 (lambda* (#:key outputs #:allow-other-keys)
601 (let ((mandir (string-append (assoc-ref outputs "out")
602 "/share/man/man1")))
603 (install-file "packaging/debian/cool-retro-term.1" mandir)
604 #t))))))
f9ff014b
P
605 (synopsis "Terminal emulator")
606 (description
607 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
608feel of the old cathode ray tube (CRT) screens. It has been designed to be
609eye-candy, customizable, and reasonably lightweight.")
610 (home-page "https://github.com/Swordfish90/cool-retro-term")
611 (license (list
612 license:gpl2+ ; qmltermwidget
613 license:gpl3+ ; cool-retro-term
614 ;; Fonts
615 license:silofl1.1
616 license:x11
617 license:bsd-3)))))
90bf2608
KK
618
619(define-public sakura
620 (package
621 (name "sakura")
42d93a32 622 (version "3.6.0")
90bf2608
KK
623 (source (origin
624 (method url-fetch)
625 (uri (string-append "https://launchpad.net/" name "/trunk/"
626 version "/+download/" name "-" version
627 ".tar.bz2"))
628 (sha256
629 (base32
42d93a32 630 "1q463qm41ym7jb3kbzjz7b6x549vmgkb70arpkhsf86yxly1y5m1"))))
90bf2608
KK
631 (build-system cmake-build-system)
632 (arguments
42d93a32 633 '(#:tests? #f)) ; no check phase
90bf2608
KK
634 (native-inputs
635 `(("gettext" ,gettext-minimal)
42d93a32 636 ("perl" ,perl) ; for pod2man
90bf2608
KK
637 ("pkg-config" ,pkg-config)))
638 (inputs
639 `(("libxft" ,libxft)
640 ("vte" ,vte)))
641 (home-page "https://launchpad.net/sakura")
642 (synopsis "A simple but powerful libvte-based terminal emulator")
643 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
644It's a terminal emulator with few dependencies, so you don't need a full GNOME
645desktop installed to have a decent terminal emulator.")
646 (license license:gpl2)))
d0c2f81c 647
cf71edee
CB
648(define-public go-github.com-nsf-termbox-go
649 (let ((commit "4ed959e0540971545eddb8c75514973d670cf739")
650 (revision "0"))
651 (package
652 (name "go-github.com-nsf-termbox-go")
653 (version (git-version "0.0.0" revision commit))
654 (source (origin
655 (method git-fetch)
656 (uri (git-reference
657 (url "https://github.com/nsf/termbox-go.git")
658 (commit commit)))
659 (file-name (git-file-name name version))
660 (sha256
661 (base32
662 "1vx64i1mg660if3wwm81p4b7lzxfb3qbr39i7misdyld3fc486p9"))))
663 (build-system go-build-system)
664 (arguments
665 '(#:import-path "github.com/nsf/termbox-go"))
666 (propagated-inputs
667 `(("go-github.com-mattn-go-runewidth"
668 ,go-github.com-mattn-go-runewidth)))
669 (synopsis "@code{termbox} provides a minimal API for text-based user
670interfaces")
671 (description
672 "Termbox is a library that provides a minimalistic API which allows the
673programmer to write text-based user interfaces.")
674 (home-page "https://github.com/nsf/termbox-go")
675 (license license:expat))))
676
d0c2f81c
CB
677(define-public go-golang.org-x-crypto-ssh-terminal
678 (let ((commit "c78caca803c95773f48a844d3dcab04b9bc4d6dd")
679 (revision "0"))
680 (package
681 (name "go-golang.org-x-crypto-ssh-terminal")
682 (version (git-version "0.0.0" revision commit))
683 (source (origin
684 (method git-fetch)
685 (uri (git-reference
686 (url "https://go.googlesource.com/crypto")
687 (commit commit)))
688 (file-name (git-file-name name version))
689 (sha256
690 (base32
691 "0vxlfxr9y681yn2cfh6dbqmq35vvq4f45ay0mm31ffkny9cms0y4"))))
692 (build-system go-build-system)
693 (arguments
694 '(#:import-path "golang.org/x/crypto/ssh/terminal"
695 #:unpack-path "golang.org/x/crypto"
696 #:phases
697 (modify-phases %standard-phases
698 (add-before 'reset-gzip-timestamps 'make-gzip-archive-writable
699 (lambda* (#:key outputs #:allow-other-keys)
700 (map (lambda (file)
701 (make-file-writable file))
702 (find-files
703 (string-append (assoc-ref outputs "out")
704 "/src/golang.org/x/crypto/ed25519/testdata")
705 ".*\\.gz$"))
706 #t)))))
707 (synopsis "Support functions for dealing with terminals in Go")
708 (description "@code{terminal} provides support functions for dealing
709with terminals in Go.")
710 (home-page "https://go.googlesource.com/crypto/")
711 (license license:bsd-3))))
f8ce6eb6
CB
712
713(define-public go-github.com-howeyc-gopass
714 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
715 (revision "0"))
716 (package
717 (name "go-github.com-howeyc-gopass")
718 (version (git-version "0.0.0" revision commit))
719 (source (origin
720 (method git-fetch)
721 (uri (git-reference
722 (url "https://github.com/howeyc/gopass.git")
723 (commit commit)))
724 (file-name (git-file-name name version))
725 (sha256
726 (base32
727 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
728 (build-system go-build-system)
729 (arguments
730 '(#:import-path "github.com/howeyc/gopass"))
731 (propagated-inputs
732 `(("go-golang.org-x-crypto-ssh-terminal"
733 ,go-golang.org-x-crypto-ssh-terminal)))
734 (synopsis "Retrieve password from a terminal or piped input in Go")
735 (description
736 "@code{gopass} is a Go package for retrieving a password from user
737terminal or piped input.")
738 (home-page "https://github.com/howeyc/gopass")
739 (license license:isc))))
46ddcf4a
HG
740
741(define-public python-pyte
742 (package
743 (name "python-pyte")
744 (version "0.7.0")
745 (source
746 (origin
747 (method url-fetch)
748 (uri (pypi-uri "pyte" version))
749 (sha256
750 (base32
751 "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
752 (build-system python-build-system)
753 (arguments
754 '(#:phases
755 (modify-phases %standard-phases
756 (add-after 'unpack 'remove-failing-test
757 ;; TODO: Reenable when the `captured` files required by this test
758 ;; are included in the archive.
759 (lambda _
760 (delete-file "tests/test_input_output.py")
761 #t)))))
762 (propagated-inputs
c695fb76 763 `(("python-wcwidth" ,python-wcwidth)))
46ddcf4a
HG
764 (native-inputs
765 `(("python-pytest-runner" ,python-pytest-runner)
766 ("python-pytest" ,python-pytest)))
767 (home-page "https://pyte.readthedocs.io/")
768 (synopsis "Simple VTXXX-compatible terminal emulator")
769 (description "@code{pyte} is an in-memory VTxxx-compatible terminal
770emulator. @var{VTxxx} stands for a series of video terminals, developed by
771DEC between 1970 and 1995. The first and probably most famous one was the
772VT100 terminal, which is now a de-facto standard for all virtual terminal
773emulators.
774
775pyte is a fork of vt102, which was an incomplete pure Python implementation
776of VT100 terminal.")
777 (license license:lgpl3+)))
778
779(define-public python2-pyte
780 (package-with-python2 python-pyte))
573450e6
HG
781
782(define-public python-blessings
783 (package
784 (name "python-blessings")
785 (version "1.6.1")
786 (source
787 (origin
788 (method url-fetch)
789 (uri (pypi-uri "blessings" version))
790 (sha256
791 (base32
792 "1smngy65p8mi62lgm04icasx22v976szhs2aq95y2ljmi1srb4bl"))))
793 (build-system python-build-system)
794 (arguments
795 ;; TODO: For py3, 2to2 is used to convert the code, but test-suite fails
796 `(#:tests? #f))
797 (native-inputs
798 `(("python-nose" ,python-nose)))
799 (home-page "https://github.com/erikrose/blessings")
800 (synopsis "Python module to manage terminal color, styling, and
801positioning")
802 (description "Blessings is a pythonic API to manipulate terminal color,
803styling, and positioning. It provides similar features to curses but avoids
804some of curses’s limitations: it does not require clearing the whole screen
805for little changes, provides a scroll-back buffer after the program exits, and
806avoids styling altogether when the output is redirected to something other
807than a terminal.")
808 (license license:expat)))
809
810(define-public python2-blessings
811 (package-with-python2 python-blessings))
e79a8424
HG
812
813(define-public python-curtsies
814 (package
815 (name "python-curtsies")
816 (version "0.2.11")
817 (source
818 (origin
819 (method url-fetch)
820 (uri (pypi-uri "curtsies" version))
821 (sha256
822 (base32
823 "1vljmw3sy6lrqahhpyg4gk13mzcx3mwhvg8s41698ms3cpgkjipc"))))
824 (build-system python-build-system)
825 (arguments
826 `(#:phases
827 (modify-phases %standard-phases
828 (replace 'check
829 (lambda _
830 (invoke "nosetests" "-v"))))))
831 (propagated-inputs
832 `(("python-blessings" ,python-blessings)
c695fb76 833 ("python-wcwidth" ,python-wcwidth)))
e79a8424
HG
834 (native-inputs
835 `(("python-mock" ,python-mock)
836 ("python-pyte" ,python-pyte)
837 ("python-nose" ,python-nose)))
838 (home-page "https://github.com/thomasballinger/curtsies")
839 (synopsis "Library for curses-like terminal interaction with colored
840strings")
841 (description "Curtsies is a Python library for interacting with the
842terminal. It features string-like objects which carry formatting information,
843per-line fullscreen terminal rendering, and keyboard input event reporting.")
844 (license license:expat)))
845
846(define-public python2-curtsies
847 (package-with-python2 python-curtsies))