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