1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 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, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
10 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
12 ;;; Copyright © 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
13 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
14 ;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
15 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018, 2019 Eric Bavier <bavier@member.fsf.org>
17 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
18 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
19 ;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
20 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
21 ;;; Copyright © 2020 Valentin Ignatev <valentignatev@gmail.com>
22 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
24 ;;; This file is part of GNU Guix.
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
39 (define-module (gnu packages terminals)
40 #:use-module ((guix licenses) #:prefix license:)
41 #:use-module (guix build-system cargo)
42 #:use-module (guix build-system cmake)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system glib-or-gtk)
45 #:use-module (guix build-system go)
46 #:use-module (guix build-system python)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix packages)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages cmake)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages crates-io)
56 #:use-module (gnu packages crypto)
57 #:use-module (gnu packages docbook)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages gcc)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages gl)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages golang)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages image)
68 #:use-module (gnu packages libcanberra)
69 #:use-module (gnu packages libevent)
70 #:use-module (gnu packages linux)
71 #:use-module (gnu packages ncurses)
72 #:use-module (gnu packages perl)
73 #:use-module (gnu packages perl-check)
74 #:use-module (gnu packages pkg-config)
75 #:use-module (gnu packages popt)
76 #:use-module (gnu packages protobuf)
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages python-web)
79 #:use-module (gnu packages python-xyz)
80 #:use-module (gnu packages qt)
81 #:use-module (gnu packages serialization)
82 #:use-module (gnu packages sphinx)
83 #:use-module (gnu packages ssh)
84 #:use-module (gnu packages textutils)
85 #:use-module (gnu packages xdisorg)
86 #:use-module (gnu packages xml)
87 #:use-module (gnu packages xorg)
88 #:use-module (srfi srfi-26))
97 (url "https://github.com/lanoxx/tilda.git")
98 (commit (string-append "tilda-" version))))
99 (file-name (git-file-name name version))
102 "13djibj3s7ig13c57ywy38pxy3qfmqihii2c0g15fy2h9q8xp1gx"))))
103 (build-system glib-or-gtk-build-system)
105 '(#:phases (modify-phases %standard-phases
108 (setenv "NOCONFIGURE" "true")
109 (invoke "sh" "autogen.sh"))))))
111 `(("autoconf" ,autoconf)
112 ("automake" ,automake)
113 ("gettext" ,gettext-minimal)
114 ("pkg-config" ,pkg-config)))
116 `(("libconfuse" ,libconfuse)
118 (synopsis "GTK+-based drop-down terminal")
119 (description "Tilda is a terminal emulator similar to normal terminals like
120 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
121 from the edge of a screen when a certain configurable hotkey is pressed. This
122 is similar to the built-in consoles in some applications. Tilda is highly
123 configurable through a graphical wizard.")
124 (home-page "https://github.com/lanoxx/tilda")
125 (license license:gpl2+)))
127 (define-public termite
135 (url (string-append "https://github.com/thestinger/"
137 (commit (string-append "v" version))
139 (file-name (string-append name "-" version "-checkout"))
142 "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k"))))
143 (build-system gnu-build-system)
146 (modify-phases %standard-phases
147 (add-after 'unpack 'patch-xdg-open
149 (substitute* "termite.cc"
150 (("xdg-open") (which "xdg-open")))
154 ;; This sets the destination when installing the necessary terminal
155 ;; capability data, which are not provided by 'ncurses'. See
156 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
157 #:make-flags (list "PREFIX="
158 (string-append "VERSION=v" (version))
159 (string-append "DESTDIR="
160 (assoc-ref %outputs "out")))))
164 ("xdg-utils" ,xdg-utils)
165 ("ncurses" ,ncurses)))
167 `(("pkg-config" ,pkg-config)))
169 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
170 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
172 (list (search-path-specification
173 (variable "TERMINFO_DIRS")
174 (files '("share/terminfo")))))
175 (home-page "https://github.com/thestinger/termite/")
176 (synopsis "Keyboard-centric, VTE-based terminal")
177 (description "Termite is a minimal terminal emulator designed for use with
178 tiling window managers. It is a modal application, similar to Vim, with an
179 insert mode and command mode where keybindings have different functions.")
181 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
182 (license license:lgpl2.0+)))
184 (define-public asciinema
192 (url "https://github.com/asciinema/asciinema")
193 (commit (string-append "v" version))))
194 (file-name (git-file-name name version))
197 "1a2pysxnp6icyd08mgf66xr6f6j0irnfxdpf3fmzcz31ix7l9kc4"))))
198 (build-system python-build-system)
201 (modify-phases %standard-phases
202 (add-before 'build 'patch-exec-paths
203 (lambda* (#:key inputs #:allow-other-keys)
204 (let ((ncurses (assoc-ref inputs "ncurses")))
205 (substitute* "asciinema/term.py"
207 (string-append "'" ncurses "/bin/tput'"))))
210 (lambda _ (invoke "nosetests" "-v"))))))
211 (inputs `(("ncurses" ,ncurses)))
214 `(("python-nose" ,python-nose)))
215 (home-page "https://asciinema.org")
216 (synopsis "Terminal session recorder")
218 "Use asciinema to record and share your terminal sessions, the right way.
219 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
220 text-based approach to terminal recording.")
221 (license license:gpl3)))
223 (define-public libtsm
224 (let ((commit "f70e37982f382b03c6939dac3d5f814450bda253")
228 (version (git-version "0.0.0" revision commit))
231 ;; The freedesktop repository is no longer maintained.
233 (url (string-append "https://github.com/Aetf/" name))
235 (file-name (git-file-name name version))
238 "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx"))))
239 (build-system cmake-build-system)
241 `(#:configure-flags '("-DBUILD_TESTING=ON")))
243 `(("pkg-config" ,pkg-config)))
245 `(("libxkbcommon" ,libxkbcommon)
247 (synopsis "Xterm state machine library")
248 (description "TSM is a state machine for DEC VT100-VT520 compatible
249 terminal emulators. It tries to support all common standards while keeping
250 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
251 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
252 ;; Hash table implementation is lgpl2.1+ licensed.
253 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
255 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
256 ;; under the bsd 2 license.
257 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2)))))
259 (define-public kmscon
260 (let ((commit "01dd0a231e2125a40ceba5f59fd945ff29bf2cdc")
264 (version (git-version "0.0.0" revision commit))
267 ;; The freedesktop repository is no longer maintained.
269 (url (string-append "https://github.com/Aetf/" name))
273 "0q62kjsvy2iwy8adfiygx2bfwlh83rphgxbis95ycspqidg9py87"))
275 (search-patches "kmscon-runtime-keymap-switch.patch"))
276 (modules '((guix build utils)))
277 (file-name (git-file-name name version))))
278 (build-system gnu-build-system)
280 `(;; The closure of MESA is huge so we'd rather avoid it.
281 #:disallowed-references (,mesa)
283 #:phases (modify-phases %standard-phases
286 (setenv "NOCONFIGURE" "indeed")
287 (invoke "sh" "autogen.sh")))
288 ;; Use elogind instead of systemd.
289 (add-before 'configure 'remove-systemd
291 (substitute* "configure"
292 (("libsystemd-daemon libsystemd-login")
294 (substitute* "src/uterm_systemd.c"
295 (("#include <systemd/sd-login.h>")
296 "#include <elogind/sd-login.h>")
297 ;; We don't have this header.
298 (("#include <systemd/sd-daemon\\.h>")
300 ;; Replace the call to 'sd_booted' by the truth value.
304 `(("pkg-config" ,pkg-config)
305 ("autoconf" ,autoconf)
306 ("automake" ,automake)
308 ("libxslt" ,libxslt) ;to build the man page
309 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
310 ("docbook-xsl" ,docbook-xsl)))
314 ("libxkbcommon" ,libxkbcommon)
316 ;; MESA can be used for accelerated video output via OpenGLESv2, but
317 ;; it's a bit dependency that we'd rather avoid in the installation
322 (synopsis "Linux KMS-based terminal emulator")
323 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
324 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
325 implementation with a user-space console. Compared to the Linux console,
326 kmscon provides enhanced features including XKB-compatible internationalized
327 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
328 multi-seat support, a replacement for @command{mingetty}, and more.")
329 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
330 ;; Hash table implementation is lgpl2.1+ licensed.
331 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
333 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
334 ;; under the bsd 2 license.
335 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
336 ;; under the terms of the GNU GPL.
337 (license (list license:expat license:lgpl2.1+ license:bsd-2
339 (supported-systems (filter (cut string-suffix? "-linux" <>)
340 %supported-systems)))))
342 (define-public libtermkey
348 (uri (string-append "http://www.leonerd.org.uk/code/libtermkey/"
349 "libtermkey-" version ".tar.gz"))
351 (base32 "0psd0kf10q5ixfima0mxz10syy7qq1ilz1npr0rz862xycvzgjyf"))))
352 (build-system gnu-build-system)
356 (string-append "PREFIX=" (assoc-ref %outputs "out")))
357 #:phases (modify-phases %standard-phases
358 (delete 'configure)) ; no configure script
359 #:test-target "test"))
360 (inputs `(("ncurses" ,ncurses)))
361 (native-inputs `(("libtool" ,libtool)
362 ("perl-test-harness" ,perl-test-harness)
363 ("pkg-config" ,pkg-config)))
364 (synopsis "Keyboard entry processing library for terminal-based programs")
366 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
367 combining, and so on, with a simple interface.")
368 (home-page "http://www.leonerd.org.uk/code/libtermkey")
369 (license license:expat)))
371 (define-public picocom
378 (url "https://github.com/npat-efault/picocom.git")
380 (file-name (git-file-name name version))
383 "1vvjydqf0ax47nvdyyl67jafw5b3sfsav00xid6qpgia1gs2r72n"))))
384 (build-system gnu-build-system)
386 `(#:make-flags '("CC=gcc")
387 #:tests? #f ; no tests
389 (modify-phases %standard-phases
390 (delete 'configure) ; no configure script
392 ;; The Makefile lacks an ‘install’ target.
393 (lambda* (#:key outputs #:allow-other-keys)
394 (let* ((out (assoc-ref outputs "out"))
395 (bin (string-append out "/bin"))
396 (man (string-append out "/share/man/man1")))
397 (install-file "picocom" bin)
398 (install-file "picocom.1" man)))))))
399 (home-page "https://github.com/npat-efault/picocom")
400 (synopsis "Minimal dumb-terminal emulator")
402 "Picocom is a minimal dumb-terminal emulation program. It was designed to
403 serve as a simple and manual modem configuration, testing, and debugging tool.
404 It also serves well as a low-tech serial communications program to allow access
405 to all types of devices that provide serial consoles.")
406 (license license:gpl2+)))
416 ;; The original beep 1.3 at <http://www.johnath.com/beep> has been
417 ;; unmaintained for some time, and vulnerable to at least two CVEs:
418 ;; https://github.com/johnath/beep/issues/11#issuecomment-454056858
419 ;; Use this maintained fork instead.
420 (url "https://github.com/spkr-beep/beep.git")
421 (commit (string-append "v" version))))
422 (file-name (git-file-name name version))
424 (base32 "0jmvqk6g5n0wzj9znw42njxq3mzw1769f4db99b83927hf4aidi4"))))
425 (build-system gnu-build-system)
427 `(#:tests? #f ; no tests
429 (list (string-append "prefix=" (assoc-ref %outputs "out"))
430 (string-append "pkgdocdir=$(docdir)/" ,name "-" ,version))
432 (modify-phases %standard-phases
433 (delete 'configure)))) ; no configure script
434 (synopsis "Linux command-line utility to control the PC speaker")
435 (description "beep allows the user to control the PC speaker with precision,
436 allowing different sounds to indicate different events. While it can be run
437 quite happily on the command line, its intended place of residence is within
438 scripts, notifying the user when something interesting occurs. Of course, it
439 has no notion of what's interesing, but it's very good at that notifying part.")
440 (home-page "https://github.com/spkr-beep/beep")
441 (license license:gpl2+)))
443 (define-public unibilium
451 (url "https://github.com/mauke/unibilium.git")
452 (commit (string-append "v" version))))
453 (file-name (git-file-name name version))
456 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
457 (build-system gnu-build-system)
461 (string-append "PREFIX=" (assoc-ref %outputs "out")))
463 ;; FIXME: tests require "prove"
466 (modify-phases %standard-phases
467 (delete 'configure))))
469 `(("libtool" ,libtool)
471 (home-page "https://github.com/mauke/unibilium")
472 (synopsis "Terminfo parsing library")
473 (description "Unibilium is a basic C terminfo library. It doesn't depend
474 on curses or any other library. It also doesn't use global variables, so it
475 should be thread-safe.")
476 (license license:lgpl3+)))
478 (define-public libvterm
485 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
486 "libvterm-" version ".tar.gz"))
489 "1n5maylann2anfifjy576vzyar9q5m1kzpyiz2hca2pacxy8xf4v"))))
490 (build-system gnu-build-system)
494 (string-append "PREFIX=" (assoc-ref %outputs "out")))
497 (modify-phases %standard-phases
498 (delete 'configure))))
500 `(("libtool" ,libtool)
502 (home-page "http://www.leonerd.org.uk/code/libvterm/")
503 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
504 (description "Libvterm is an abstract C99 library which implements a VT220
505 or xterm-like terminal emulator. It doesn't use any particular graphics
506 toolkit or output system, instead it invokes callback function pointers that
507 its embedding program should provide it to draw on its behalf. It avoids
508 calling @code{malloc} during normal running state, allowing it to be used in
509 embedded kernel situations.")
510 (license license:expat)))
512 (define-public cool-retro-term
513 (let ((commit "1.1.1")
514 (revision "0")) ;not used currently
516 (name "cool-retro-term")
520 (file-name (string-append name "-" version "-checkout"))
522 (url (string-append "https://github.com/Swordfish90/" name))
526 (base32 "0wb6anchxa5jpn9c73kr4byrf2xlj8x8qzc5x7ny6saj7kbbvp75"))
527 (modules '((guix build utils)
533 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
534 "1977-apple2" ; Non-Free
535 "1977-commodore-pet" ; Non-Free
536 "1979-atari-400-800" ; Non-Free
537 ;"1981-ibm-pc ; CC-SA 4.0
538 "1982-commodore64")) ; Non-Free
539 ;"1985-ibm-pc-vga" ; CC-SA 4.0
540 ;"modern-fixedsys-excelsior" ; Redistributable
541 ;"modern-hermit" ; SIL
542 ;"modern-inconsolata"; SIL
543 ;"modern-pro-font-win-tweaked" ; X11
544 ;"modern-proggy-tiny"; X11
545 ;"modern-terminus" ; SIL
546 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
547 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
548 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
550 ;; Gather font names from all Fonts*.qml files.
551 ;; These will be used to remove items from the
554 (lambda (font-file names)
555 (call-with-input-file font-file
557 (let loop ((name #f) (names names))
558 (let ((line (read-line port)))
560 ((eof-object? line) (pk 'names names))
561 ((regexp-exec name-rx line)
563 (loop (match:substring m 1) names)))
564 ((regexp-exec source-rx line)
566 (let ((font (match:substring m 1)))
567 (if (member font fonts)
568 (loop #f (lset-adjoin string=?
571 (else (loop name names))))))))
572 '() (find-files "app/qml" "Font.*\\.qml"))))
573 ;; Remove the font files themselves
574 (for-each (lambda (font)
575 (delete-file-recursively
576 (string-append "app/qml/fonts/" font)))
578 ;; Remove mention of those fonts in the source
579 (substitute* "app/qml/resources.qrc"
580 (((string-append " *<file>fonts/("
581 (string-join fonts "|")
586 (let ((start-rx (make-regexp " *ListElement\\{"))
587 (end-rx (make-regexp " *\\}")))
588 (with-atomic-file-replacement file
590 (let loop ((line-buffer '())
593 (let ((line (read-line in 'concat)))
595 ((eof-object? line) #t) ;done
596 ((regexp-exec start-rx line)
597 (loop (cons line line-buffer) #t #f))
598 ((or (regexp-exec source-rx line)
599 (regexp-exec fontname-rx line))
601 (let ((font-or-name (match:substring m 1)))
602 (if (or (member font-or-name fonts)
603 (member font-or-name names))
605 (loop (cons line line-buffer)
607 ((regexp-exec end-rx line)
609 (for-each (cut display <> out)
610 (reverse line-buffer))
613 (hold? (loop (cons line line-buffer)
615 (discard? (loop line-buffer #f #t))
616 (else (display line out)
617 (loop '() #f #f)))))))))
618 '("app/qml/FontPixels.qml"
619 "app/qml/FontScanlines.qml"
621 "app/qml/ApplicationSettings.qml"))
622 ;; Final substitution for default scanline and pixel fonts
623 (substitute* "app/qml/ApplicationSettings.qml"
624 (("COMMODORE_PET") "PROGGY_TINY"))
626 (build-system gnu-build-system)
629 ("qtdeclarative" ,qtdeclarative)
630 ("qtgraphicaleffects" ,qtgraphicaleffects)
631 ("qtquickcontrols" ,qtquickcontrols)))
634 (modify-phases %standard-phases
636 (lambda* (#:key outputs #:allow-other-keys)
637 (let ((out (assoc-ref outputs "out")))
638 (substitute* '("qmltermwidget/qmltermwidget.pro")
639 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
640 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
641 (substitute* '("cool-retro-term.pro" "app/app.pro")
644 (add-after 'install 'wrap-executable
645 (lambda* (#:key inputs outputs #:allow-other-keys)
646 (let ((out (assoc-ref outputs "out"))
647 (qml "/lib/qt5/qml"))
648 (wrap-program (string-append out "/bin/cool-retro-term")
649 `("QML2_IMPORT_PATH" ":" prefix
650 (,(string-append out qml)
652 (string-append (assoc-ref inputs i) qml))
655 "qtquickcontrols")))))
657 (add-after 'install 'add-alternate-name
658 (lambda* (#:key outputs #:allow-other-keys)
659 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
660 (symlink (string-append bin "/cool-retro-term")
661 (string-append bin "/crt"))
663 (add-after 'install 'install-man
664 (lambda* (#:key outputs #:allow-other-keys)
665 (let ((mandir (string-append (assoc-ref outputs "out")
667 (install-file "packaging/debian/cool-retro-term.1" mandir)
669 (synopsis "Terminal emulator")
671 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
672 feel of the old cathode ray tube (CRT) screens. It has been designed to be
673 eye-candy, customizable, and reasonably lightweight.")
674 (home-page "https://github.com/Swordfish90/cool-retro-term")
676 license:gpl2+ ; qmltermwidget
677 license:gpl3+ ; cool-retro-term
683 (define-public sakura
689 (uri (string-append "https://launchpad.net/" name "/trunk/"
690 version "/+download/" name "-" version
694 "15gskj5yv5qs3cj4ps43735kfx2nzjlhq4dk9ghirl8lvhhxsm5m"))))
695 (build-system cmake-build-system)
697 '(#:tests? #f)) ; no check phase
699 `(("gettext" ,gettext-minimal)
700 ("perl" ,perl) ; for pod2man
701 ("pkg-config" ,pkg-config)))
705 (home-page "https://launchpad.net/sakura")
706 (synopsis "A simple but powerful libvte-based terminal emulator")
707 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
708 It's a terminal emulator with few dependencies, so you don't need a full GNOME
709 desktop installed to have a decent terminal emulator.")
710 (license license:gpl2)))
712 (define-public go-github.com-nsf-termbox-go
713 (let ((commit "288510b9734e30e7966ec2f22b87c5f8e67345e3")
716 (name "go-github.com-nsf-termbox-go")
717 (version (git-version "0.0.0" revision commit))
721 (url "https://github.com/nsf/termbox-go.git")
723 (file-name (git-file-name name version))
726 "0hdyisfaf8yb55h3p03p4sbq19546mp9fy28f2kn659mycmhxqk4"))))
727 (build-system go-build-system)
729 '(#:import-path "github.com/nsf/termbox-go"))
731 `(("go-github.com-mattn-go-runewidth"
732 ,go-github.com-mattn-go-runewidth)))
733 (synopsis "@code{termbox} provides a minimal API for text-based user
736 "Termbox is a library that provides a minimalistic API which allows the
737 programmer to write text-based user interfaces.")
738 (home-page "https://github.com/nsf/termbox-go")
739 (license license:expat))))
741 (define-public go-github-com-junegunn-fzf
743 (name "go-github-com-junegunn-fzf")
749 (url "https://github.com/junegunn/fzf")
751 (file-name (git-file-name name version))
754 "0pwpr4fpw56yzzkcabzzgbgwraaxmp7xzzmap7w1xsrkbj7dl2xl"))))
755 (build-system go-build-system)
757 `(#:import-path "github.com/junegunn/fzf"))
759 `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
760 ("go-github-com-mattn-go-shellwords" ,go-github-com-mattn-go-shellwords)
761 ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
762 ("go-github-com-gdamore-tcell" ,go-github-com-gdamore-tcell)
763 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
764 (home-page "https://github.com/junegunn/fzf")
765 (synopsis "Command-line fuzzy-finder")
766 (description "This package provides an interactive command-line filter
767 usable with any list--including files, command history, processes and more.")
768 (license license:expat)))
770 (define-public go-github.com-howeyc-gopass
771 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
774 (name "go-github.com-howeyc-gopass")
775 (version (git-version "0.0.0" revision commit))
779 (url "https://github.com/howeyc/gopass.git")
781 (file-name (git-file-name name version))
784 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
785 (build-system go-build-system)
787 '(#:import-path "github.com/howeyc/gopass"))
789 `(("go-golang-org-x-crypto"
790 ,go-golang-org-x-crypto)))
791 (synopsis "Retrieve password from a terminal or piped input in Go")
793 "@code{gopass} is a Go package for retrieving a password from user
794 terminal or piped input.")
795 (home-page "https://github.com/howeyc/gopass")
796 (license license:isc))))
798 (define-public python-pyte
805 (uri (pypi-uri "pyte" version))
808 "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
809 (build-system python-build-system)
812 (modify-phases %standard-phases
813 (add-after 'unpack 'remove-failing-test
814 ;; TODO: Reenable when the `captured` files required by this test
815 ;; are included in the archive.
817 (delete-file "tests/test_input_output.py")
820 `(("python-wcwidth" ,python-wcwidth)))
822 `(("python-pytest-runner" ,python-pytest-runner)
823 ("python-pytest" ,python-pytest)))
824 (home-page "https://pyte.readthedocs.io/")
825 (synopsis "Simple VTXXX-compatible terminal emulator")
826 (description "@code{pyte} is an in-memory VTxxx-compatible terminal
827 emulator. @var{VTxxx} stands for a series of video terminals, developed by
828 DEC between 1970 and 1995. The first and probably most famous one was the
829 VT100 terminal, which is now a de-facto standard for all virtual terminal
832 pyte is a fork of vt102, which was an incomplete pure Python implementation
834 (license license:lgpl3+)))
836 (define-public python2-pyte
837 (package-with-python2 python-pyte))
839 (define-public python-blessings
841 (name "python-blessings")
846 (uri (pypi-uri "blessings" version))
849 "0z8mgkbmisxs10rz88qg46l1c9a8n08k8cy2iassal2zh16qbrcq"))))
850 (build-system python-build-system)
852 ;; FIXME: Test suite is unable to detect TTY conditions.
855 `(("python-nose" ,python-nose)
856 ("python-six" ,python-six)))
857 (home-page "https://github.com/erikrose/blessings")
858 (synopsis "Python module to manage terminal color, styling, and
860 (description "Blessings is a pythonic API to manipulate terminal color,
861 styling, and positioning. It provides similar features to curses but avoids
862 some of curses’s limitations: it does not require clearing the whole screen
863 for little changes, provides a scroll-back buffer after the program exits, and
864 avoids styling altogether when the output is redirected to something other
866 (license license:expat)))
868 (define-public python2-blessings
869 (package-with-python2 python-blessings))
871 (define-public python-curtsies
873 (name "python-curtsies")
878 (uri (pypi-uri "curtsies" version))
881 "1vljmw3sy6lrqahhpyg4gk13mzcx3mwhvg8s41698ms3cpgkjipc"))))
882 (build-system python-build-system)
885 (modify-phases %standard-phases
888 (invoke "nosetests" "-v"))))))
890 `(("python-blessings" ,python-blessings)
891 ("python-wcwidth" ,python-wcwidth)))
893 `(("python-mock" ,python-mock)
894 ("python-pyte" ,python-pyte)
895 ("python-nose" ,python-nose)))
896 (home-page "https://github.com/thomasballinger/curtsies")
897 (synopsis "Library for curses-like terminal interaction with colored
899 (description "Curtsies is a Python library for interacting with the
900 terminal. It features string-like objects which carry formatting information,
901 per-line fullscreen terminal rendering, and keyboard input event reporting.")
902 (license license:expat)))
904 (define-public python2-curtsies
905 (package-with-python2 python-curtsies))
915 (url "https://github.com/tmate-io/tmate.git")
917 (file-name (git-file-name name version))
920 "0x5c31yq7ansmiy20a0qf59wagba9v3pq97mlkxrqxn4n1gcc6vi"))))
921 (build-system gnu-build-system)
923 `(("libevent" ,libevent)
926 ("ncurses" ,ncurses)))
928 `(("autoconf" ,autoconf)
929 ("automake" ,automake)
930 ("pkg-config" ,pkg-config)))
931 (home-page "https://tmate.io/")
932 (synopsis "Terminal sharing application")
933 (description "tmate is a terminal sharing application that allows you to
934 share your terminal with other users over the Internet. tmate is a fork of
936 (license license:isc)))
942 (home-page "https://sw.kovidgoyal.net/kitty/")
947 (url "https://github.com/kovidgoyal/kitty.git")
948 (commit (string-append "v" version))))
949 (file-name (git-file-name name version))
951 (base32 "1bszyddar0g1gdz67h8rd3gbrdhi6ahjg7j14cjiqxm1938z9ajf"))
952 (modules '((guix build utils)))
955 ;; patch needed as sphinx-build is used as a python script
956 ;; whereas the guix package uses a bash script launching the
958 (substitute* "docs/conf.py"
959 (("(from kitty.constants import str_version)" kitty-imp)
960 (string-append "sys.path.append(\"..\")\n" kitty-imp)))
961 (substitute* "docs/Makefile"
962 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
963 "SPHINXBUILD = sphinx-build\n"))
965 (build-system gnu-build-system)
968 ("harfbuzz" ,harfbuzz)
970 ("libcanberra" ,libcanberra)
972 ("freetype" ,freetype)
973 ("fontconfig" ,fontconfig)
974 ("pygments" ,python-pygments)
975 ("wayland" ,wayland)))
977 `(("pkg-config" ,pkg-config)
978 ("libxrandr" ,libxrandr)
980 ("libxcursor" ,libxcursor)
982 ("libxinerama" ,libxinerama)
983 ("libgl1-mesa" ,mesa)
984 ("libxkbcommon" ,libxkbcommon)
985 ("sphinx" ,python-sphinx)
986 ("ncurses" ,ncurses) ;; for tic command
987 ("wayland-protocols" ,wayland-protocols)))
989 '(#:phases (modify-phases %standard-phases
991 ;; Wayland backend requires EGL, which isn't found
992 ;; out-of-the-box for some reason. Hard-code it instead.
993 (add-after 'unpack 'hard-code-libegl
995 (let* ((mesa (assoc-ref %build-inputs "libgl1-mesa"))
996 (libegl (string-append mesa "/lib/libEGL.so.1")))
997 (substitute* "glfw/egl_context.c"
998 (("libEGL.so.1") libegl)))
1002 (invoke "python3" "setup.py" "linux-package")))
1005 (invoke "python3" "setup.py" "test")))
1006 (add-before 'install 'rm-pycache
1007 ;; created python cache __pycache__ are non deterministic
1009 (let ((pycaches (find-files "linux-package/"
1011 #:directories? #t)))
1012 (for-each delete-file-recursively pycaches)
1016 (let* ((out (assoc-ref %outputs "out"))
1017 (obin (string-append out "/bin"))
1018 (olib (string-append out "/lib"))
1019 (oshare (string-append out "/share")))
1020 (copy-recursively "linux-package/bin" obin)
1021 (copy-recursively "linux-package/share" oshare)
1022 (copy-recursively "linux-package/lib" olib)
1024 (synopsis "Fast, featureful, GPU based terminal emulator")
1025 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1027 @item Offloads rendering to the GPU for lower system load and buttery smooth
1028 scrolling. Uses threaded rendering to minimize input latency.
1029 @item Supports all modern terminal features: graphics (images), unicode,
1030 true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1031 paste and several new terminal protocol extensions.
1032 @item Supports tiling multiple terminal windows side by side in different
1033 layouts without needing to use an extra program like tmux.
1034 @item Can be controlled from scripts or the shell prompt, even over SSH.
1035 @item Has a framework for Kittens, small terminal programs that can be used to
1036 extend kitty's functionality. For example, they are used for Unicode input,
1037 hints, and side-by-side diff.
1038 @item Supports startup sessions which allow you to specify the window/tab
1039 layout, working directories and programs to run on startup.
1040 @item Allows you to open the scrollback buffer in a separate window using
1041 arbitrary programs of your choice. This is useful for browsing the history
1042 comfortably in a pager or editor.
1044 (license license:gpl3+)))
1046 (define-public eternalterminal
1048 (name "eternalterminal")
1054 (url "https://github.com/MisterTea/EternalTerminal.git")
1055 (commit (string-append "et-v" version))))
1056 (file-name (git-file-name name version))
1058 (base32 "0jh89229bd9s82h3aj6faaybwr5xvnk8w2kgz47gq263pz021zpl"))))
1059 (build-system cmake-build-system)
1061 '(#:configure-flags '("-DBUILD_TEST=ON")
1063 (modify-phases %standard-phases
1064 (add-after 'unpack 'insert-googletests
1065 (lambda* (#:key inputs #:allow-other-keys)
1066 (let ((tests (assoc-ref inputs "googletest")))
1067 (copy-recursively tests "external/googletest"))
1069 (add-after 'install 'dont-provide-gtest-libraries
1070 (lambda* (#:key outputs #:allow-other-keys)
1071 (let ((out (assoc-ref outputs "out")))
1072 (delete-file-recursively (string-append out "/include"))
1073 (delete-file-recursively (string-append out "/lib")))
1076 `(("gflags" ,gflags)
1077 ("libsodium" ,libsodium)
1078 ("protobuf" ,protobuf)))
1080 `(("googletest" ,(package-source googletest))))
1081 (home-page "https://mistertea.github.io/EternalTerminal/")
1082 (synopsis "Remote shell that reconnects without interrupting the session")
1083 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1084 automatically reconnects without interrupting the session. ET uses SSH to
1085 initialize a secure connection. Unlike SSH sessions, which must be killed and
1086 reconnected after a network outage an ET session will survive network outages
1087 and IP roaming. ET provides the same core functionality as @command{mosh},
1088 while also supporting native scrolling and @command{tmux} control mode
1089 (@code{tmux -CC}).")
1090 (license license:asl2.0)))
1092 (define-public wterm
1100 (url "https://github.com/majestrate/wterm.git")
1101 (commit "0ae42717c08a85a6509214e881422c7fbe7ecc45")))
1104 "0g4lzmc1w6na81i6hny32xds4xfig4xzswzfijyi6p93a1226dv0"))
1105 (file-name (git-file-name name version))))
1106 (build-system gnu-build-system)
1108 `(("pkg-config" ,pkg-config)))
1110 `(("fontconfig" ,fontconfig)
1111 ("freetype" ,freetype)
1113 ("libxkbcommon" ,libxkbcommon)
1114 ("ncurses" ,ncurses)
1116 ("wayland" ,wayland)))
1120 ;; Without -j1 it fails to find file libwld.a.
1121 #:parallel-build? #f
1123 #:make-flags (list "CC=gcc"
1124 (string-append "PREFIX=" %output)
1125 (string-append "TERMINFO="
1126 (assoc-ref %outputs "out")
1129 (modify-phases %standard-phases
1131 (add-after 'unpack 'terminfo-fix
1133 (substitute* "Makefile"
1134 (("\ttic .*") "\tmkdir -p $(SHARE_PREFIX)/share/terminfo
1135 \ttic -o $(SHARE_PREFIX)/share/terminfo -s wterm.info\n"))
1137 (native-search-paths
1138 (list (search-path-specification
1139 (variable "TERMINFO_DIRS")
1140 (files '("share/terminfo")))))
1141 (home-page "https://github.com/majestrate/wterm")
1142 (synopsis "Terminal emulator for Wayland")
1143 (description "wterm is a native Wayland terminal emulator based on
1144 an st fork using wld. st is a simple terminal emulator for X originally
1146 (license license:x11)))
1148 (define-public alacritty
1156 (url "https://github.com/jwilm/alacritty.git")
1157 (commit (string-append "v" version))))
1158 (file-name (git-file-name name version))
1160 (base32 "05jcg33ifngpzw2hdhgb614j87ihhhlqgar0kky183rywg0dxikg"))
1161 (modules '((guix build utils)))
1163 ;; Don't use a custom location for winit-0.20-alpha6.
1164 '(begin (substitute* "Cargo.toml"
1167 (build-system cargo-build-system)
1170 (("rust-clap" ,rust-clap-2)
1171 ("rust-log" ,rust-log-0.4)
1172 ("rust-time" ,rust-time-0.1)
1173 ("rust-env-logger" ,rust-env-logger-0.7)
1174 ("rust-serde" ,rust-serde-1.0)
1175 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
1176 ("rust-serde-json" ,rust-serde-json-1.0)
1177 ("rust-glutin" ,rust-glutin-0.22) ; adjust 'patch-glutin-libgl-path as needed
1178 ("rust-notify" ,rust-notify-4)
1179 ("rust-libc" ,rust-libc-0.2)
1180 ("rust-unicode-width" ,rust-unicode-width-0.1)
1181 ("rust-parking-lot" ,rust-parking-lot-0.9)
1182 ("rust-urlocator" ,rust-urlocator-0.1)
1183 ("rust-xdg" ,rust-xdg-2.2)
1184 ("rust-image" ,rust-image-0.22)
1185 ("rust-dirs" ,rust-dirs-2.0)
1186 ("rust-x11-dl" ,rust-x11-dl-2)
1187 ("rust-winapi" ,rust-winapi-0.3)
1188 ("rust-base64" ,rust-base64-0.11)
1189 ("rust-bigflags" ,rust-bitflags-1)
1190 ("rust-fnv" ,rust-fnv-1.0)
1191 ("rust-mio" ,rust-mio-0.6)
1192 ("rust-mio-extras" ,rust-mio-extras-2)
1193 ("rust-terminfo" ,rust-terminfo-0.6)
1194 ("rust-url" ,rust-url-2.1)
1195 ("rust-vte" ,rust-vte-0.3)
1196 ("rust-nix" ,rust-nix-0.15)
1197 ("rust-miow" ,rust-miow-0.3)
1198 ("rust-mio-anonymous-pipes" ,rust-mio-anonymous-pipes-0.1)
1199 ("rust-mio-named-pipes" ,rust-mio-named-pipes-0.1)
1200 ("rust-signal-hook" ,rust-signal-hook-0.1)
1201 ("rust-clipboard-win" ,rust-clipboard-win-2.1)
1202 ("rust-objc" ,rust-objc-0.2)
1203 ("rust-objc-id" ,rust-objc-id-0.1)
1204 ("rust-objc-foundation" ,rust-objc-foundation-0.1)
1205 ("rust-x11-clipboard" ,rust-x11-clipboard-0.4)
1206 ("rust-smithay-clipboard" ,rust-smithay-clipboard-0.3)
1207 ("rust-wayland-client" ,rust-wayland-client-0.23)
1208 ("rust-euclid" ,rust-euclid-0.20)
1209 ("rust-foreign-types" ,rust-foreign-types-0.5)
1210 ("rust-servo-fontconfig" ,rust-servo-fontconfig-0.4)
1211 ("rust-freetype-rs" ,rust-freetype-rs-0.23)
1212 ("rust-core-foundation" ,rust-core-foundation-0.6)
1213 ("rust-core-foundation-sys" ,rust-core-foundation-sys-0.6)
1214 ("rust-core-text" ,rust-core-text-13)
1215 ("rust-core-graphics" ,rust-core-graphics-0.17)
1216 ("rust-dwrote" ,rust-dwrote-0.9)
1217 ("rust-winpty-sys" ,rust-winpty-sys-0.4))
1218 #:cargo-development-inputs
1219 (("rust-rustc-tools-util" ,rust-rustc-tools-util-0.2)
1220 ("rust-gl-generator" ,rust-gl-generator-0.14)
1221 ("rust-andrew" ,rust-andrew-0.2)
1222 ("rust-smithay-client-toolkit" ,rust-smithay-client-toolkit-0.6)
1223 ("rust-embed-resource" ,rust-embed-resource-1.3)
1224 ("rust-http-req" ,rust-http-req-0.5)
1225 ("rust-zip" ,rust-zip-0.5)
1226 ("rust-tempfile" ,rust-tempfile-3.1)
1227 ("rust-named-pipe" ,rust-named-pipe-0.4)
1228 ("rust-winapi" ,rust-winapi-0.3))
1230 (modify-phases %standard-phases
1231 (add-after 'configure 'patch-glutin-libgl-path
1232 (lambda* (#:key inputs cargo-inputs vendor-dir #:allow-other-keys)
1233 (let* ((glutin-name ,(package-name rust-glutin-0.22))
1234 (glutin-version ,(package-version rust-glutin-0.22))
1237 glutin-name "-" glutin-version ".tar.gz/src/api/"))
1238 (mesa (assoc-ref inputs "mesa")))
1239 (substitute* (string-append vendor-dir "/" src-api "glx/mod.rs")
1240 (("libGL.so") (string-append mesa "/lib/libGL.so")))
1241 (substitute* (string-append vendor-dir "/" src-api "egl/mod.rs")
1242 (("libEGL.so") (string-append mesa "/lib/libEGL.so")))
1244 (add-after 'configure 'remove-alacritty-vendor
1245 (lambda* (#:key vendor-dir #:allow-other-keys)
1246 ;; We don't want Alacritty to be a dependency of itself
1247 ;; If we don't delete it from guix-vendor then build will fail
1248 ;; because Alacritty has a virtual workspace Cargo.toml.
1249 (delete-file-recursively
1250 (string-append vendor-dir "/alacritty-" ,version ".tar.xz"))
1253 (lambda* (#:key inputs outputs #:allow-other-keys)
1254 (let* ((out (assoc-ref outputs "out"))
1255 (share (string-append out "/share"))
1256 (icons (string-append share "/icons/hicolor/scalable/apps"))
1257 (tic (string-append (assoc-ref inputs "ncurses") "/bin/tic"))
1258 (man (string-append share "/man/man1"))
1259 (alacritty-bin "target/release/alacritty"))
1262 (install-file alacritty-bin (string-append out "/bin"))
1264 ;; Install man pages
1266 (copy-file "extra/alacritty.man"
1267 (string-append man "/alacritty.1"))
1269 ;; Install desktop file
1270 (install-file "extra/linux/alacritty.desktop"
1271 (string-append share "/applications"))
1275 (copy-file "extra/logo/alacritty-term.svg"
1276 (string-append icons "/Alacritty.svg"))
1279 (mkdir-p (string-append share "/terminfo"))
1280 ;; We don't compile alacritty-common entry because
1281 ;; it's being used only for inheritance.
1282 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1283 "-o" (string-append share "/terminfo/")
1284 "extra/alacritty.info")
1286 ;; Install completions
1288 "extra/completions/alacritty.bash"
1289 (string-append out "/etc/bash_completion.d"))
1291 "extra/completions/_alacritty"
1292 (string-append share "/zsh/site-functions"))
1294 "extra/completions/alacritty.fish"
1295 (string-append share "/fish/vendor_completions.d"))
1299 ("fontconfig" ,fontconfig)
1300 ("freetype" ,freetype)
1303 ("libxcursor" ,libxcursor)
1305 ("libxkbcommon" ,libxkbcommon)
1306 ("libxrandr" ,libxrandr)
1307 ("libxxf86vm" ,libxxf86vm)
1308 ("wayland" ,wayland)
1312 ("ncurses" ,ncurses)
1313 ("pkg-config" ,pkg-config)
1314 ("python3" ,python)))
1315 (home-page "https://github.com/alacritty/alacritty")
1316 (synopsis "GPU-accelerated terminal emulator")
1318 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1319 simplicity and performance. With such a strong focus on performance, included
1320 features are carefully considered and you can always expect Alacritty to be
1321 blazingly fast. By making sane choices for defaults, Alacritty requires no
1322 additional setup. However, it does allow configuration of many aspects of the
1323 terminal. Note that you need support for OpenGL 3.2 or higher.")
1324 (license license:asl2.0)))