Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / terminals.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
3 ;;; Copyright © 2016 Mckinley Olsen <mck.olsen@gmail.com>
4 ;;; Copyright © 2016, 2017, 2019 Alex Griffin <a@ajgrf.com>
5 ;;; Copyright © 2016 David Craven <david@craven.ch>
6 ;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
8 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
10 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
12 ;;; Copyright © 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
13 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
14 ;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
15 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018, 2019 Eric Bavier <bavier@member.fsf.org>
17 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
18 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
19 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
20 ;;;
21 ;;; This file is part of GNU Guix.
22 ;;;
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
27 ;;;
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
32 ;;;
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36 (define-module (gnu packages terminals)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system glib-or-gtk)
41 #:use-module (guix build-system go)
42 #:use-module (guix build-system python)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix packages)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages crypto)
51 #:use-module (gnu packages docbook)
52 #:use-module (gnu packages fontutils)
53 #:use-module (gnu packages freedesktop)
54 #:use-module (gnu packages gcc)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages golang)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages image)
62 #:use-module (gnu packages libcanberra)
63 #:use-module (gnu packages libevent)
64 #:use-module (gnu packages linux)
65 #:use-module (gnu packages ncurses)
66 #:use-module (gnu packages perl)
67 #:use-module (gnu packages perl-check)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages popt)
70 #:use-module (gnu packages protobuf)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-web)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages qt)
75 #:use-module (gnu packages serialization)
76 #:use-module (gnu packages sphinx)
77 #:use-module (gnu packages ssh)
78 #:use-module (gnu packages textutils)
79 #:use-module (gnu packages xdisorg)
80 #:use-module (gnu packages xml)
81 #:use-module (gnu packages xorg)
82 #:use-module (srfi srfi-26))
83
84 (define-public tilda
85 (package
86 (name "tilda")
87 (version "1.4.1")
88 (source (origin
89 (method git-fetch)
90 (uri (git-reference
91 (url "https://github.com/lanoxx/tilda.git")
92 (commit (string-append "tilda-" version))))
93 (file-name (git-file-name name version))
94 (sha256
95 (base32
96 "154rsldqjv2m1bddisb930qicb0y35kx7bxq392n2hn68jr2pxkj"))))
97 (build-system glib-or-gtk-build-system)
98 (arguments
99 '(#:phases (modify-phases %standard-phases
100 (replace 'bootstrap
101 (lambda _
102 (setenv "NOCONFIGURE" "true")
103 (invoke "sh" "autogen.sh"))))))
104 (native-inputs
105 `(("autoconf" ,autoconf)
106 ("automake" ,automake)
107 ("gettext" ,gettext-minimal)
108 ("pkg-config" ,pkg-config)))
109 (inputs
110 `(("libconfuse" ,libconfuse)
111 ("vte" ,vte)))
112 (synopsis "GTK+-based drop-down terminal")
113 (description "Tilda is a terminal emulator similar to normal terminals like
114 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
115 from the edge of a screen when a certain configurable hotkey is pressed. This
116 is similar to the built-in consoles in some applications. Tilda is highly
117 configurable through a graphical wizard.")
118 (home-page "https://github.com/lanoxx/tilda")
119 (license license:gpl2+)))
120
121 (define-public termite
122 (package
123 (name "termite")
124 (version "15")
125 (source
126 (origin
127 (method git-fetch)
128 (uri (git-reference
129 (url (string-append "https://github.com/thestinger/"
130 name ".git"))
131 (commit (string-append "v" version))
132 (recursive? #t)))
133 (file-name (string-append name "-" version "-checkout"))
134 (sha256
135 (base32
136 "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k"))))
137 (build-system gnu-build-system)
138 (arguments
139 `(#:phases
140 (modify-phases %standard-phases
141 (delete 'configure))
142 #:tests? #f
143 ;; This sets the destination when installing the necessary terminal
144 ;; capability data, which are not provided by 'ncurses'. See
145 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
146 #:make-flags (list "PREFIX="
147 (string-append "VERSION=v" (version))
148 (string-append "DESTDIR="
149 (assoc-ref %outputs "out")))))
150 (inputs
151 `(("vte" ,vte-ng)
152 ("gtk+" ,gtk+)
153 ("ncurses" ,ncurses)))
154 (native-inputs
155 `(("pkg-config" ,pkg-config)))
156
157 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
158 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
159 (native-search-paths
160 (list (search-path-specification
161 (variable "TERMINFO_DIRS")
162 (files '("share/terminfo")))))
163 (home-page "https://github.com/thestinger/termite/")
164 (synopsis "Keyboard-centric, VTE-based terminal")
165 (description "Termite is a minimal terminal emulator designed for use with
166 tiling window managers. It is a modal application, similar to Vim, with an
167 insert mode and command mode where keybindings have different functions.")
168
169 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
170 (license license:lgpl2.0+)))
171
172 (define-public asciinema
173 (package
174 (name "asciinema")
175 (version "2.0.2")
176 (source
177 (origin
178 (method git-fetch)
179 (uri (git-reference
180 (url "https://github.com/asciinema/asciinema")
181 (commit (string-append "v" version))))
182 (file-name (git-file-name name version))
183 (sha256
184 (base32
185 "1a2pysxnp6icyd08mgf66xr6f6j0irnfxdpf3fmzcz31ix7l9kc4"))))
186 (build-system python-build-system)
187 (arguments
188 `(#:phases
189 (modify-phases %standard-phases
190 (add-before 'build 'patch-exec-paths
191 (lambda* (#:key inputs #:allow-other-keys)
192 (let ((ncurses (assoc-ref inputs "ncurses")))
193 (substitute* "asciinema/term.py"
194 (("'tput'")
195 (string-append "'" ncurses "/bin/tput'"))))
196 #t))
197 (replace 'check
198 (lambda _ (invoke "nosetests" "-v"))))))
199 (inputs `(("ncurses" ,ncurses)))
200 (native-inputs
201 ;; For tests.
202 `(("python-nose" ,python-nose)))
203 (home-page "https://asciinema.org")
204 (synopsis "Terminal session recorder")
205 (description
206 "Use asciinema to record and share your terminal sessions, the right way.
207 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
208 text-based approach to terminal recording.")
209 (license license:gpl3)))
210
211 (define-public libtsm
212 (let ((commit "f70e37982f382b03c6939dac3d5f814450bda253")
213 (revision "1"))
214 (package
215 (name "libtsm")
216 (version (git-version "0.0.0" revision commit))
217 (source (origin
218 (method git-fetch)
219 ;; The freedesktop repository is no longer maintained.
220 (uri (git-reference
221 (url (string-append "https://github.com/Aetf/" name))
222 (commit commit)))
223 (file-name (git-file-name name version))
224 (sha256
225 (base32
226 "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx"))))
227 (build-system cmake-build-system)
228 (arguments
229 `(#:configure-flags '("-DBUILD_TESTING=ON")))
230 (native-inputs
231 `(("pkg-config" ,pkg-config)))
232 (inputs
233 `(("libxkbcommon" ,libxkbcommon)
234 ("check" ,check)))
235 (synopsis "Xterm state machine library")
236 (description "TSM is a state machine for DEC VT100-VT520 compatible
237 terminal emulators. It tries to support all common standards while keeping
238 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
239 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
240 ;; Hash table implementation is lgpl2.1+ licensed.
241 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
242 ;; derived from ISC.
243 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
244 ;; under the bsd 2 license.
245 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2)))))
246
247 (define-public kmscon
248 (let ((commit "01dd0a231e2125a40ceba5f59fd945ff29bf2cdc")
249 (revision "1"))
250 (package
251 (name "kmscon")
252 (version (git-version "0.0.0" revision commit))
253 (source (origin
254 (method git-fetch)
255 ;; The freedesktop repository is no longer maintained.
256 (uri (git-reference
257 (url (string-append "https://github.com/Aetf/" name))
258 (commit commit)))
259 (sha256
260 (base32
261 "0q62kjsvy2iwy8adfiygx2bfwlh83rphgxbis95ycspqidg9py87"))
262 (patches
263 (search-patches "kmscon-runtime-keymap-switch.patch"))
264 (modules '((guix build utils)))
265 (file-name (git-file-name name version))))
266 (build-system gnu-build-system)
267 (arguments
268 `(;; The closure of MESA is huge so we'd rather avoid it.
269 #:disallowed-references (,mesa)
270
271 #:phases (modify-phases %standard-phases
272 (replace 'bootstrap
273 (lambda _
274 (setenv "NOCONFIGURE" "indeed")
275 (invoke "sh" "autogen.sh")))
276 ;; Use elogind instead of systemd.
277 (add-before 'configure 'remove-systemd
278 (lambda _
279 (substitute* "configure"
280 (("libsystemd-daemon libsystemd-login")
281 "libelogind"))
282 (substitute* "src/uterm_systemd.c"
283 (("#include <systemd/sd-login.h>")
284 "#include <elogind/sd-login.h>")
285 ;; We don't have this header.
286 (("#include <systemd/sd-daemon\\.h>")
287 "")
288 ;; Replace the call to 'sd_booted' by the truth value.
289 (("sd_booted\\(\\)")
290 "1")))))))
291 (native-inputs
292 `(("pkg-config" ,pkg-config)
293 ("autoconf" ,autoconf)
294 ("automake" ,automake)
295 ("libtool" ,libtool)
296 ("libxslt" ,libxslt) ;to build the man page
297 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
298 ("docbook-xsl" ,docbook-xsl)))
299 (inputs
300 `(("libdrm" ,libdrm)
301 ("libtsm" ,libtsm)
302 ("libxkbcommon" ,libxkbcommon)
303 ("logind" ,elogind)
304 ;; MESA can be used for accelerated video output via OpenGLESv2, but
305 ;; it's a bit dependency that we'd rather avoid in the installation
306 ;; image.
307 ;; ("mesa" ,mesa)
308 ("pango" ,pango)
309 ("udev" ,eudev)))
310 (synopsis "Linux KMS-based terminal emulator")
311 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
312 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
313 implementation with a user-space console. Compared to the Linux console,
314 kmscon provides enhanced features including XKB-compatible internationalized
315 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
316 multi-seat support, a replacement for @command{mingetty}, and more.")
317 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
318 ;; Hash table implementation is lgpl2.1+ licensed.
319 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
320 ;; derived from ISC.
321 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
322 ;; under the bsd 2 license.
323 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
324 ;; under the terms of the GNU GPL.
325 (license (list license:expat license:lgpl2.1+ license:bsd-2
326 license:gpl2+))
327 (supported-systems (filter (cut string-suffix? "-linux" <>)
328 %supported-systems)))))
329
330 (define-public libtermkey
331 (package
332 (name "libtermkey")
333 (version "0.21.1")
334 (source (origin
335 (method url-fetch)
336 (uri (string-append "http://www.leonerd.org.uk/code/libtermkey/"
337 "libtermkey-" version ".tar.gz"))
338 (sha256
339 (base32 "0psd0kf10q5ixfima0mxz10syy7qq1ilz1npr0rz862xycvzgjyf"))))
340 (build-system gnu-build-system)
341 (arguments
342 '(#:make-flags (list
343 "CC=gcc"
344 (string-append "PREFIX=" (assoc-ref %outputs "out")))
345 #:phases (modify-phases %standard-phases
346 (delete 'configure)) ; no configure script
347 #:test-target "test"))
348 (inputs `(("ncurses" ,ncurses)))
349 (native-inputs `(("libtool" ,libtool)
350 ("perl-test-harness" ,perl-test-harness)
351 ("pkg-config" ,pkg-config)))
352 (synopsis "Keyboard entry processing library for terminal-based programs")
353 (description
354 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
355 combining, and so on, with a simple interface.")
356 (home-page "http://www.leonerd.org.uk/code/libtermkey")
357 (license license:expat)))
358
359 (define-public picocom
360 (package
361 (name "picocom")
362 (version "3.1")
363 (source (origin
364 (method git-fetch)
365 (uri (git-reference
366 (url "https://github.com/npat-efault/picocom.git")
367 (commit version)))
368 (file-name (git-file-name name version))
369 (sha256
370 (base32
371 "1vvjydqf0ax47nvdyyl67jafw5b3sfsav00xid6qpgia1gs2r72n"))))
372 (build-system gnu-build-system)
373 (arguments
374 `(#:make-flags '("CC=gcc")
375 #:tests? #f ; no tests
376 #:phases
377 (modify-phases %standard-phases
378 (delete 'configure) ; no configure script
379 (replace 'install
380 ;; The Makefile lacks an ‘install’ target.
381 (lambda* (#:key outputs #:allow-other-keys)
382 (let* ((out (assoc-ref outputs "out"))
383 (bin (string-append out "/bin"))
384 (man (string-append out "/share/man/man1")))
385 (install-file "picocom" bin)
386 (install-file "picocom.1" man)))))))
387 (home-page "https://github.com/npat-efault/picocom")
388 (synopsis "Minimal dumb-terminal emulator")
389 (description
390 "Picocom is a minimal dumb-terminal emulation program. It was designed to
391 serve as a simple and manual modem configuration, testing, and debugging tool.
392 It also serves well as a low-tech serial communications program to allow access
393 to all types of devices that provide serial consoles.")
394 (license license:gpl2+)))
395
396 (define-public beep
397 (package
398 (name "beep")
399 (version "1.4.7")
400 (source
401 (origin
402 (method git-fetch)
403 (uri (git-reference
404 ;; The original beep 1.3 at <http://www.johnath.com/beep> has been
405 ;; unmaintained for some time, and vulnerable to at least two CVEs:
406 ;; https://github.com/johnath/beep/issues/11#issuecomment-454056858
407 ;; Use this maintained fork instead.
408 (url "https://github.com/spkr-beep/beep.git")
409 (commit (string-append "v" version))))
410 (file-name (git-file-name name version))
411 (sha256
412 (base32 "0dnbvzzxvajc7pl1165wb3l74pfcqcdg12rcjcw86qqy954dx8my"))))
413 (build-system gnu-build-system)
414 (arguments
415 `(#:tests? #f ; no tests
416 #:make-flags
417 (list (string-append "prefix=" (assoc-ref %outputs "out"))
418 (string-append "pkgdocdir=$(docdir)/" ,name "-" ,version))
419 #:phases
420 (modify-phases %standard-phases
421 (delete 'configure)))) ; no configure script
422 (native-inputs
423 `(("gcc" ,gcc-8))) ; for ‘-fstack-clash-protection’
424 (synopsis "Linux command-line utility to control the PC speaker")
425 (description "beep allows the user to control the PC speaker with precision,
426 allowing different sounds to indicate different events. While it can be run
427 quite happily on the command line, its intended place of residence is within
428 scripts, notifying the user when something interesting occurs. Of course, it
429 has no notion of what's interesing, but it's very good at that notifying part.")
430 (home-page "https://github.com/spkr-beep/beep")
431 (license license:gpl2+)))
432
433 (define-public unibilium
434 (package
435 (name "unibilium")
436 (version "2.0.0")
437 (source
438 (origin
439 (method git-fetch)
440 (uri (git-reference
441 (url "https://github.com/mauke/unibilium.git")
442 (commit (string-append "v" version))))
443 (file-name (git-file-name name version))
444 (sha256
445 (base32
446 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
447 (build-system gnu-build-system)
448 (arguments
449 `(#:make-flags
450 (list "CC=gcc"
451 (string-append "PREFIX=" (assoc-ref %outputs "out")))
452 #:test-target "test"
453 ;; FIXME: tests require "prove"
454 #:tests? #f
455 #:phases
456 (modify-phases %standard-phases
457 (delete 'configure))))
458 (native-inputs
459 `(("libtool" ,libtool)
460 ("perl" ,perl)))
461 (home-page "https://github.com/mauke/unibilium")
462 (synopsis "Terminfo parsing library")
463 (description "Unibilium is a basic C terminfo library. It doesn't depend
464 on curses or any other library. It also doesn't use global variables, so it
465 should be thread-safe.")
466 (license license:lgpl3+)))
467
468 (define-public libvterm
469 (package
470 (name "libvterm")
471 (version "0.1.1")
472 (source
473 (origin
474 (method url-fetch)
475 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
476 "libvterm-" version ".tar.gz"))
477 (sha256
478 (base32
479 "1n5maylann2anfifjy576vzyar9q5m1kzpyiz2hca2pacxy8xf4v"))))
480 (build-system gnu-build-system)
481 (arguments
482 `(#:make-flags
483 (list "CC=gcc"
484 (string-append "PREFIX=" (assoc-ref %outputs "out")))
485 #:test-target "test"
486 #:phases
487 (modify-phases %standard-phases
488 (delete 'configure))))
489 (native-inputs
490 `(("libtool" ,libtool)
491 ("perl" ,perl)))
492 (home-page "http://www.leonerd.org.uk/code/libvterm/")
493 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
494 (description "Libvterm is an abstract C99 library which implements a VT220
495 or xterm-like terminal emulator. It doesn't use any particular graphics
496 toolkit or output system, instead it invokes callback function pointers that
497 its embedding program should provide it to draw on its behalf. It avoids
498 calling @code{malloc} during normal running state, allowing it to be used in
499 embedded kernel situations.")
500 (license license:expat)))
501
502 (define-public cool-retro-term
503 (let ((commit "1.1.1")
504 (revision "0")) ;not used currently
505 (package
506 (name "cool-retro-term")
507 (version "1.1.1")
508 (source (origin
509 (method git-fetch)
510 (file-name (string-append name "-" version "-checkout"))
511 (uri (git-reference
512 (url (string-append "https://github.com/Swordfish90/" name))
513 (commit commit)
514 (recursive? #t)))
515 (sha256
516 (base32 "0wb6anchxa5jpn9c73kr4byrf2xlj8x8qzc5x7ny6saj7kbbvp75"))
517 (modules '((guix build utils)
518 (srfi srfi-1)
519 (srfi srfi-26)
520 (ice-9 rdelim)
521 (ice-9 regex)))
522 (snippet
523 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
524 "1977-apple2" ; Non-Free
525 "1977-commodore-pet" ; Non-Free
526 "1979-atari-400-800" ; Non-Free
527 ;"1981-ibm-pc ; CC-SA 4.0
528 "1982-commodore64")) ; Non-Free
529 ;"1985-ibm-pc-vga" ; CC-SA 4.0
530 ;"modern-fixedsys-excelsior" ; Redistributable
531 ;"modern-hermit" ; SIL
532 ;"modern-inconsolata"; SIL
533 ;"modern-pro-font-win-tweaked" ; X11
534 ;"modern-proggy-tiny"; X11
535 ;"modern-terminus" ; SIL
536 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
537 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
538 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
539 (names
540 ;; Gather font names from all Fonts*.qml files.
541 ;; These will be used to remove items from the
542 ;; default profiles.
543 (fold
544 (lambda (font-file names)
545 (call-with-input-file font-file
546 (lambda (port)
547 (let loop ((name #f) (names names))
548 (let ((line (read-line port)))
549 (cond
550 ((eof-object? line) (pk 'names names))
551 ((regexp-exec name-rx line)
552 => (lambda (m)
553 (loop (match:substring m 1) names)))
554 ((regexp-exec source-rx line)
555 => (lambda (m)
556 (let ((font (match:substring m 1)))
557 (if (member font fonts)
558 (loop #f (lset-adjoin string=?
559 names name))
560 (loop #f names)))))
561 (else (loop name names))))))))
562 '() (find-files "app/qml" "Font.*\\.qml"))))
563 ;; Remove the font files themselves
564 (for-each (lambda (font)
565 (delete-file-recursively
566 (string-append "app/qml/fonts/" font)))
567 fonts)
568 ;; Remove mention of those fonts in the source
569 (substitute* "app/qml/resources.qrc"
570 (((string-append " *<file>fonts/("
571 (string-join fonts "|")
572 ").*"))
573 ""))
574 (for-each
575 (lambda (file)
576 (let ((start-rx (make-regexp " *ListElement\\{"))
577 (end-rx (make-regexp " *\\}")))
578 (with-atomic-file-replacement file
579 (lambda (in out)
580 (let loop ((line-buffer '())
581 (hold? #f)
582 (discard? #f))
583 (let ((line (read-line in 'concat)))
584 (cond
585 ((eof-object? line) #t) ;done
586 ((regexp-exec start-rx line)
587 (loop (cons line line-buffer) #t #f))
588 ((or (regexp-exec source-rx line)
589 (regexp-exec fontname-rx line))
590 => (lambda (m)
591 (let ((font-or-name (match:substring m 1)))
592 (if (or (member font-or-name fonts)
593 (member font-or-name names))
594 (loop '() #f #t)
595 (loop (cons line line-buffer)
596 hold? #f)))))
597 ((regexp-exec end-rx line)
598 (unless discard?
599 (for-each (cut display <> out)
600 (reverse line-buffer))
601 (display line out))
602 (loop '() #f #f))
603 (hold? (loop (cons line line-buffer)
604 hold? discard?))
605 (discard? (loop line-buffer #f #t))
606 (else (display line out)
607 (loop '() #f #f)))))))))
608 '("app/qml/FontPixels.qml"
609 "app/qml/FontScanlines.qml"
610 "app/qml/Fonts.qml"
611 "app/qml/ApplicationSettings.qml"))
612 ;; Final substitution for default scanline and pixel fonts
613 (substitute* "app/qml/ApplicationSettings.qml"
614 (("COMMODORE_PET") "PROGGY_TINY"))
615 #t))))
616 (build-system gnu-build-system)
617 (inputs
618 `(("qtbase" ,qtbase)
619 ("qtdeclarative" ,qtdeclarative)
620 ("qtgraphicaleffects" ,qtgraphicaleffects)
621 ("qtquickcontrols" ,qtquickcontrols)))
622 (arguments
623 `(#:phases
624 (modify-phases %standard-phases
625 (replace 'configure
626 (lambda* (#:key outputs #:allow-other-keys)
627 (let ((out (assoc-ref outputs "out")))
628 (substitute* '("qmltermwidget/qmltermwidget.pro")
629 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
630 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
631 (substitute* '("cool-retro-term.pro" "app/app.pro")
632 (("/usr") out))
633 (invoke "qmake"))))
634 (add-after 'install 'wrap-executable
635 (lambda* (#:key inputs outputs #:allow-other-keys)
636 (let ((out (assoc-ref outputs "out"))
637 (qml "/lib/qt5/qml"))
638 (wrap-program (string-append out "/bin/cool-retro-term")
639 `("QML2_IMPORT_PATH" ":" prefix
640 (,(string-append out qml)
641 ,@(map (lambda (i)
642 (string-append (assoc-ref inputs i) qml))
643 '("qtdeclarative"
644 "qtgraphicaleffects"
645 "qtquickcontrols")))))
646 #t)))
647 (add-after 'install 'add-alternate-name
648 (lambda* (#:key outputs #:allow-other-keys)
649 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
650 (symlink (string-append bin "/cool-retro-term")
651 (string-append bin "/crt"))
652 #t)))
653 (add-after 'install 'install-man
654 (lambda* (#:key outputs #:allow-other-keys)
655 (let ((mandir (string-append (assoc-ref outputs "out")
656 "/share/man/man1")))
657 (install-file "packaging/debian/cool-retro-term.1" mandir)
658 #t))))))
659 (synopsis "Terminal emulator")
660 (description
661 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
662 feel of the old cathode ray tube (CRT) screens. It has been designed to be
663 eye-candy, customizable, and reasonably lightweight.")
664 (home-page "https://github.com/Swordfish90/cool-retro-term")
665 (license (list
666 license:gpl2+ ; qmltermwidget
667 license:gpl3+ ; cool-retro-term
668 ;; Fonts
669 license:silofl1.1
670 license:x11
671 license:bsd-3)))))
672
673 (define-public sakura
674 (package
675 (name "sakura")
676 (version "3.7.0")
677 (source (origin
678 (method url-fetch)
679 (uri (string-append "https://launchpad.net/" name "/trunk/"
680 version "/+download/" name "-" version
681 ".tar.gz"))
682 (sha256
683 (base32
684 "15gskj5yv5qs3cj4ps43735kfx2nzjlhq4dk9ghirl8lvhhxsm5m"))))
685 (build-system cmake-build-system)
686 (arguments
687 '(#:tests? #f)) ; no check phase
688 (native-inputs
689 `(("gettext" ,gettext-minimal)
690 ("perl" ,perl) ; for pod2man
691 ("pkg-config" ,pkg-config)))
692 (inputs
693 `(("libxft" ,libxft)
694 ("vte" ,vte)))
695 (home-page "https://launchpad.net/sakura")
696 (synopsis "A simple but powerful libvte-based terminal emulator")
697 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
698 It's a terminal emulator with few dependencies, so you don't need a full GNOME
699 desktop installed to have a decent terminal emulator.")
700 (license license:gpl2)))
701
702 (define-public go-github.com-nsf-termbox-go
703 (let ((commit "288510b9734e30e7966ec2f22b87c5f8e67345e3")
704 (revision "1"))
705 (package
706 (name "go-github.com-nsf-termbox-go")
707 (version (git-version "0.0.0" revision commit))
708 (source (origin
709 (method git-fetch)
710 (uri (git-reference
711 (url "https://github.com/nsf/termbox-go.git")
712 (commit commit)))
713 (file-name (git-file-name name version))
714 (sha256
715 (base32
716 "0hdyisfaf8yb55h3p03p4sbq19546mp9fy28f2kn659mycmhxqk4"))))
717 (build-system go-build-system)
718 (arguments
719 '(#:import-path "github.com/nsf/termbox-go"))
720 (propagated-inputs
721 `(("go-github.com-mattn-go-runewidth"
722 ,go-github.com-mattn-go-runewidth)))
723 (synopsis "@code{termbox} provides a minimal API for text-based user
724 interfaces")
725 (description
726 "Termbox is a library that provides a minimalistic API which allows the
727 programmer to write text-based user interfaces.")
728 (home-page "https://github.com/nsf/termbox-go")
729 (license license:expat))))
730
731 (define-public go-github-com-junegunn-fzf
732 (package
733 (name "go-github-com-junegunn-fzf")
734 (version "0.18.0")
735 (source
736 (origin
737 (method git-fetch)
738 (uri (git-reference
739 (url "https://github.com/junegunn/fzf")
740 (commit version)))
741 (file-name (git-file-name name version))
742 (sha256
743 (base32
744 "0pwpr4fpw56yzzkcabzzgbgwraaxmp7xzzmap7w1xsrkbj7dl2xl"))))
745 (build-system go-build-system)
746 (arguments
747 `(#:import-path "github.com/junegunn/fzf"))
748 (inputs
749 `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
750 ("go-github-com-mattn-go-shellwords" ,go-github-com-mattn-go-shellwords)
751 ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
752 ("go-github-com-gdamore-tcell" ,go-github-com-gdamore-tcell)
753 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
754 (home-page "https://github.com/junegunn/fzf")
755 (synopsis "Command-line fuzzy-finder")
756 (description "This package provides an interactive command-line filter
757 usable with any list--including files, command history, processes and more.")
758 (license license:expat)))
759
760 (define-public go-github.com-howeyc-gopass
761 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
762 (revision "0"))
763 (package
764 (name "go-github.com-howeyc-gopass")
765 (version (git-version "0.0.0" revision commit))
766 (source (origin
767 (method git-fetch)
768 (uri (git-reference
769 (url "https://github.com/howeyc/gopass.git")
770 (commit commit)))
771 (file-name (git-file-name name version))
772 (sha256
773 (base32
774 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
775 (build-system go-build-system)
776 (arguments
777 '(#:import-path "github.com/howeyc/gopass"))
778 (propagated-inputs
779 `(("go-golang-org-x-crypto"
780 ,go-golang-org-x-crypto)))
781 (synopsis "Retrieve password from a terminal or piped input in Go")
782 (description
783 "@code{gopass} is a Go package for retrieving a password from user
784 terminal or piped input.")
785 (home-page "https://github.com/howeyc/gopass")
786 (license license:isc))))
787
788 (define-public python-pyte
789 (package
790 (name "python-pyte")
791 (version "0.7.0")
792 (source
793 (origin
794 (method url-fetch)
795 (uri (pypi-uri "pyte" version))
796 (sha256
797 (base32
798 "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
799 (build-system python-build-system)
800 (arguments
801 '(#:phases
802 (modify-phases %standard-phases
803 (add-after 'unpack 'remove-failing-test
804 ;; TODO: Reenable when the `captured` files required by this test
805 ;; are included in the archive.
806 (lambda _
807 (delete-file "tests/test_input_output.py")
808 #t)))))
809 (propagated-inputs
810 `(("python-wcwidth" ,python-wcwidth)))
811 (native-inputs
812 `(("python-pytest-runner" ,python-pytest-runner)
813 ("python-pytest" ,python-pytest)))
814 (home-page "https://pyte.readthedocs.io/")
815 (synopsis "Simple VTXXX-compatible terminal emulator")
816 (description "@code{pyte} is an in-memory VTxxx-compatible terminal
817 emulator. @var{VTxxx} stands for a series of video terminals, developed by
818 DEC between 1970 and 1995. The first and probably most famous one was the
819 VT100 terminal, which is now a de-facto standard for all virtual terminal
820 emulators.
821
822 pyte is a fork of vt102, which was an incomplete pure Python implementation
823 of VT100 terminal.")
824 (license license:lgpl3+)))
825
826 (define-public python2-pyte
827 (package-with-python2 python-pyte))
828
829 (define-public python-blessings
830 (package
831 (name "python-blessings")
832 (version "1.7")
833 (source
834 (origin
835 (method url-fetch)
836 (uri (pypi-uri "blessings" version))
837 (sha256
838 (base32
839 "0z8mgkbmisxs10rz88qg46l1c9a8n08k8cy2iassal2zh16qbrcq"))))
840 (build-system python-build-system)
841 (arguments
842 ;; FIXME: Test suite is unable to detect TTY conditions.
843 `(#:tests? #f))
844 (native-inputs
845 `(("python-nose" ,python-nose)
846 ("python-six" ,python-six)))
847 (home-page "https://github.com/erikrose/blessings")
848 (synopsis "Python module to manage terminal color, styling, and
849 positioning")
850 (description "Blessings is a pythonic API to manipulate terminal color,
851 styling, and positioning. It provides similar features to curses but avoids
852 some of curses’s limitations: it does not require clearing the whole screen
853 for little changes, provides a scroll-back buffer after the program exits, and
854 avoids styling altogether when the output is redirected to something other
855 than a terminal.")
856 (license license:expat)))
857
858 (define-public python2-blessings
859 (package-with-python2 python-blessings))
860
861 (define-public python-curtsies
862 (package
863 (name "python-curtsies")
864 (version "0.2.11")
865 (source
866 (origin
867 (method url-fetch)
868 (uri (pypi-uri "curtsies" version))
869 (sha256
870 (base32
871 "1vljmw3sy6lrqahhpyg4gk13mzcx3mwhvg8s41698ms3cpgkjipc"))))
872 (build-system python-build-system)
873 (arguments
874 `(#:phases
875 (modify-phases %standard-phases
876 (replace 'check
877 (lambda _
878 (invoke "nosetests" "-v"))))))
879 (propagated-inputs
880 `(("python-blessings" ,python-blessings)
881 ("python-wcwidth" ,python-wcwidth)))
882 (native-inputs
883 `(("python-mock" ,python-mock)
884 ("python-pyte" ,python-pyte)
885 ("python-nose" ,python-nose)))
886 (home-page "https://github.com/thomasballinger/curtsies")
887 (synopsis "Library for curses-like terminal interaction with colored
888 strings")
889 (description "Curtsies is a Python library for interacting with the
890 terminal. It features string-like objects which carry formatting information,
891 per-line fullscreen terminal rendering, and keyboard input event reporting.")
892 (license license:expat)))
893
894 (define-public python2-curtsies
895 (package-with-python2 python-curtsies))
896
897 (define-public tmate
898 (package
899 (name "tmate")
900 (version "2.2.1")
901 (source
902 (origin
903 (method git-fetch)
904 (uri (git-reference
905 (url "https://github.com/tmate-io/tmate.git")
906 (commit version)))
907 (file-name (git-file-name name version))
908 (sha256
909 (base32
910 "0pfl9vrswzim9ydi1n652h3rax2zrmy6sqkp0r09yy3lw83h4y1r"))))
911 (build-system gnu-build-system)
912 (inputs
913 `(("libevent" ,libevent)
914 ("libssh" ,libssh)
915 ("msgpack" ,msgpack)
916 ("ncurses" ,ncurses)))
917 (native-inputs
918 `(("autoconf" ,autoconf)
919 ("automake" ,automake)
920 ("pkg-config" ,pkg-config)))
921 (home-page "https://tmate.io/")
922 (synopsis "Terminal sharing application")
923 (description "tmate is a terminal sharing application that allows you to
924 share your terminal with other users over the Internet. tmate is a fork of
925 tmux.")
926 (license license:isc)))
927
928 (define-public kitty
929 (package
930 (name "kitty")
931 (version "0.14.6")
932 (home-page "https://sw.kovidgoyal.net/kitty/")
933 (source
934 (origin
935 (method git-fetch)
936 (uri (git-reference
937 (url "https://github.com/kovidgoyal/kitty.git")
938 (commit (string-append "v" version))))
939 (file-name (git-file-name name version))
940 (sha256
941 (base32 "1rb5ys9xsdhd2qa3kz5gqzz111c6b14za98va6hlglk69wqlmb51"))
942 (modules '((guix build utils)))
943 (snippet
944 '(begin
945 ;; patch needed as sphinx-build is used as a python script
946 ;; whereas the guix package uses a bash script launching the
947 ;; python script
948 (substitute* "docs/conf.py"
949 (("(from kitty.constants import str_version)" kitty-imp)
950 (string-append "sys.path.append(\"..\")\n" kitty-imp)))
951 (substitute* "docs/Makefile"
952 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
953 "SPHINXBUILD = sphinx-build\n"))
954 #t))))
955 (build-system gnu-build-system)
956 (inputs
957 `(("python" ,python)
958 ("harfbuzz" ,harfbuzz)
959 ("zlib" ,zlib)
960 ("libcanberra" ,libcanberra)
961 ("libpng" ,libpng)
962 ("freetype" ,freetype)
963 ("fontconfig" ,fontconfig)
964 ("pygments" ,python-pygments)
965 ("wayland" ,wayland)))
966 (native-inputs
967 `(("pkg-config" ,pkg-config)
968 ("libxrandr" ,libxrandr)
969 ("libdbus" ,dbus)
970 ("libxcursor" ,libxcursor)
971 ("libxi" ,libxi)
972 ("libxinerama" ,libxinerama)
973 ("libgl1-mesa" ,mesa)
974 ("libxkbcommon" ,libxkbcommon)
975 ("sphinx" ,python-sphinx)
976 ("ncurses" ,ncurses) ;; for tic command
977 ("wayland-protocols" ,wayland-protocols)))
978 (arguments
979 '(#:phases (modify-phases %standard-phases
980 (delete 'configure)
981 ;; Wayland backend requires EGL, which isn't found
982 ;; out-of-the-box for some reason. Hard-code it instead.
983 (add-after 'unpack 'hard-code-libegl
984 (lambda _
985 (let* ((mesa (assoc-ref %build-inputs "libgl1-mesa"))
986 (libegl (string-append mesa "/lib/libEGL.so.1")))
987 (substitute* "glfw/egl_context.c"
988 (("libEGL.so.1") libegl)))
989 #t))
990 (replace 'build
991 (lambda _
992 (invoke "python3" "setup.py" "linux-package")))
993 (replace 'check
994 (lambda _
995 (invoke "python3" "setup.py" "test")))
996 (add-before 'install 'rm-pycache
997 ;; created python cache __pycache__ are non deterministic
998 (lambda _
999 (let ((pycaches (find-files "linux-package/"
1000 "__pycache__"
1001 #:directories? #t)))
1002 (for-each delete-file-recursively pycaches)
1003 #t)))
1004 (replace 'install
1005 (lambda _
1006 (let* ((out (assoc-ref %outputs "out"))
1007 (obin (string-append out "/bin"))
1008 (olib (string-append out "/lib"))
1009 (oshare (string-append out "/share")))
1010 (copy-recursively "linux-package/bin" obin)
1011 (copy-recursively "linux-package/share" oshare)
1012 (copy-recursively "linux-package/lib" olib)
1013 #t))))))
1014 (synopsis "Fast, featureful, GPU based terminal emulator")
1015 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1016 @itemize
1017 @item Offloads rendering to the GPU for lower system load and buttery smooth
1018 scrolling. Uses threaded rendering to minimize input latency.
1019 @item Supports all modern terminal features: graphics (images), unicode,
1020 true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1021 paste and several new terminal protocol extensions.
1022 @item Supports tiling multiple terminal windows side by side in different
1023 layouts without needing to use an extra program like tmux.
1024 @item Can be controlled from scripts or the shell prompt, even over SSH.
1025 @item Has a framework for Kittens, small terminal programs that can be used to
1026 extend kitty's functionality. For example, they are used for Unicode input,
1027 hints, and side-by-side diff.
1028 @item Supports startup sessions which allow you to specify the window/tab
1029 layout, working directories and programs to run on startup.
1030 @item Allows you to open the scrollback buffer in a separate window using
1031 arbitrary programs of your choice. This is useful for browsing the history
1032 comfortably in a pager or editor.
1033 @end itemize")
1034 (license license:gpl3+)))
1035
1036 (define-public eternalterminal
1037 (package
1038 (name "eternalterminal")
1039 (version "5.1.10")
1040 (source
1041 (origin
1042 (method git-fetch)
1043 (uri (git-reference
1044 (url "https://github.com/MisterTea/EternalTerminal.git")
1045 (commit (string-append "et-v" version))))
1046 (file-name (git-file-name name version))
1047 (sha256
1048 (base32 "0jh89229bd9s82h3aj6faaybwr5xvnk8w2kgz47gq263pz021zpl"))))
1049 (build-system cmake-build-system)
1050 (arguments
1051 '(#:configure-flags '("-DBUILD_TEST=ON")
1052 #:phases
1053 (modify-phases %standard-phases
1054 (add-after 'unpack 'insert-googletests
1055 (lambda* (#:key inputs #:allow-other-keys)
1056 (let ((tests (assoc-ref inputs "googletest")))
1057 (copy-recursively tests "external/googletest"))
1058 #t))
1059 (add-after 'install 'dont-provide-gtest-libraries
1060 (lambda* (#:key outputs #:allow-other-keys)
1061 (let ((out (assoc-ref outputs "out")))
1062 (delete-file-recursively (string-append out "/include"))
1063 (delete-file-recursively (string-append out "/lib")))
1064 #t)))))
1065 (inputs
1066 `(("gflags" ,gflags)
1067 ("libsodium" ,libsodium)
1068 ("protobuf" ,protobuf)))
1069 (native-inputs
1070 `(("googletest" ,(package-source googletest))))
1071 (home-page "https://mistertea.github.io/EternalTerminal/")
1072 (synopsis "Remote shell that reconnects without interrupting the session")
1073 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1074 automatically reconnects without interrupting the session. ET uses SSH to
1075 initialize a secure connection. Unlike SSH sessions, which must be killed and
1076 reconnected after a network outage an ET session will survive network outages
1077 and IP roaming. ET provides the same core functionality as @command{mosh},
1078 while also supporting native scrolling and @command{tmux} control mode
1079 (@code{tmux -CC}).")
1080 (license license:asl2.0)))
1081
1082 (define-public wterm
1083 (package
1084 (name "wterm")
1085 (version "0.7")
1086 (source
1087 (origin
1088 (method git-fetch)
1089 (uri (git-reference
1090 (url "https://github.com/majestrate/wterm.git")
1091 (commit "0ae42717c08a85a6509214e881422c7fbe7ecc45")))
1092 (sha256
1093 (base32
1094 "0g4lzmc1w6na81i6hny32xds4xfig4xzswzfijyi6p93a1226dv0"))
1095 (file-name (git-file-name name version))))
1096 (build-system gnu-build-system)
1097 (native-inputs
1098 `(("pkg-config" ,pkg-config)))
1099 (inputs
1100 `(("fontconfig" ,fontconfig)
1101 ("freetype" ,freetype)
1102 ("libdrm" ,libdrm)
1103 ("libxkbcommon" ,libxkbcommon)
1104 ("ncurses" ,ncurses)
1105 ("pixman" ,pixman)
1106 ("wayland" ,wayland)))
1107 (arguments
1108 '(#:tests? #f
1109
1110 ;; Without -j1 it fails to find file libwld.a.
1111 #:parallel-build? #f
1112
1113 #:make-flags (list "CC=gcc"
1114 (string-append "PREFIX=" %output)
1115 (string-append "TERMINFO="
1116 (assoc-ref %outputs "out")
1117 "/share/terminfo"))
1118 #:phases
1119 (modify-phases %standard-phases
1120 (delete 'configure)
1121 (add-after 'unpack 'terminfo-fix
1122 (lambda _
1123 (substitute* "Makefile"
1124 (("\ttic .*") "\tmkdir -p $(SHARE_PREFIX)/share/terminfo
1125 \ttic -o $(SHARE_PREFIX)/share/terminfo -s wterm.info\n"))
1126 #t)))))
1127 (native-search-paths
1128 (list (search-path-specification
1129 (variable "TERMINFO_DIRS")
1130 (files '("share/terminfo")))))
1131 (home-page "https://github.com/majestrate/wterm")
1132 (synopsis "Terminal emulator for Wayland")
1133 (description "wterm is a native Wayland terminal emulator based on
1134 an st fork using wld. st is a simple terminal emulator for X originally
1135 made by suckless.")
1136 (license license:x11)))