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