gnu: libdvdcss: Update to 1.4.3.
[jackhill/guix/guix.git] / gnu / packages / terminals.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 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, 2020 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
8 ;;; Copyright © 2017–2021 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, 2020 Brett Gilio <brettg@gnu.org>
20 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
21 ;;; Copyright © 2020 Valentin Ignatev <valentignatev@gmail.com>
22 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
23 ;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
24 ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
25 ;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
26 ;;;
27 ;;; This file is part of GNU Guix.
28 ;;;
29 ;;; GNU Guix is free software; you can redistribute it and/or modify it
30 ;;; under the terms of the GNU General Public License as published by
31 ;;; the Free Software Foundation; either version 3 of the License, or (at
32 ;;; your option) any later version.
33 ;;;
34 ;;; GNU Guix is distributed in the hope that it will be useful, but
35 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 ;;; GNU General Public License for more details.
38 ;;;
39 ;;; You should have received a copy of the GNU General Public License
40 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42 (define-module (gnu packages terminals)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix build-system cargo)
45 #:use-module (guix build-system cmake)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system glib-or-gtk)
48 #:use-module (guix build-system go)
49 #:use-module (guix build-system meson)
50 #:use-module (guix build-system python)
51 #:use-module (guix download)
52 #:use-module (guix git-download)
53 #:use-module (guix packages)
54 #:use-module (guix utils)
55 #:use-module (gnu packages)
56 #:use-module (gnu packages autotools)
57 #:use-module (gnu packages build-tools) ;for meson-0.55
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages cmake)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages crates-io)
62 #:use-module (gnu packages crates-graphics)
63 #:use-module (gnu packages crypto)
64 #:use-module (gnu packages docbook)
65 #:use-module (gnu packages fontutils)
66 #:use-module (gnu packages freedesktop)
67 #:use-module (gnu packages gettext)
68 #:use-module (gnu packages ghostscript)
69 #:use-module (gnu packages gl)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages golang)
73 #:use-module (gnu packages gtk)
74 #:use-module (gnu packages image)
75 #:use-module (gnu packages libcanberra)
76 #:use-module (gnu packages libevent)
77 #:use-module (gnu packages linux)
78 #:use-module (gnu packages man)
79 #:use-module (gnu packages ncurses)
80 #:use-module (gnu packages perl)
81 #:use-module (gnu packages perl-check)
82 #:use-module (gnu packages pkg-config)
83 #:use-module (gnu packages popt)
84 #:use-module (gnu packages protobuf)
85 #:use-module (gnu packages python)
86 #:use-module (gnu packages python-web)
87 #:use-module (gnu packages python-xyz)
88 #:use-module (gnu packages qt)
89 #:use-module (gnu packages serialization)
90 #:use-module (gnu packages sphinx)
91 #:use-module (gnu packages ssh)
92 #:use-module (gnu packages textutils)
93 #:use-module (gnu packages xdisorg)
94 #:use-module (gnu packages xml)
95 #:use-module (gnu packages xorg)
96 #:use-module (srfi srfi-26))
97
98 (define-public tilda
99 (package
100 (name "tilda")
101 (version "1.5.4")
102 (source (origin
103 (method git-fetch)
104 (uri (git-reference
105 (url "https://github.com/lanoxx/tilda")
106 (commit (string-append "tilda-" version))))
107 (file-name (git-file-name name version))
108 (sha256
109 (base32
110 "0q2i9ny8sh7zjzgvkx8vcvk593wcvchjc4xq4nrlqdd377r7cg5q"))))
111 (build-system glib-or-gtk-build-system)
112 (arguments
113 `(#:phases
114 (modify-phases %standard-phases
115 (add-after 'unpack 'make-po-writable
116 (lambda _
117 (for-each make-file-writable (find-files "po" "."))
118 #t)))))
119 (native-inputs
120 `(("autoconf" ,autoconf)
121 ("automake" ,automake)
122 ("gettext" ,gettext-minimal)
123 ("pkg-config" ,pkg-config)))
124 (inputs
125 `(("libconfuse" ,libconfuse)
126 ("vte" ,vte)))
127 (synopsis "GTK+-based drop-down terminal")
128 (description "Tilda is a terminal emulator similar to normal terminals like
129 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
130 from the edge of a screen when a certain configurable hotkey is pressed. This
131 is similar to the built-in consoles in some applications. Tilda is highly
132 configurable through a graphical wizard.")
133 (home-page "https://github.com/lanoxx/tilda")
134 (license license:gpl2+)))
135
136 (define-public termite
137 (package
138 (name "termite")
139 (version "15")
140 (source
141 (origin
142 (method git-fetch)
143 (uri (git-reference
144 (url (string-append "https://github.com/thestinger/"
145 name ".git"))
146 (commit (string-append "v" version))
147 (recursive? #t)))
148 (file-name (string-append name "-" version "-checkout"))
149 (sha256
150 (base32
151 "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k"))))
152 (build-system gnu-build-system)
153 (arguments
154 `(#:phases
155 (modify-phases %standard-phases
156 (add-after 'unpack 'patch-xdg-open
157 (lambda _
158 (substitute* "termite.cc"
159 (("xdg-open") (which "xdg-open")))
160 #t))
161 (delete 'configure))
162 #:tests? #f
163 ;; This sets the destination when installing the necessary terminal
164 ;; capability data, which are not provided by 'ncurses'. See
165 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
166 #:make-flags (list "PREFIX="
167 (string-append "VERSION=v" (version))
168 (string-append "DESTDIR="
169 (assoc-ref %outputs "out")))))
170 (inputs
171 `(("vte" ,vte-ng)
172 ("gtk+" ,gtk+)
173 ("xdg-utils" ,xdg-utils)
174 ("ncurses" ,ncurses)))
175 (native-inputs
176 `(("pkg-config" ,pkg-config)))
177
178 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
179 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
180 (native-search-paths
181 (list (search-path-specification
182 (variable "TERMINFO_DIRS")
183 (files '("share/terminfo")))))
184 (home-page "https://github.com/thestinger/termite/")
185 (synopsis "Keyboard-centric, VTE-based terminal")
186 (description "Termite is a minimal terminal emulator designed for use with
187 tiling window managers. It is a modal application, similar to Vim, with an
188 insert mode and command mode where keybindings have different functions.")
189
190 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
191 (license license:lgpl2.0+)))
192
193 (define-public asciinema
194 (package
195 (name "asciinema")
196 (version "2.0.2")
197 (source
198 (origin
199 (method git-fetch)
200 (uri (git-reference
201 (url "https://github.com/asciinema/asciinema")
202 (commit (string-append "v" version))))
203 (file-name (git-file-name name version))
204 (sha256
205 (base32
206 "1a2pysxnp6icyd08mgf66xr6f6j0irnfxdpf3fmzcz31ix7l9kc4"))))
207 (build-system python-build-system)
208 (arguments
209 `(#:phases
210 (modify-phases %standard-phases
211 (add-before 'build 'patch-exec-paths
212 (lambda* (#:key inputs #:allow-other-keys)
213 (let ((ncurses (assoc-ref inputs "ncurses")))
214 (substitute* "asciinema/term.py"
215 (("'tput'")
216 (string-append "'" ncurses "/bin/tput'"))))
217 #t))
218 (replace 'check
219 (lambda _ (invoke "nosetests" "-v"))))))
220 (inputs `(("ncurses" ,ncurses)))
221 (native-inputs
222 ;; For tests.
223 `(("python-nose" ,python-nose)))
224 (home-page "https://asciinema.org")
225 (synopsis "Terminal session recorder")
226 (description
227 "Use asciinema to record and share your terminal sessions, the right way.
228 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
229 text-based approach to terminal recording.")
230 (license license:gpl3)))
231
232 (define-public libtsm
233 (let ((commit "f70e37982f382b03c6939dac3d5f814450bda253")
234 (revision "1"))
235 (package
236 (name "libtsm")
237 (version (git-version "0.0.0" revision commit))
238 (source
239 (origin
240 (method git-fetch)
241 ;; The freedesktop repository is no longer maintained.
242 (uri (git-reference
243 (url (string-append "https://github.com/Aetf/" name))
244 (commit commit)))
245 (file-name (git-file-name name version))
246 (sha256
247 (base32 "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx"))
248 (modules '((guix build utils)))
249 (snippet
250 '(begin
251 ;; Remove a bundled copy of libxkbcommon's xkbcommon-keysyms.h.
252 (delete-file-recursively "external/xkbcommon")
253 #t))))
254 (build-system cmake-build-system)
255 (arguments
256 `(#:configure-flags '("-DBUILD_TESTING=ON")))
257 (native-inputs
258 `(("check" ,check)
259 ("libxkbcommon" ,libxkbcommon) ; for xkbcommon-keysyms.h
260 ("pkg-config" ,pkg-config)))
261 (synopsis "Xterm state machine library")
262 (description "TSM is a state machine for DEC VT100-VT520 compatible
263 terminal emulators. It tries to support all common standards while keeping
264 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
265 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
266 ;; Hash table implementation is lgpl2.1+ licensed.
267 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
268 ;; derived from ISC.
269 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
270 ;; under the bsd 2 license.
271 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2)))))
272
273 (define-public kmscon
274 (let ((commit "01dd0a231e2125a40ceba5f59fd945ff29bf2cdc")
275 (revision "1"))
276 (package
277 (name "kmscon")
278 (version (git-version "0.0.0" revision commit))
279 (source (origin
280 (method git-fetch)
281 ;; The freedesktop repository is no longer maintained.
282 (uri (git-reference
283 (url (string-append "https://github.com/Aetf/" name))
284 (commit commit)))
285 (sha256
286 (base32
287 "0q62kjsvy2iwy8adfiygx2bfwlh83rphgxbis95ycspqidg9py87"))
288 (patches
289 (search-patches "kmscon-runtime-keymap-switch.patch"))
290 (modules '((guix build utils)))
291 (file-name (git-file-name name version))))
292 (build-system gnu-build-system)
293 (arguments
294 `(;; The closure of MESA is huge so we'd rather avoid it.
295 #:disallowed-references (,mesa)
296
297 #:phases (modify-phases %standard-phases
298 ;; Use elogind instead of systemd.
299 (add-before 'configure 'remove-systemd
300 (lambda _
301 (substitute* "configure"
302 (("libsystemd-daemon libsystemd-login")
303 "libelogind"))
304 (substitute* "src/uterm_systemd.c"
305 (("#include <systemd/sd-login.h>")
306 "#include <elogind/sd-login.h>")
307 ;; We don't have this header.
308 (("#include <systemd/sd-daemon\\.h>")
309 "")
310 ;; Replace the call to 'sd_booted' by the truth value.
311 (("sd_booted\\(\\)")
312 "1")))))))
313 (native-inputs
314 `(("pkg-config" ,pkg-config)
315 ("autoconf" ,autoconf)
316 ("automake" ,automake)
317 ("libtool" ,libtool)
318 ("libxslt" ,libxslt) ;to build the man page
319 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
320 ("docbook-xsl" ,docbook-xsl)))
321 (inputs
322 `(("libdrm" ,libdrm)
323 ("libtsm" ,libtsm)
324 ("libxkbcommon" ,libxkbcommon)
325 ("logind" ,elogind)
326 ;; MESA can be used for accelerated video output via OpenGLESv2, but
327 ;; it's a bit dependency that we'd rather avoid in the installation
328 ;; image.
329 ;; ("mesa" ,mesa)
330 ("pango" ,pango)
331 ("udev" ,eudev)))
332 (synopsis "Linux KMS-based terminal emulator")
333 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
334 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
335 implementation with a user-space console. Compared to the Linux console,
336 kmscon provides enhanced features including XKB-compatible internationalized
337 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
338 multi-seat support, a replacement for @command{mingetty}, and more.")
339 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
340 ;; Hash table implementation is lgpl2.1+ licensed.
341 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
342 ;; derived from ISC.
343 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
344 ;; under the bsd 2 license.
345 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
346 ;; under the terms of the GNU GPL.
347 (license (list license:expat license:lgpl2.1+ license:bsd-2
348 license:gpl2+))
349 (supported-systems (filter (cut string-suffix? "-linux" <>)
350 %supported-systems)))))
351
352 (define-public libtermkey
353 (package
354 (name "libtermkey")
355 (version "0.22")
356 (source (origin
357 (method url-fetch)
358 (uri (string-append "http://www.leonerd.org.uk/code/libtermkey/"
359 "libtermkey-" version ".tar.gz"))
360 (sha256
361 (base32 "002606rrxh5f6l6jrikl0dyxsknscdamq10av21xm0xa98ybsib9"))))
362 (build-system gnu-build-system)
363 (arguments
364 `(#:make-flags (list
365 (string-append "CC=" ,(cc-for-target))
366 (string-append "PREFIX=" (assoc-ref %outputs "out")))
367 #:phases
368 (modify-phases %standard-phases
369 (delete 'configure) ; no configure script
370 (add-before 'check 'patch-failing-test
371 ;; XXX This undoes an upstream change in version 0.22 which ‘ensures
372 ;; that the hooked function can invent TI strings for new terminal
373 ;; types’. That fails in the build environment. Why?
374 (lambda _
375 (substitute* "t/40ti-override.c"
376 (("vt750") "vt100")))))
377 #:test-target "test"))
378 (inputs `(("ncurses" ,ncurses)))
379 (native-inputs `(("libtool" ,libtool)
380 ("perl-test-harness" ,perl-test-harness)
381 ("pkg-config" ,pkg-config)))
382 (synopsis "Keyboard entry processing library for terminal-based programs")
383 (description
384 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
385 combining, and so on, with a simple interface.")
386 (home-page "http://www.leonerd.org.uk/code/libtermkey")
387 (license license:expat)))
388
389 (define-public picocom
390 (package
391 (name "picocom")
392 (version "3.1")
393 (source (origin
394 (method git-fetch)
395 (uri (git-reference
396 (url "https://github.com/npat-efault/picocom")
397 (commit version)))
398 (file-name (git-file-name name version))
399 (sha256
400 (base32
401 "1vvjydqf0ax47nvdyyl67jafw5b3sfsav00xid6qpgia1gs2r72n"))))
402 (build-system gnu-build-system)
403 (arguments
404 `(#:make-flags (list (string-append "CC=" ,(cc-for-target)))
405 #:tests? #f ; no tests
406 #:phases
407 (modify-phases %standard-phases
408 (delete 'configure) ; no configure script
409 (replace 'install
410 ;; The Makefile lacks an ‘install’ target.
411 (lambda* (#:key outputs #:allow-other-keys)
412 (let* ((out (assoc-ref outputs "out"))
413 (bin (string-append out "/bin"))
414 (man (string-append out "/share/man/man1")))
415 (install-file "picocom" bin)
416 (install-file "picocom.1" man)))))))
417 (home-page "https://github.com/npat-efault/picocom")
418 (synopsis "Minimal dumb-terminal emulator")
419 (description
420 "Picocom is a minimal dumb-terminal emulation program. It was designed to
421 serve as a simple and manual modem configuration, testing, and debugging tool.
422 It also serves well as a low-tech serial communications program to allow access
423 to all types of devices that provide serial consoles.")
424 (license license:gpl2+)))
425
426 (define-public beep
427 (package
428 (name "beep")
429 (version "1.4.9")
430 (source
431 (origin
432 (method git-fetch)
433 (uri (git-reference
434 ;; The original beep 1.3 at <http://www.johnath.com/beep> has been
435 ;; unmaintained for some time, and vulnerable to at least two CVEs:
436 ;; https://github.com/johnath/beep/issues/11#issuecomment-454056858
437 ;; Use this maintained fork instead.
438 (url "https://github.com/spkr-beep/beep")
439 (commit (string-append "v" version))))
440 (file-name (git-file-name name version))
441 (sha256
442 (base32 "0jmvqk6g5n0wzj9znw42njxq3mzw1769f4db99b83927hf4aidi4"))))
443 (build-system gnu-build-system)
444 (arguments
445 `(#:tests? #f ; no tests
446 #:make-flags
447 (list (string-append "prefix=" (assoc-ref %outputs "out"))
448 (string-append "pkgdocdir=$(docdir)/" ,name "-" ,version))
449 #:phases
450 (modify-phases %standard-phases
451 (delete 'configure)))) ; no configure script
452 (synopsis "Linux command-line utility to control the PC speaker")
453 (description "beep allows the user to control the PC speaker with precision,
454 allowing different sounds to indicate different events. While it can be run
455 quite happily on the command line, its intended place of residence is within
456 scripts, notifying the user when something interesting occurs. Of course, it
457 has no notion of what's interesting, but it's very good at that notifying part.")
458 (home-page "https://github.com/spkr-beep/beep")
459 (license license:gpl2+)))
460
461 (define-public unibilium
462 (package
463 (name "unibilium")
464 (version "2.0.0")
465 (source
466 (origin
467 (method git-fetch)
468 (uri (git-reference
469 (url "https://github.com/mauke/unibilium")
470 (commit (string-append "v" version))))
471 (file-name (git-file-name name version))
472 (sha256
473 (base32
474 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
475 (build-system gnu-build-system)
476 (arguments
477 `(#:make-flags
478 (list "CC=gcc"
479 (string-append "PREFIX=" (assoc-ref %outputs "out")))
480 #:test-target "test"
481 ;; FIXME: tests require "prove"
482 #:tests? #f
483 #:phases
484 (modify-phases %standard-phases
485 (delete 'configure))))
486 (native-inputs
487 `(("libtool" ,libtool)
488 ("perl" ,perl)))
489 (home-page "https://github.com/mauke/unibilium")
490 (synopsis "Terminfo parsing library")
491 (description "Unibilium is a basic C terminfo library. It doesn't depend
492 on curses or any other library. It also doesn't use global variables, so it
493 should be thread-safe.")
494 (license license:lgpl3+)))
495
496 (define-public libvterm
497 (package
498 (name "libvterm")
499 (version "0.1.4")
500 (source
501 (origin
502 (method url-fetch)
503 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
504 "libvterm-" version ".tar.gz"))
505 (sha256
506 (base32
507 "1pfkhbbihd2kvaza707vl2nvk7bxaawmb37wf9v6d72mjng38w5w"))))
508 (build-system gnu-build-system)
509 (arguments
510 `(#:make-flags
511 (list "CC=gcc"
512 (string-append "PREFIX=" (assoc-ref %outputs "out")))
513 #:test-target "test"
514 #:phases
515 (modify-phases %standard-phases
516 (delete 'configure))))
517 (native-inputs
518 `(("libtool" ,libtool)
519 ("perl" ,perl)))
520 (home-page "http://www.leonerd.org.uk/code/libvterm/")
521 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
522 (description "Libvterm is an abstract C99 library which implements a VT220
523 or xterm-like terminal emulator. It doesn't use any particular graphics
524 toolkit or output system, instead it invokes callback function pointers that
525 its embedding program should provide it to draw on its behalf. It avoids
526 calling @code{malloc} during normal running state, allowing it to be used in
527 embedded kernel situations.")
528 (license license:expat)))
529
530 (define-public cool-retro-term
531 (let ((commit "1.1.1")
532 (revision "0")) ;not used currently
533 (package
534 (name "cool-retro-term")
535 (version "1.1.1")
536 (source (origin
537 (method git-fetch)
538 (file-name (string-append name "-" version "-checkout"))
539 (uri (git-reference
540 (url (string-append "https://github.com/Swordfish90/" name))
541 (commit commit)
542 (recursive? #t)))
543 (sha256
544 (base32 "0wb6anchxa5jpn9c73kr4byrf2xlj8x8qzc5x7ny6saj7kbbvp75"))
545 (modules '((guix build utils)
546 (srfi srfi-1)
547 (srfi srfi-26)
548 (ice-9 rdelim)
549 (ice-9 regex)))
550 (snippet
551 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
552 "1977-apple2" ; Non-Free
553 "1977-commodore-pet" ; Non-Free
554 "1979-atari-400-800" ; Non-Free
555 ;"1981-ibm-pc ; CC-SA 4.0
556 "1982-commodore64")) ; Non-Free
557 ;"1985-ibm-pc-vga" ; CC-SA 4.0
558 ;"modern-fixedsys-excelsior" ; Redistributable
559 ;"modern-hermit" ; SIL
560 ;"modern-inconsolata"; SIL
561 ;"modern-pro-font-win-tweaked" ; X11
562 ;"modern-proggy-tiny"; X11
563 ;"modern-terminus" ; SIL
564 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
565 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
566 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
567 (names
568 ;; Gather font names from all Fonts*.qml files.
569 ;; These will be used to remove items from the
570 ;; default profiles.
571 (fold
572 (lambda (font-file names)
573 (call-with-input-file font-file
574 (lambda (port)
575 (let loop ((name #f) (names names))
576 (let ((line (read-line port)))
577 (cond
578 ((eof-object? line) (pk 'names names))
579 ((regexp-exec name-rx line)
580 => (lambda (m)
581 (loop (match:substring m 1) names)))
582 ((regexp-exec source-rx line)
583 => (lambda (m)
584 (let ((font (match:substring m 1)))
585 (if (member font fonts)
586 (loop #f (lset-adjoin string=?
587 names name))
588 (loop #f names)))))
589 (else (loop name names))))))))
590 '() (find-files "app/qml" "Font.*\\.qml"))))
591 ;; Remove the font files themselves
592 (for-each (lambda (font)
593 (delete-file-recursively
594 (string-append "app/qml/fonts/" font)))
595 fonts)
596 ;; Remove mention of those fonts in the source
597 (substitute* "app/qml/resources.qrc"
598 (((string-append " *<file>fonts/("
599 (string-join fonts "|")
600 ").*"))
601 ""))
602 (for-each
603 (lambda (file)
604 (let ((start-rx (make-regexp " *ListElement\\{"))
605 (end-rx (make-regexp " *\\}")))
606 (with-atomic-file-replacement file
607 (lambda (in out)
608 (let loop ((line-buffer '())
609 (hold? #f)
610 (discard? #f))
611 (let ((line (read-line in 'concat)))
612 (cond
613 ((eof-object? line) #t) ;done
614 ((regexp-exec start-rx line)
615 (loop (cons line line-buffer) #t #f))
616 ((or (regexp-exec source-rx line)
617 (regexp-exec fontname-rx line))
618 => (lambda (m)
619 (let ((font-or-name (match:substring m 1)))
620 (if (or (member font-or-name fonts)
621 (member font-or-name names))
622 (loop '() #f #t)
623 (loop (cons line line-buffer)
624 hold? #f)))))
625 ((regexp-exec end-rx line)
626 (unless discard?
627 (for-each (cut display <> out)
628 (reverse line-buffer))
629 (display line out))
630 (loop '() #f #f))
631 (hold? (loop (cons line line-buffer)
632 hold? discard?))
633 (discard? (loop line-buffer #f #t))
634 (else (display line out)
635 (loop '() #f #f)))))))))
636 '("app/qml/FontPixels.qml"
637 "app/qml/FontScanlines.qml"
638 "app/qml/Fonts.qml"
639 "app/qml/ApplicationSettings.qml"))
640 ;; Final substitution for default scanline and pixel fonts
641 (substitute* "app/qml/ApplicationSettings.qml"
642 (("COMMODORE_PET") "PROGGY_TINY"))
643 #t))))
644 (build-system gnu-build-system)
645 (inputs
646 `(("qtbase" ,qtbase)
647 ("qtdeclarative" ,qtdeclarative)
648 ("qtgraphicaleffects" ,qtgraphicaleffects)
649 ("qtquickcontrols" ,qtquickcontrols)))
650 (arguments
651 `(#:phases
652 (modify-phases %standard-phases
653 (replace 'configure
654 (lambda* (#:key outputs #:allow-other-keys)
655 (let ((out (assoc-ref outputs "out")))
656 (substitute* '("qmltermwidget/qmltermwidget.pro")
657 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
658 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
659 (substitute* '("cool-retro-term.pro" "app/app.pro")
660 (("/usr") out))
661 (invoke "qmake"))))
662 (add-after 'install 'wrap-executable
663 (lambda* (#:key inputs outputs #:allow-other-keys)
664 (let ((out (assoc-ref outputs "out"))
665 (qml "/lib/qt5/qml"))
666 (wrap-program (string-append out "/bin/cool-retro-term")
667 `("QML2_IMPORT_PATH" ":" prefix
668 (,(string-append out qml)
669 ,@(map (lambda (i)
670 (string-append (assoc-ref inputs i) qml))
671 '("qtdeclarative"
672 "qtgraphicaleffects"
673 "qtquickcontrols")))))
674 #t)))
675 (add-after 'install 'add-alternate-name
676 (lambda* (#:key outputs #:allow-other-keys)
677 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
678 (symlink (string-append bin "/cool-retro-term")
679 (string-append bin "/crt"))
680 #t)))
681 (add-after 'install 'install-man
682 (lambda* (#:key outputs #:allow-other-keys)
683 (let ((mandir (string-append (assoc-ref outputs "out")
684 "/share/man/man1")))
685 (install-file "packaging/debian/cool-retro-term.1" mandir)
686 #t))))))
687 (synopsis "Terminal emulator")
688 (description
689 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
690 feel of the old cathode ray tube (CRT) screens. It has been designed to be
691 eye-candy, customizable, and reasonably lightweight.")
692 (home-page "https://github.com/Swordfish90/cool-retro-term")
693 (license (list
694 license:gpl2+ ; qmltermwidget
695 license:gpl3+ ; cool-retro-term
696 ;; Fonts
697 license:silofl1.1
698 license:x11
699 license:bsd-3)))))
700
701 (define-public foot
702 (package
703 (name "foot")
704 (version "1.6.3")
705 (home-page "https://codeberg.org/dnkl/foot")
706 (source (origin
707 (method git-fetch)
708 (uri (git-reference (url home-page) (commit version)))
709 (file-name (git-file-name name version))
710 (sha256
711 (base32
712 "0rm7w29wf3gipf69qf7s42qw8857z74gsigrpz9g6vvd1x58f03m"))))
713 (build-system meson-build-system)
714 (arguments
715 `(#:meson ,meson-0.55
716 ;; Using a "release" build is recommended both for performance, and
717 ;; also to address a GCC 10 issue when doing PGO builds.
718 #:build-type "release"
719 ;; Enable LTO as recommended by INSTALL.md.
720 #:configure-flags '("-Db_lto=true")))
721 (native-inputs
722 `(("ncurses" ,ncurses) ;for 'tic'
723 ("pkg-config" ,pkg-config)
724 ("scdoc" ,scdoc)
725 ("wayland-protocols" ,wayland-protocols)))
726 (inputs
727 `(("fcft" ,fcft)
728 ("libxkbcommon" ,libxkbcommon)
729 ("wayland" ,wayland)))
730 (synopsis "Wayland-native terminal emulator")
731 (description
732 "@command{foot} is a terminal emulator for systems using the Wayland
733 display server. It is designed to be fast, lightweight, and independent of
734 desktop environments. It can be used as a standalone terminal and also has
735 a server/client mode.")
736 (license license:expat)))
737
738 (define-public sakura
739 (package
740 (name "sakura")
741 (version "3.7.1")
742 (source (origin
743 (method url-fetch)
744 (uri (string-append "https://launchpad.net/sakura/trunk/"
745 version "/+download/sakura-" version
746 ".tar.bz2"))
747 (sha256
748 (base32
749 "12wjmckf03qbnm8cb7qma0980anzajn3l92rj2yr8hhafl74x6kj"))))
750 (build-system cmake-build-system)
751 (arguments
752 '(#:tests? #f)) ; no check phase
753 (native-inputs
754 `(("gettext" ,gettext-minimal)
755 ("perl" ,perl) ; for pod2man
756 ("pkg-config" ,pkg-config)))
757 (inputs
758 `(("libxft" ,libxft)
759 ("vte" ,vte)))
760 (home-page "https://launchpad.net/sakura")
761 (synopsis "A simple but powerful libvte-based terminal emulator")
762 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
763 It's a terminal emulator with few dependencies, so you don't need a full GNOME
764 desktop installed to have a decent terminal emulator.")
765 (license license:gpl2)))
766
767 (define-public go-github.com-nsf-termbox-go
768 (let ((commit "288510b9734e30e7966ec2f22b87c5f8e67345e3")
769 (revision "1"))
770 (package
771 (name "go-github.com-nsf-termbox-go")
772 (version (git-version "0.0.0" revision commit))
773 (source (origin
774 (method git-fetch)
775 (uri (git-reference
776 (url "https://github.com/nsf/termbox-go")
777 (commit commit)))
778 (file-name (git-file-name name version))
779 (sha256
780 (base32
781 "0hdyisfaf8yb55h3p03p4sbq19546mp9fy28f2kn659mycmhxqk4"))))
782 (build-system go-build-system)
783 (arguments
784 '(#:import-path "github.com/nsf/termbox-go"))
785 (propagated-inputs
786 `(("go-github.com-mattn-go-runewidth"
787 ,go-github.com-mattn-go-runewidth)))
788 (synopsis "@code{termbox} provides a minimal API for text-based user
789 interfaces")
790 (description
791 "Termbox is a library that provides a minimalistic API which allows the
792 programmer to write text-based user interfaces.")
793 (home-page "https://github.com/nsf/termbox-go")
794 (license license:expat))))
795
796 (define-public go-github-com-junegunn-fzf
797 (package
798 (name "go-github-com-junegunn-fzf")
799 (version "0.25.0")
800 (source
801 (origin
802 (method git-fetch)
803 (uri (git-reference
804 (url "https://github.com/junegunn/fzf")
805 (commit version)))
806 (file-name (git-file-name name version))
807 (sha256
808 (base32
809 "1j5bfxl4w8w3n89p051y8dhxg0py9l98v7r2gkr63bg4lj32faz8"))))
810 (build-system go-build-system)
811 (arguments
812 `(#:import-path "github.com/junegunn/fzf"))
813 (inputs
814 `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
815 ("go-github-com-mattn-go-shellwords" ,go-github-com-mattn-go-shellwords)
816 ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
817 ("go-github-com-gdamore-tcell" ,go-github-com-gdamore-tcell)
818 ("go-github-com-saracen-walker" ,go-github-com-saracen-walker)
819 ("go-golang.org-x-sync-errgroup" ,go-golang.org-x-sync-errgroup)
820 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
821 (home-page "https://github.com/junegunn/fzf")
822 (synopsis "Command-line fuzzy-finder")
823 (description "This package provides an interactive command-line filter
824 usable with any list--including files, command history, processes and more.")
825 (license license:expat)))
826
827 (define-public fzf
828 (package
829 (inherit go-github-com-junegunn-fzf)
830 (name "fzf")
831 (arguments
832 (ensure-keyword-arguments
833 (package-arguments go-github-com-junegunn-fzf)
834 `(#:phases
835 (modify-phases %standard-phases
836 (add-after 'install 'copy-binaries
837 (lambda* (#:key outputs #:allow-other-keys)
838 (let ((out (assoc-ref outputs "out")))
839 (with-directory-excursion "src/github.com/junegunn/fzf"
840 (install-file "bin/fzf-tmux"
841 (string-append out "/bin"))))))
842 (add-after 'copy-binaries 'wrap-programs
843 (lambda* (#:key outputs inputs #:allow-other-keys)
844 (let ((out (assoc-ref outputs "out"))
845 (ncurses (assoc-ref inputs "ncurses")))
846 (wrap-program (string-append out "/bin/fzf-tmux")
847 `("PATH" ":" prefix (,(string-append ncurses "/bin")))))))
848 (add-after 'install 'install-completions
849 (lambda* (#:key outputs #:allow-other-keys)
850 (let* ((out (assoc-ref outputs "out"))
851 (bash-completion (string-append out "/etc/bash_completion.d"))
852 (zsh-completion (string-append out "/share/zsh/site-functions")))
853 (with-directory-excursion "src/github.com/junegunn/fzf"
854 (mkdir-p bash-completion)
855 (copy-file "shell/completion.bash"
856 (string-append bash-completion "/fzf"))
857 (mkdir-p zsh-completion)
858 (copy-file "shell/completion.zsh"
859 (string-append zsh-completion "/_fzf"))))))))))
860 (inputs
861 `(,@(package-inputs go-github-com-junegunn-fzf)
862 ("ncurses" ,ncurses)))))
863
864 (define-public go-github.com-howeyc-gopass
865 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
866 (revision "0"))
867 (package
868 (name "go-github.com-howeyc-gopass")
869 (version (git-version "0.0.0" revision commit))
870 (source (origin
871 (method git-fetch)
872 (uri (git-reference
873 (url "https://github.com/howeyc/gopass")
874 (commit commit)))
875 (file-name (git-file-name name version))
876 (sha256
877 (base32
878 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
879 (build-system go-build-system)
880 (arguments
881 '(#:import-path "github.com/howeyc/gopass"))
882 (propagated-inputs
883 `(("go-golang-org-x-crypto"
884 ,go-golang-org-x-crypto)))
885 (synopsis "Retrieve password from a terminal or piped input in Go")
886 (description
887 "@code{gopass} is a Go package for retrieving a password from user
888 terminal or piped input.")
889 (home-page "https://github.com/howeyc/gopass")
890 (license license:isc))))
891
892 (define-public python-pyte
893 (package
894 (name "python-pyte")
895 (version "0.7.0")
896 (source
897 (origin
898 (method url-fetch)
899 (uri (pypi-uri "pyte" version))
900 (sha256
901 (base32
902 "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
903 (build-system python-build-system)
904 (arguments
905 '(#:phases
906 (modify-phases %standard-phases
907 (add-after 'unpack 'remove-failing-test
908 ;; TODO: Reenable when the `captured` files required by this test
909 ;; are included in the archive.
910 (lambda _
911 (delete-file "tests/test_input_output.py")
912 #t)))))
913 (propagated-inputs
914 `(("python-wcwidth" ,python-wcwidth)))
915 (native-inputs
916 `(("python-pytest-runner" ,python-pytest-runner)
917 ("python-pytest" ,python-pytest)))
918 (home-page "https://pyte.readthedocs.io/")
919 (synopsis "Simple VTXXX-compatible terminal emulator")
920 (description "@code{pyte} is an in-memory VTxxx-compatible terminal
921 emulator. @var{VTxxx} stands for a series of video terminals, developed by
922 DEC between 1970 and 1995. The first and probably most famous one was the
923 VT100 terminal, which is now a de-facto standard for all virtual terminal
924 emulators.
925
926 pyte is a fork of vt102, which was an incomplete pure Python implementation
927 of VT100 terminal.")
928 (license license:lgpl3+)))
929
930 (define-public python2-pyte
931 (package-with-python2 python-pyte))
932
933 (define-public python-blessings
934 (package
935 (name "python-blessings")
936 (version "1.7")
937 (source
938 (origin
939 (method url-fetch)
940 (uri (pypi-uri "blessings" version))
941 (sha256
942 (base32
943 "0z8mgkbmisxs10rz88qg46l1c9a8n08k8cy2iassal2zh16qbrcq"))))
944 (build-system python-build-system)
945 (arguments
946 ;; FIXME: Test suite is unable to detect TTY conditions.
947 `(#:tests? #f))
948 (native-inputs
949 `(("python-nose" ,python-nose)
950 ("python-six" ,python-six)))
951 (home-page "https://github.com/erikrose/blessings")
952 (synopsis "Python module to manage terminal color, styling, and
953 positioning")
954 (description "Blessings is a pythonic API to manipulate terminal color,
955 styling, and positioning. It provides similar features to curses but avoids
956 some of curses’s limitations: it does not require clearing the whole screen
957 for little changes, provides a scroll-back buffer after the program exits, and
958 avoids styling altogether when the output is redirected to something other
959 than a terminal.")
960 (license license:expat)))
961
962 (define-public python2-blessings
963 (package-with-python2 python-blessings))
964
965 (define-public python-curtsies
966 (package
967 (name "python-curtsies")
968 (version "0.3.4")
969 (source
970 (origin
971 (method url-fetch)
972 (uri (pypi-uri "curtsies" version))
973 (sha256
974 (base32
975 "019bpf5wmng4f6ic2ykg893ypfihpfvzi6dhblcagfwbincl79ac"))))
976 (build-system python-build-system)
977 (arguments
978 `(#:phases
979 (modify-phases %standard-phases
980 (replace 'check
981 (lambda _
982 (invoke "nosetests" "-v"))))))
983 (propagated-inputs
984 `(("python-blessings" ,python-blessings)
985 ("python-wcwidth" ,python-wcwidth)))
986 (native-inputs
987 `(("python-mock" ,python-mock)
988 ("python-pyte" ,python-pyte)
989 ("python-nose" ,python-nose)))
990 (home-page "https://github.com/bpython/curtsies")
991 (synopsis "Library for curses-like terminal interaction with colored
992 strings")
993 (description "Curtsies is a Python library for interacting with the
994 terminal. It features string-like objects which carry formatting information,
995 per-line fullscreen terminal rendering, and keyboard input event reporting.")
996 (license license:expat)))
997
998 (define-public tmate
999 (package
1000 (name "tmate")
1001 (version "2.4.0")
1002 (source
1003 (origin
1004 (method git-fetch)
1005 (uri (git-reference
1006 (url "https://github.com/tmate-io/tmate")
1007 (commit version)))
1008 (file-name (git-file-name name version))
1009 (sha256
1010 (base32
1011 "0x5c31yq7ansmiy20a0qf59wagba9v3pq97mlkxrqxn4n1gcc6vi"))))
1012 (build-system gnu-build-system)
1013 (inputs
1014 `(("libevent" ,libevent)
1015 ("libssh" ,libssh)
1016 ("msgpack" ,msgpack)
1017 ("ncurses" ,ncurses)))
1018 (native-inputs
1019 `(("autoconf" ,autoconf)
1020 ("automake" ,automake)
1021 ("pkg-config" ,pkg-config)))
1022 (home-page "https://tmate.io/")
1023 (synopsis "Terminal sharing application")
1024 (description "tmate is a terminal sharing application that allows you to
1025 share your terminal with other users over the Internet. tmate is a fork of
1026 tmux.")
1027 (license license:isc)))
1028
1029 (define-public kitty
1030 (package
1031 (name "kitty")
1032 (version "0.19.3")
1033 (home-page "https://sw.kovidgoyal.net/kitty/")
1034 (source
1035 (origin
1036 (method git-fetch)
1037 (uri (git-reference
1038 (url "https://github.com/kovidgoyal/kitty")
1039 (commit (string-append "v" version))))
1040 (file-name (git-file-name name version))
1041 (sha256
1042 (base32 "0r49bybqy6c0n1lz6yc85py80wb40w757m60f5rszjf200wnyl6s"))
1043 (modules '((guix build utils)))
1044 (snippet
1045 '(begin
1046 ;; patch needed as sphinx-build is used as a python script
1047 ;; whereas the guix package uses a bash script launching the
1048 ;; python script
1049 (substitute* "docs/conf.py"
1050 (("(from kitty.constants import str_version)" kitty-imp)
1051 (string-append "sys.path.append(\"..\")\n" kitty-imp)))
1052 (substitute* "docs/Makefile"
1053 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
1054 "SPHINXBUILD = sphinx-build\n"))
1055 #t))))
1056 (build-system gnu-build-system)
1057 (native-inputs
1058 `(("libdbus" ,dbus)
1059 ("libgl1-mesa" ,mesa)
1060 ("libxcursor" ,libxcursor)
1061 ("libxi" ,libxi)
1062 ("libxinerama" ,libxinerama)
1063 ("libxkbcommon" ,libxkbcommon)
1064 ("libxrandr" ,libxrandr)
1065 ("ncurses" ,ncurses) ;; for tic command
1066 ("pkg-config" ,pkg-config)
1067 ("sphinx" ,python-sphinx)
1068 ("wayland-protocols" ,wayland-protocols)))
1069 (inputs
1070 `(("fontconfig" ,fontconfig)
1071 ("freetype" ,freetype)
1072 ("harfbuzz" ,harfbuzz)
1073 ("lcms" ,lcms)
1074 ("libcanberra" ,libcanberra)
1075 ("libpng" ,libpng)
1076 ("pygments" ,python-pygments)
1077 ("python" ,python-wrapper)
1078 ("wayland" ,wayland)
1079 ("zlib" ,zlib)))
1080 (arguments
1081 '(#:phases (modify-phases %standard-phases
1082 (delete 'configure) ;no configure script
1083 (replace 'build
1084 (lambda* (#:key inputs #:allow-other-keys)
1085 ;; The "kitty" sub-directory must be writable prior to
1086 ;; configuration (e.g., un-setting updates).
1087 (for-each make-file-writable (find-files "kitty"))
1088
1089 (invoke "python3" "setup.py" "linux-package"
1090 ;; Do not phone home.
1091 "--update-check-interval=0"
1092 ;; Wayland backend requires EGL, which isn't
1093 ;; found out-of-the-box for some reason.
1094 (string-append "--egl-library="
1095 (assoc-ref inputs "libgl1-mesa")
1096 "/lib/libEGL.so.1"))))
1097 (replace 'check
1098 (lambda _
1099 ;; Fix "cannot find kitty executable" error when running
1100 ;; tests.
1101 (setenv "PATH" (string-append "linux-package/bin:"
1102 (getenv "PATH")))
1103 (invoke "python3" "test.py")))
1104 (add-before 'install 'rm-pycache
1105 ;; created python cache __pycache__ are non deterministic
1106 (lambda _
1107 (let ((pycaches (find-files "linux-package/"
1108 "__pycache__"
1109 #:directories? #t)))
1110 (for-each delete-file-recursively pycaches)
1111 #t)))
1112 (replace 'install
1113 (lambda _
1114 (let* ((out (assoc-ref %outputs "out"))
1115 (obin (string-append out "/bin"))
1116 (olib (string-append out "/lib"))
1117 (oshare (string-append out "/share")))
1118 (copy-recursively "linux-package/bin" obin)
1119 (copy-recursively "linux-package/share" oshare)
1120 (copy-recursively "linux-package/lib" olib)
1121 #t))))))
1122 (synopsis "Fast, featureful, GPU based terminal emulator")
1123 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1124 @itemize
1125 @item Offloads rendering to the GPU for lower system load and buttery smooth
1126 scrolling. Uses threaded rendering to minimize input latency.
1127 @item Supports all modern terminal features: graphics (images), unicode,
1128 true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1129 paste and several new terminal protocol extensions.
1130 @item Supports tiling multiple terminal windows side by side in different
1131 layouts without needing to use an extra program like tmux.
1132 @item Can be controlled from scripts or the shell prompt, even over SSH.
1133 @item Has a framework for Kittens, small terminal programs that can be used to
1134 extend kitty's functionality. For example, they are used for Unicode input,
1135 hints, and side-by-side diff.
1136 @item Supports startup sessions which allow you to specify the window/tab
1137 layout, working directories and programs to run on startup.
1138 @item Allows you to open the scrollback buffer in a separate window using
1139 arbitrary programs of your choice. This is useful for browsing the history
1140 comfortably in a pager or editor.
1141 @end itemize")
1142 (license license:gpl3+)))
1143
1144 (define-public eternalterminal
1145 (package
1146 (name "eternalterminal")
1147 (version "6.0.13")
1148 (source
1149 (origin
1150 (method git-fetch)
1151 (uri (git-reference
1152 (url "https://github.com/MisterTea/EternalTerminal")
1153 (commit (string-append "et-v" version))))
1154 (file-name (git-file-name name version))
1155 (sha256
1156 (base32 "0sb1hypg2276y8c2a5vivrkcxp70swddvhnd9h273if3kv6j879r"))))
1157 (build-system cmake-build-system)
1158 (arguments
1159 '(#:configure-flags '("-DBUILD_TEST=ON")
1160 #:phases
1161 (modify-phases %standard-phases
1162 (add-after 'unpack 'insert-googletests
1163 (lambda* (#:key inputs #:allow-other-keys)
1164 (let ((tests (assoc-ref inputs "googletest")))
1165 (copy-recursively tests "external/googletest"))
1166 #t)))))
1167 (inputs
1168 `(("gflags" ,gflags)
1169 ("libsodium" ,libsodium)
1170 ("protobuf" ,protobuf)))
1171 (native-inputs
1172 `(("googletest" ,(package-source googletest))))
1173 (home-page "https://mistertea.github.io/EternalTerminal/")
1174 (synopsis "Remote shell that reconnects without interrupting the session")
1175 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1176 automatically reconnects without interrupting the session. ET uses SSH to
1177 initialize a secure connection. Unlike SSH sessions, which must be killed and
1178 reconnected after a network outage an ET session will survive network outages
1179 and IP roaming. ET provides the same core functionality as @command{mosh},
1180 while also supporting native scrolling and @command{tmux} control mode
1181 (@code{tmux -CC}).")
1182 (license license:asl2.0)))
1183
1184 (define-public et
1185 (deprecated-package "et" eternalterminal))
1186
1187 (define-public wterm
1188 (package
1189 (name "wterm")
1190 (version "0.7")
1191 (source
1192 (origin
1193 (method git-fetch)
1194 (uri (git-reference
1195 (url "https://github.com/majestrate/wterm")
1196 (commit "0ae42717c08a85a6509214e881422c7fbe7ecc45")))
1197 (sha256
1198 (base32
1199 "0g4lzmc1w6na81i6hny32xds4xfig4xzswzfijyi6p93a1226dv0"))
1200 (file-name (git-file-name name version))))
1201 (build-system gnu-build-system)
1202 (native-inputs
1203 `(("pkg-config" ,pkg-config)))
1204 (inputs
1205 `(("fontconfig" ,fontconfig)
1206 ("freetype" ,freetype)
1207 ("libdrm" ,libdrm)
1208 ("libxkbcommon" ,libxkbcommon)
1209 ("ncurses" ,ncurses)
1210 ("pixman" ,pixman)
1211 ("wayland" ,wayland)))
1212 (arguments
1213 '(#:tests? #f
1214
1215 ;; Without -j1 it fails to find file libwld.a.
1216 #:parallel-build? #f
1217
1218 #:make-flags (list "CC=gcc"
1219 (string-append "PREFIX=" %output)
1220 (string-append "TERMINFO="
1221 (assoc-ref %outputs "out")
1222 "/share/terminfo"))
1223 #:phases
1224 (modify-phases %standard-phases
1225 (delete 'configure)
1226 (add-after 'unpack 'terminfo-fix
1227 (lambda _
1228 (substitute* "Makefile"
1229 (("\ttic .*") "\tmkdir -p $(SHARE_PREFIX)/share/terminfo
1230 \ttic -o $(SHARE_PREFIX)/share/terminfo -s wterm.info\n"))
1231 #t)))))
1232 (native-search-paths
1233 (list (search-path-specification
1234 (variable "TERMINFO_DIRS")
1235 (files '("share/terminfo")))))
1236 (home-page "https://github.com/majestrate/wterm")
1237 (synopsis "Terminal emulator for Wayland")
1238 (description "wterm is a native Wayland terminal emulator based on
1239 an st fork using wld. st is a simple terminal emulator for X originally
1240 made by suckless.")
1241 (license license:x11)))
1242
1243 (define-public alacritty
1244 (package
1245 (name "alacritty")
1246 (version "0.7.1")
1247 (source
1248 (origin
1249 ;; XXX: The crate at "crates.io" has limited contents. In particular,
1250 ;; it does not contain "extra" directory with completions, icon, etc.
1251 (method git-fetch)
1252 (uri (git-reference
1253 (url "https://github.com/jwilm/alacritty")
1254 (commit (string-append "v" version))))
1255 (file-name (git-file-name name version))
1256 (sha256
1257 (base32 "1b9hy3ya72hhpl8nkayc7dy4f97xp75np48dm5na5pgyv8b45agi"))))
1258 (build-system cargo-build-system)
1259 (arguments
1260 `(#:install-source? #f ; virtual manifest
1261 #:cargo-test-flags '("--release" "--" "--skip=config_read_eof")
1262 #:cargo-inputs
1263 (("rust-alacritty-config-derive" ,rust-alacritty-config-derive-0.1)
1264 ("rust-alacritty-terminal" ,rust-alacritty-terminal-0.12)
1265 ("rust-clap" ,rust-clap-2)
1266 ("rust-cocoa" ,rust-cocoa-0.24)
1267 ("rust-copypasta" ,rust-copypasta-0.7)
1268 ("rust-crossfont" ,rust-crossfont-0.2)
1269 ("rust-embed-resource" ,rust-embed-resource-1)
1270 ("rust-fnv" ,rust-fnv-1)
1271 ("rust-gl-generator" ,rust-gl-generator-0.14)
1272 ;; XXX: Adjust `add-absolute-library-references' phase when updating
1273 ;; glutin input.
1274 ("rust-glutin" ,rust-glutin-0.26)
1275 ("rust-log" ,rust-log-0.4)
1276 ("rust-notify" ,rust-notify-4)
1277 ("rust-objc" ,rust-objc-0.2)
1278 ("rust-parking-lot" ,rust-parking-lot-0.11)
1279 ("rust-png" ,rust-png-0.16)
1280 ("rust-raw-window-handle" ,rust-raw-window-handle-0.3)
1281 ("rust-serde" ,rust-serde-1)
1282 ("rust-serde-json" ,rust-serde-json-1)
1283 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
1284 ("rust-time" ,rust-time-0.1)
1285 ("rust-urlocator" ,rust-urlocator-0.1)
1286 ("rust-x11-dl" ,rust-x11-dl-2)
1287 ("rust-xdg" ,rust-xdg-2))
1288 #:phases
1289 (modify-phases %standard-phases
1290 (add-after 'configure 'add-absolute-library-references
1291 (lambda* (#:key inputs cargo-inputs vendor-dir #:allow-other-keys)
1292 (let* ((glutin-name ,(package-name rust-glutin-0.26))
1293 (glutin-version ,(package-version rust-glutin-0.26))
1294 (glutin-api (string-append glutin-name "-" glutin-version
1295 ".tar.gz/src/api/"))
1296 (smithay-client-toolkit-name
1297 ,(package-name rust-smithay-client-toolkit-0.12))
1298 (smithay-client-toolkit-version
1299 ,(package-version rust-smithay-client-toolkit-0.12))
1300 (smithay-client-toolkit-src
1301 (string-append smithay-client-toolkit-name "-"
1302 smithay-client-toolkit-version ".tar.gz/src"))
1303 (libxkbcommon (assoc-ref inputs "libxkbcommon"))
1304 (mesa (assoc-ref inputs "mesa")))
1305 ;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
1306 ;; Failed to initialize any backend! Wayland status: NoWaylandLib
1307 ;; XXX We patch transitive dependencies that aren't even direct
1308 ;; inputs to this package, because of the way Guix's Rust build
1309 ;; system currently works. <http://issues.guix.gnu.org/46399>
1310 ;; might fix this and allow patching them directly.
1311 (substitute* (string-append vendor-dir "/"
1312 smithay-client-toolkit-src
1313 "/seat/keyboard/ffi.rs")
1314 (("libxkbcommon\\.so")
1315 (string-append libxkbcommon "/lib/libxkbcommon.so")))
1316
1317 ;; Mesa is needed everywhere.
1318 (substitute*
1319 (string-append vendor-dir "/" glutin-api "glx/mod.rs")
1320 (("libGL.so") (string-append mesa "/lib/libGL.so")))
1321 (substitute*
1322 (string-append vendor-dir "/" glutin-api "egl/mod.rs")
1323 (("libEGL.so") (string-append mesa "/lib/libEGL.so")))
1324 #t)))
1325 (replace 'install
1326 ;; Upstream install script only takes care of executable.
1327 (lambda* (#:key inputs outputs #:allow-other-keys)
1328 (let* ((out (assoc-ref outputs "out"))
1329 (bin (string-append out "/bin"))
1330 (share (string-append out "/share"))
1331 (icons (string-append share "/icons/hicolor/scalable/apps"))
1332 (tic (string-append (assoc-ref inputs "ncurses") "/bin/tic"))
1333 (man (string-append share "/man/man1"))
1334 (alacritty-bin "target/release/alacritty"))
1335 ;; Install the executable.
1336 (install-file alacritty-bin bin)
1337 ;; Install man pages.
1338 (mkdir-p man)
1339 (copy-file "extra/alacritty.man"
1340 (string-append man "/alacritty.1"))
1341 ;; Install desktop file.
1342 (install-file "extra/linux/Alacritty.desktop"
1343 (string-append share "/applications"))
1344 ;; Install icon.
1345 (mkdir-p icons)
1346 (copy-file "extra/logo/alacritty-term.svg"
1347 (string-append icons "/Alacritty.svg"))
1348 ;; Install terminfo.
1349 (mkdir-p (string-append share "/terminfo"))
1350 ;; We don't compile alacritty-common entry because
1351 ;; it's being used only for inheritance.
1352 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1353 "-o" (string-append share "/terminfo/")
1354 "extra/alacritty.info")
1355 ;; Install completions.
1356 (install-file "extra/completions/alacritty.bash"
1357 (string-append out "/etc/bash_completion.d"))
1358 (install-file "extra/completions/_alacritty"
1359 (string-append share "/zsh/site-functions"))
1360 (install-file "extra/completions/alacritty.fish"
1361 (string-append share "/fish/vendor_completions.d"))
1362 #t))))))
1363 (native-inputs
1364 `(("cmake" ,cmake)
1365 ("ncurses" ,ncurses)
1366 ("pkg-config" ,pkg-config)
1367 ("python3" ,python)))
1368 (inputs
1369 `(("expat" ,expat)
1370 ("fontconfig" ,fontconfig)
1371 ("freetype" ,freetype)
1372 ("libx11" ,libx11)
1373 ("libxcb" ,libxcb)
1374 ("libxcursor" ,libxcursor)
1375 ("libxi" ,libxi)
1376 ("libxkbcommon" ,libxkbcommon)
1377 ("libxrandr" ,libxrandr)
1378 ("libxxf86vm" ,libxxf86vm)
1379 ("mesa" ,mesa)
1380 ("rust-bitflags" ,rust-bitflags-1)
1381 ("rust-dirs" ,rust-dirs-2)
1382 ("rust-libc" ,rust-libc-0.2)
1383 ("rust-unicode-width" ,rust-unicode-width-0.1)
1384 ("rust-wayland-client" ,rust-wayland-client-0.28)
1385 ("rust-winapi" ,rust-winapi-0.3)
1386 ("wayland" ,wayland)))
1387 (native-search-paths
1388 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1389 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1390 (list (search-path-specification
1391 (variable "TERMINFO_DIRS")
1392 (files '("share/terminfo")))))
1393 (home-page "https://github.com/alacritty/alacritty")
1394 (synopsis "GPU-accelerated terminal emulator")
1395 (description
1396 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1397 simplicity and performance. With such a strong focus on performance, included
1398 features are carefully considered and you can always expect Alacritty to be
1399 blazingly fast. By making sane choices for defaults, Alacritty requires no
1400 additional setup. However, it does allow configuration of many aspects of the
1401 terminal. Note that you need support for OpenGL 3.2 or higher.")
1402 (license license:asl2.0)))
1403
1404 (define-public bootterm
1405 (package
1406 (name "bootterm")
1407 (version "0.4")
1408 (source (origin
1409 (method git-fetch)
1410 (uri (git-reference
1411 (url "https://github.com/wtarreau/bootterm")
1412 (commit (string-append "v" version))))
1413 (file-name (git-file-name name version))
1414 (sha256
1415 (base32
1416 "1k3jacld98za41dbpr10sjms77hrw91sb10m0cnwv3h7aifiwmrs"))))
1417 (build-system gnu-build-system)
1418 (arguments
1419 `(#:tests? #f ; no test suite
1420 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1421 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1422 #:phases
1423 (modify-phases %standard-phases
1424 ;; No ./configure script
1425 (delete 'configure)
1426 (add-after 'install 'install-doc
1427 (lambda* (#:key outputs #:allow-other-keys)
1428 (let* ((out (assoc-ref outputs "out"))
1429 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1430 (install-file "README.md" doc)
1431 #t))))))
1432 (home-page "https://github.com/wtarreau/bootterm")
1433 (synopsis "Serial terminal")
1434 (description "Bootterm is a terminal designed to ease connection to
1435 ephemeral serial ports. It features automatic port detection, port enumeration,
1436 support for non-standard baud rates, the ability to wait for ports to appear,
1437 and the ability to read and write via stdin and stdout.")
1438 (license license:expat)))