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, 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>
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 crates-graphics)
57 #:use-module (gnu packages crypto)
58 #:use-module (gnu packages docbook)
59 #:use-module (gnu packages fontutils)
60 #:use-module (gnu packages freedesktop)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages gettext)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages golang)
67 #:use-module (gnu packages gtk)
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages libcanberra)
70 #:use-module (gnu packages libevent)
71 #:use-module (gnu packages linux)
72 #:use-module (gnu packages ncurses)
73 #:use-module (gnu packages perl)
74 #:use-module (gnu packages perl-check)
75 #:use-module (gnu packages pkg-config)
76 #:use-module (gnu packages popt)
77 #:use-module (gnu packages protobuf)
78 #:use-module (gnu packages python)
79 #:use-module (gnu packages python-web)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages qt)
82 #:use-module (gnu packages serialization)
83 #:use-module (gnu packages sphinx)
84 #:use-module (gnu packages ssh)
85 #:use-module (gnu packages textutils)
86 #:use-module (gnu packages xdisorg)
87 #:use-module (gnu packages xml)
88 #:use-module (gnu packages xorg)
89 #:use-module (srfi srfi-26))
98 (url "https://github.com/lanoxx/tilda")
99 (commit (string-append "tilda-" version))))
100 (file-name (git-file-name name version))
103 "0psq0f4s0s92bba6wwcf6b0j7i59b76svqxhvpavwv53yvhmmamn"))))
104 (build-system glib-or-gtk-build-system)
106 `(("autoconf" ,autoconf)
107 ("automake" ,automake)
108 ("gettext" ,gettext-minimal)
109 ("pkg-config" ,pkg-config)))
111 `(("libconfuse" ,libconfuse)
113 (synopsis "GTK+-based drop-down terminal")
114 (description "Tilda is a terminal emulator similar to normal terminals like
115 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
116 from the edge of a screen when a certain configurable hotkey is pressed. This
117 is similar to the built-in consoles in some applications. Tilda is highly
118 configurable through a graphical wizard.")
119 (home-page "https://github.com/lanoxx/tilda")
120 (license license:gpl2+)))
122 (define-public termite
130 (url (string-append "https://github.com/thestinger/"
132 (commit (string-append "v" version))
134 (file-name (string-append name "-" version "-checkout"))
137 "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k"))))
138 (build-system gnu-build-system)
141 (modify-phases %standard-phases
142 (add-after 'unpack 'patch-xdg-open
144 (substitute* "termite.cc"
145 (("xdg-open") (which "xdg-open")))
149 ;; This sets the destination when installing the necessary terminal
150 ;; capability data, which are not provided by 'ncurses'. See
151 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
152 #:make-flags (list "PREFIX="
153 (string-append "VERSION=v" (version))
154 (string-append "DESTDIR="
155 (assoc-ref %outputs "out")))))
159 ("xdg-utils" ,xdg-utils)
160 ("ncurses" ,ncurses)))
162 `(("pkg-config" ,pkg-config)))
164 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
165 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
167 (list (search-path-specification
168 (variable "TERMINFO_DIRS")
169 (files '("share/terminfo")))))
170 (home-page "https://github.com/thestinger/termite/")
171 (synopsis "Keyboard-centric, VTE-based terminal")
172 (description "Termite is a minimal terminal emulator designed for use with
173 tiling window managers. It is a modal application, similar to Vim, with an
174 insert mode and command mode where keybindings have different functions.")
176 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
177 (license license:lgpl2.0+)))
179 (define-public asciinema
187 (url "https://github.com/asciinema/asciinema")
188 (commit (string-append "v" version))))
189 (file-name (git-file-name name version))
192 "1a2pysxnp6icyd08mgf66xr6f6j0irnfxdpf3fmzcz31ix7l9kc4"))))
193 (build-system python-build-system)
196 (modify-phases %standard-phases
197 (add-before 'build 'patch-exec-paths
198 (lambda* (#:key inputs #:allow-other-keys)
199 (let ((ncurses (assoc-ref inputs "ncurses")))
200 (substitute* "asciinema/term.py"
202 (string-append "'" ncurses "/bin/tput'"))))
205 (lambda _ (invoke "nosetests" "-v"))))))
206 (inputs `(("ncurses" ,ncurses)))
209 `(("python-nose" ,python-nose)))
210 (home-page "https://asciinema.org")
211 (synopsis "Terminal session recorder")
213 "Use asciinema to record and share your terminal sessions, the right way.
214 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
215 text-based approach to terminal recording.")
216 (license license:gpl3)))
218 (define-public libtsm
219 (let ((commit "f70e37982f382b03c6939dac3d5f814450bda253")
223 (version (git-version "0.0.0" revision commit))
227 ;; The freedesktop repository is no longer maintained.
229 (url (string-append "https://github.com/Aetf/" name))
231 (file-name (git-file-name name version))
233 (base32 "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx"))
234 (modules '((guix build utils)))
237 ;; Remove a bundled copy of libxkbcommon's xkbcommon-keysyms.h.
238 (delete-file-recursively "external/xkbcommon")
240 (build-system cmake-build-system)
242 `(#:configure-flags '("-DBUILD_TESTING=ON")))
245 ("libxkbcommon" ,libxkbcommon) ; for xkbcommon-keysyms.h
246 ("pkg-config" ,pkg-config)))
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
284 ;; Use elogind instead of systemd.
285 (add-before 'configure 'remove-systemd
287 (substitute* "configure"
288 (("libsystemd-daemon libsystemd-login")
290 (substitute* "src/uterm_systemd.c"
291 (("#include <systemd/sd-login.h>")
292 "#include <elogind/sd-login.h>")
293 ;; We don't have this header.
294 (("#include <systemd/sd-daemon\\.h>")
296 ;; Replace the call to 'sd_booted' by the truth value.
300 `(("pkg-config" ,pkg-config)
301 ("autoconf" ,autoconf)
302 ("automake" ,automake)
304 ("libxslt" ,libxslt) ;to build the man page
305 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
306 ("docbook-xsl" ,docbook-xsl)))
310 ("libxkbcommon" ,libxkbcommon)
312 ;; MESA can be used for accelerated video output via OpenGLESv2, but
313 ;; it's a bit dependency that we'd rather avoid in the installation
318 (synopsis "Linux KMS-based terminal emulator")
319 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
320 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
321 implementation with a user-space console. Compared to the Linux console,
322 kmscon provides enhanced features including XKB-compatible internationalized
323 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
324 multi-seat support, a replacement for @command{mingetty}, and more.")
325 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
326 ;; Hash table implementation is lgpl2.1+ licensed.
327 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
329 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
330 ;; under the bsd 2 license.
331 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
332 ;; under the terms of the GNU GPL.
333 (license (list license:expat license:lgpl2.1+ license:bsd-2
335 (supported-systems (filter (cut string-suffix? "-linux" <>)
336 %supported-systems)))))
338 (define-public libtermkey
344 (uri (string-append "http://www.leonerd.org.uk/code/libtermkey/"
345 "libtermkey-" version ".tar.gz"))
347 (base32 "0psd0kf10q5ixfima0mxz10syy7qq1ilz1npr0rz862xycvzgjyf"))))
348 (build-system gnu-build-system)
352 (string-append "PREFIX=" (assoc-ref %outputs "out")))
353 #:phases (modify-phases %standard-phases
354 (delete 'configure)) ; no configure script
355 #:test-target "test"))
356 (inputs `(("ncurses" ,ncurses)))
357 (native-inputs `(("libtool" ,libtool)
358 ("perl-test-harness" ,perl-test-harness)
359 ("pkg-config" ,pkg-config)))
360 (synopsis "Keyboard entry processing library for terminal-based programs")
362 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
363 combining, and so on, with a simple interface.")
364 (home-page "http://www.leonerd.org.uk/code/libtermkey")
365 (license license:expat)))
367 (define-public picocom
374 (url "https://github.com/npat-efault/picocom")
376 (file-name (git-file-name name version))
379 "1vvjydqf0ax47nvdyyl67jafw5b3sfsav00xid6qpgia1gs2r72n"))))
380 (build-system gnu-build-system)
382 `(#:make-flags '("CC=gcc")
383 #:tests? #f ; no tests
385 (modify-phases %standard-phases
386 (delete 'configure) ; no configure script
388 ;; The Makefile lacks an ‘install’ target.
389 (lambda* (#:key outputs #:allow-other-keys)
390 (let* ((out (assoc-ref outputs "out"))
391 (bin (string-append out "/bin"))
392 (man (string-append out "/share/man/man1")))
393 (install-file "picocom" bin)
394 (install-file "picocom.1" man)))))))
395 (home-page "https://github.com/npat-efault/picocom")
396 (synopsis "Minimal dumb-terminal emulator")
398 "Picocom is a minimal dumb-terminal emulation program. It was designed to
399 serve as a simple and manual modem configuration, testing, and debugging tool.
400 It also serves well as a low-tech serial communications program to allow access
401 to all types of devices that provide serial consoles.")
402 (license license:gpl2+)))
412 ;; The original beep 1.3 at <http://www.johnath.com/beep> has been
413 ;; unmaintained for some time, and vulnerable to at least two CVEs:
414 ;; https://github.com/johnath/beep/issues/11#issuecomment-454056858
415 ;; Use this maintained fork instead.
416 (url "https://github.com/spkr-beep/beep")
417 (commit (string-append "v" version))))
418 (file-name (git-file-name name version))
420 (base32 "0jmvqk6g5n0wzj9znw42njxq3mzw1769f4db99b83927hf4aidi4"))))
421 (build-system gnu-build-system)
423 `(#:tests? #f ; no tests
425 (list (string-append "prefix=" (assoc-ref %outputs "out"))
426 (string-append "pkgdocdir=$(docdir)/" ,name "-" ,version))
428 (modify-phases %standard-phases
429 (delete 'configure)))) ; no configure script
430 (synopsis "Linux command-line utility to control the PC speaker")
431 (description "beep allows the user to control the PC speaker with precision,
432 allowing different sounds to indicate different events. While it can be run
433 quite happily on the command line, its intended place of residence is within
434 scripts, notifying the user when something interesting occurs. Of course, it
435 has no notion of what's interesting, but it's very good at that notifying part.")
436 (home-page "https://github.com/spkr-beep/beep")
437 (license license:gpl2+)))
439 (define-public unibilium
447 (url "https://github.com/mauke/unibilium")
448 (commit (string-append "v" version))))
449 (file-name (git-file-name name version))
452 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
453 (build-system gnu-build-system)
457 (string-append "PREFIX=" (assoc-ref %outputs "out")))
459 ;; FIXME: tests require "prove"
462 (modify-phases %standard-phases
463 (delete 'configure))))
465 `(("libtool" ,libtool)
467 (home-page "https://github.com/mauke/unibilium")
468 (synopsis "Terminfo parsing library")
469 (description "Unibilium is a basic C terminfo library. It doesn't depend
470 on curses or any other library. It also doesn't use global variables, so it
471 should be thread-safe.")
472 (license license:lgpl3+)))
474 (define-public libvterm
481 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
482 "libvterm-" version ".tar.gz"))
485 "1pfkhbbihd2kvaza707vl2nvk7bxaawmb37wf9v6d72mjng38w5w"))))
486 (build-system gnu-build-system)
490 (string-append "PREFIX=" (assoc-ref %outputs "out")))
493 (modify-phases %standard-phases
494 (delete 'configure))))
496 `(("libtool" ,libtool)
498 (home-page "http://www.leonerd.org.uk/code/libvterm/")
499 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
500 (description "Libvterm is an abstract C99 library which implements a VT220
501 or xterm-like terminal emulator. It doesn't use any particular graphics
502 toolkit or output system, instead it invokes callback function pointers that
503 its embedding program should provide it to draw on its behalf. It avoids
504 calling @code{malloc} during normal running state, allowing it to be used in
505 embedded kernel situations.")
506 (license license:expat)))
508 (define-public cool-retro-term
509 (let ((commit "1.1.1")
510 (revision "0")) ;not used currently
512 (name "cool-retro-term")
516 (file-name (string-append name "-" version "-checkout"))
518 (url (string-append "https://github.com/Swordfish90/" name))
522 (base32 "0wb6anchxa5jpn9c73kr4byrf2xlj8x8qzc5x7ny6saj7kbbvp75"))
523 (modules '((guix build utils)
529 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
530 "1977-apple2" ; Non-Free
531 "1977-commodore-pet" ; Non-Free
532 "1979-atari-400-800" ; Non-Free
533 ;"1981-ibm-pc ; CC-SA 4.0
534 "1982-commodore64")) ; Non-Free
535 ;"1985-ibm-pc-vga" ; CC-SA 4.0
536 ;"modern-fixedsys-excelsior" ; Redistributable
537 ;"modern-hermit" ; SIL
538 ;"modern-inconsolata"; SIL
539 ;"modern-pro-font-win-tweaked" ; X11
540 ;"modern-proggy-tiny"; X11
541 ;"modern-terminus" ; SIL
542 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
543 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
544 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
546 ;; Gather font names from all Fonts*.qml files.
547 ;; These will be used to remove items from the
550 (lambda (font-file names)
551 (call-with-input-file font-file
553 (let loop ((name #f) (names names))
554 (let ((line (read-line port)))
556 ((eof-object? line) (pk 'names names))
557 ((regexp-exec name-rx line)
559 (loop (match:substring m 1) names)))
560 ((regexp-exec source-rx line)
562 (let ((font (match:substring m 1)))
563 (if (member font fonts)
564 (loop #f (lset-adjoin string=?
567 (else (loop name names))))))))
568 '() (find-files "app/qml" "Font.*\\.qml"))))
569 ;; Remove the font files themselves
570 (for-each (lambda (font)
571 (delete-file-recursively
572 (string-append "app/qml/fonts/" font)))
574 ;; Remove mention of those fonts in the source
575 (substitute* "app/qml/resources.qrc"
576 (((string-append " *<file>fonts/("
577 (string-join fonts "|")
582 (let ((start-rx (make-regexp " *ListElement\\{"))
583 (end-rx (make-regexp " *\\}")))
584 (with-atomic-file-replacement file
586 (let loop ((line-buffer '())
589 (let ((line (read-line in 'concat)))
591 ((eof-object? line) #t) ;done
592 ((regexp-exec start-rx line)
593 (loop (cons line line-buffer) #t #f))
594 ((or (regexp-exec source-rx line)
595 (regexp-exec fontname-rx line))
597 (let ((font-or-name (match:substring m 1)))
598 (if (or (member font-or-name fonts)
599 (member font-or-name names))
601 (loop (cons line line-buffer)
603 ((regexp-exec end-rx line)
605 (for-each (cut display <> out)
606 (reverse line-buffer))
609 (hold? (loop (cons line line-buffer)
611 (discard? (loop line-buffer #f #t))
612 (else (display line out)
613 (loop '() #f #f)))))))))
614 '("app/qml/FontPixels.qml"
615 "app/qml/FontScanlines.qml"
617 "app/qml/ApplicationSettings.qml"))
618 ;; Final substitution for default scanline and pixel fonts
619 (substitute* "app/qml/ApplicationSettings.qml"
620 (("COMMODORE_PET") "PROGGY_TINY"))
622 (build-system gnu-build-system)
625 ("qtdeclarative" ,qtdeclarative)
626 ("qtgraphicaleffects" ,qtgraphicaleffects)
627 ("qtquickcontrols" ,qtquickcontrols)))
630 (modify-phases %standard-phases
632 (lambda* (#:key outputs #:allow-other-keys)
633 (let ((out (assoc-ref outputs "out")))
634 (substitute* '("qmltermwidget/qmltermwidget.pro")
635 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
636 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
637 (substitute* '("cool-retro-term.pro" "app/app.pro")
640 (add-after 'install 'wrap-executable
641 (lambda* (#:key inputs outputs #:allow-other-keys)
642 (let ((out (assoc-ref outputs "out"))
643 (qml "/lib/qt5/qml"))
644 (wrap-program (string-append out "/bin/cool-retro-term")
645 `("QML2_IMPORT_PATH" ":" prefix
646 (,(string-append out qml)
648 (string-append (assoc-ref inputs i) qml))
651 "qtquickcontrols")))))
653 (add-after 'install 'add-alternate-name
654 (lambda* (#:key outputs #:allow-other-keys)
655 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
656 (symlink (string-append bin "/cool-retro-term")
657 (string-append bin "/crt"))
659 (add-after 'install 'install-man
660 (lambda* (#:key outputs #:allow-other-keys)
661 (let ((mandir (string-append (assoc-ref outputs "out")
663 (install-file "packaging/debian/cool-retro-term.1" mandir)
665 (synopsis "Terminal emulator")
667 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
668 feel of the old cathode ray tube (CRT) screens. It has been designed to be
669 eye-candy, customizable, and reasonably lightweight.")
670 (home-page "https://github.com/Swordfish90/cool-retro-term")
672 license:gpl2+ ; qmltermwidget
673 license:gpl3+ ; cool-retro-term
679 (define-public sakura
685 (uri (string-append "https://launchpad.net/sakura/trunk/"
686 version "/+download/sakura-" version
690 "12wjmckf03qbnm8cb7qma0980anzajn3l92rj2yr8hhafl74x6kj"))))
691 (build-system cmake-build-system)
693 '(#:tests? #f)) ; no check phase
695 `(("gettext" ,gettext-minimal)
696 ("perl" ,perl) ; for pod2man
697 ("pkg-config" ,pkg-config)))
701 (home-page "https://launchpad.net/sakura")
702 (synopsis "A simple but powerful libvte-based terminal emulator")
703 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
704 It's a terminal emulator with few dependencies, so you don't need a full GNOME
705 desktop installed to have a decent terminal emulator.")
706 (license license:gpl2)))
708 (define-public go-github.com-nsf-termbox-go
709 (let ((commit "288510b9734e30e7966ec2f22b87c5f8e67345e3")
712 (name "go-github.com-nsf-termbox-go")
713 (version (git-version "0.0.0" revision commit))
717 (url "https://github.com/nsf/termbox-go")
719 (file-name (git-file-name name version))
722 "0hdyisfaf8yb55h3p03p4sbq19546mp9fy28f2kn659mycmhxqk4"))))
723 (build-system go-build-system)
725 '(#:import-path "github.com/nsf/termbox-go"))
727 `(("go-github.com-mattn-go-runewidth"
728 ,go-github.com-mattn-go-runewidth)))
729 (synopsis "@code{termbox} provides a minimal API for text-based user
732 "Termbox is a library that provides a minimalistic API which allows the
733 programmer to write text-based user interfaces.")
734 (home-page "https://github.com/nsf/termbox-go")
735 (license license:expat))))
737 (define-public go-github-com-junegunn-fzf
739 (name "go-github-com-junegunn-fzf")
745 (url "https://github.com/junegunn/fzf")
747 (file-name (git-file-name name version))
750 "0n0cy5q2r3dm1a3ivlzrv9c5d11awxlqim5b9x8zc85dlr73n35l"))))
751 (build-system go-build-system)
753 `(#:import-path "github.com/junegunn/fzf"))
755 `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
756 ("go-github-com-mattn-go-shellwords" ,go-github-com-mattn-go-shellwords)
757 ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
758 ("go-github-com-gdamore-tcell" ,go-github-com-gdamore-tcell)
759 ("go-github-com-saracen-walker" ,go-github-com-saracen-walker)
760 ("go-golang.org-x-sync-errgroup" ,go-golang.org-x-sync-errgroup)
761 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
762 (home-page "https://github.com/junegunn/fzf")
763 (synopsis "Command-line fuzzy-finder")
764 (description "This package provides an interactive command-line filter
765 usable with any list--including files, command history, processes and more.")
766 (license license:expat)))
768 (define-public go-github.com-howeyc-gopass
769 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
772 (name "go-github.com-howeyc-gopass")
773 (version (git-version "0.0.0" revision commit))
777 (url "https://github.com/howeyc/gopass")
779 (file-name (git-file-name name version))
782 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
783 (build-system go-build-system)
785 '(#:import-path "github.com/howeyc/gopass"))
787 `(("go-golang-org-x-crypto"
788 ,go-golang-org-x-crypto)))
789 (synopsis "Retrieve password from a terminal or piped input in Go")
791 "@code{gopass} is a Go package for retrieving a password from user
792 terminal or piped input.")
793 (home-page "https://github.com/howeyc/gopass")
794 (license license:isc))))
796 (define-public python-pyte
803 (uri (pypi-uri "pyte" version))
806 "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
807 (build-system python-build-system)
810 (modify-phases %standard-phases
811 (add-after 'unpack 'remove-failing-test
812 ;; TODO: Reenable when the `captured` files required by this test
813 ;; are included in the archive.
815 (delete-file "tests/test_input_output.py")
818 `(("python-wcwidth" ,python-wcwidth)))
820 `(("python-pytest-runner" ,python-pytest-runner)
821 ("python-pytest" ,python-pytest)))
822 (home-page "https://pyte.readthedocs.io/")
823 (synopsis "Simple VTXXX-compatible terminal emulator")
824 (description "@code{pyte} is an in-memory VTxxx-compatible terminal
825 emulator. @var{VTxxx} stands for a series of video terminals, developed by
826 DEC between 1970 and 1995. The first and probably most famous one was the
827 VT100 terminal, which is now a de-facto standard for all virtual terminal
830 pyte is a fork of vt102, which was an incomplete pure Python implementation
832 (license license:lgpl3+)))
834 (define-public python2-pyte
835 (package-with-python2 python-pyte))
837 (define-public python-blessings
839 (name "python-blessings")
844 (uri (pypi-uri "blessings" version))
847 "0z8mgkbmisxs10rz88qg46l1c9a8n08k8cy2iassal2zh16qbrcq"))))
848 (build-system python-build-system)
850 ;; FIXME: Test suite is unable to detect TTY conditions.
853 `(("python-nose" ,python-nose)
854 ("python-six" ,python-six)))
855 (home-page "https://github.com/erikrose/blessings")
856 (synopsis "Python module to manage terminal color, styling, and
858 (description "Blessings is a pythonic API to manipulate terminal color,
859 styling, and positioning. It provides similar features to curses but avoids
860 some of curses’s limitations: it does not require clearing the whole screen
861 for little changes, provides a scroll-back buffer after the program exits, and
862 avoids styling altogether when the output is redirected to something other
864 (license license:expat)))
866 (define-public python2-blessings
867 (package-with-python2 python-blessings))
869 (define-public python-curtsies
871 (name "python-curtsies")
876 (uri (pypi-uri "curtsies" version))
879 "1vljmw3sy6lrqahhpyg4gk13mzcx3mwhvg8s41698ms3cpgkjipc"))))
880 (build-system python-build-system)
883 (modify-phases %standard-phases
886 (invoke "nosetests" "-v"))))))
888 `(("python-blessings" ,python-blessings)
889 ("python-wcwidth" ,python-wcwidth)))
891 `(("python-mock" ,python-mock)
892 ("python-pyte" ,python-pyte)
893 ("python-nose" ,python-nose)))
894 (home-page "https://github.com/thomasballinger/curtsies")
895 (synopsis "Library for curses-like terminal interaction with colored
897 (description "Curtsies is a Python library for interacting with the
898 terminal. It features string-like objects which carry formatting information,
899 per-line fullscreen terminal rendering, and keyboard input event reporting.")
900 (license license:expat)))
902 (define-public python2-curtsies
903 (package-with-python2 python-curtsies))
913 (url "https://github.com/tmate-io/tmate")
915 (file-name (git-file-name name version))
918 "0x5c31yq7ansmiy20a0qf59wagba9v3pq97mlkxrqxn4n1gcc6vi"))))
919 (build-system gnu-build-system)
921 `(("libevent" ,libevent)
924 ("ncurses" ,ncurses)))
926 `(("autoconf" ,autoconf)
927 ("automake" ,automake)
928 ("pkg-config" ,pkg-config)))
929 (home-page "https://tmate.io/")
930 (synopsis "Terminal sharing application")
931 (description "tmate is a terminal sharing application that allows you to
932 share your terminal with other users over the Internet. tmate is a fork of
934 (license license:isc)))
940 (home-page "https://sw.kovidgoyal.net/kitty/")
945 (url "https://github.com/kovidgoyal/kitty")
946 (commit (string-append "v" version))))
947 (file-name (git-file-name name version))
949 (base32 "1bszyddar0g1gdz67h8rd3gbrdhi6ahjg7j14cjiqxm1938z9ajf"))
950 (modules '((guix build utils)))
953 ;; patch needed as sphinx-build is used as a python script
954 ;; whereas the guix package uses a bash script launching the
956 (substitute* "docs/conf.py"
957 (("(from kitty.constants import str_version)" kitty-imp)
958 (string-append "sys.path.append(\"..\")\n" kitty-imp)))
959 (substitute* "docs/Makefile"
960 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
961 "SPHINXBUILD = sphinx-build\n"))
963 (build-system gnu-build-system)
966 ("harfbuzz" ,harfbuzz)
968 ("libcanberra" ,libcanberra)
970 ("freetype" ,freetype)
971 ("fontconfig" ,fontconfig)
972 ("pygments" ,python-pygments)
973 ("wayland" ,wayland)))
975 `(("pkg-config" ,pkg-config)
976 ("libxrandr" ,libxrandr)
978 ("libxcursor" ,libxcursor)
980 ("libxinerama" ,libxinerama)
981 ("libgl1-mesa" ,mesa)
982 ("libxkbcommon" ,libxkbcommon)
983 ("sphinx" ,python-sphinx)
984 ("ncurses" ,ncurses) ;; for tic command
985 ("wayland-protocols" ,wayland-protocols)))
987 '(#:phases (modify-phases %standard-phases
989 ;; Wayland backend requires EGL, which isn't found
990 ;; out-of-the-box for some reason. Hard-code it instead.
991 (add-after 'unpack 'hard-code-libegl
993 (let* ((mesa (assoc-ref %build-inputs "libgl1-mesa"))
994 (libegl (string-append mesa "/lib/libEGL.so.1")))
995 (substitute* "glfw/egl_context.c"
996 (("libEGL.so.1") libegl)))
1000 (invoke "python3" "setup.py" "linux-package")))
1003 (invoke "python3" "setup.py" "test")))
1004 (add-before 'install 'rm-pycache
1005 ;; created python cache __pycache__ are non deterministic
1007 (let ((pycaches (find-files "linux-package/"
1009 #:directories? #t)))
1010 (for-each delete-file-recursively pycaches)
1014 (let* ((out (assoc-ref %outputs "out"))
1015 (obin (string-append out "/bin"))
1016 (olib (string-append out "/lib"))
1017 (oshare (string-append out "/share")))
1018 (copy-recursively "linux-package/bin" obin)
1019 (copy-recursively "linux-package/share" oshare)
1020 (copy-recursively "linux-package/lib" olib)
1022 (synopsis "Fast, featureful, GPU based terminal emulator")
1023 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1025 @item Offloads rendering to the GPU for lower system load and buttery smooth
1026 scrolling. Uses threaded rendering to minimize input latency.
1027 @item Supports all modern terminal features: graphics (images), unicode,
1028 true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1029 paste and several new terminal protocol extensions.
1030 @item Supports tiling multiple terminal windows side by side in different
1031 layouts without needing to use an extra program like tmux.
1032 @item Can be controlled from scripts or the shell prompt, even over SSH.
1033 @item Has a framework for Kittens, small terminal programs that can be used to
1034 extend kitty's functionality. For example, they are used for Unicode input,
1035 hints, and side-by-side diff.
1036 @item Supports startup sessions which allow you to specify the window/tab
1037 layout, working directories and programs to run on startup.
1038 @item Allows you to open the scrollback buffer in a separate window using
1039 arbitrary programs of your choice. This is useful for browsing the history
1040 comfortably in a pager or editor.
1042 (license license:gpl3+)))
1044 (define-public eternalterminal
1046 (name "eternalterminal")
1052 (url "https://github.com/MisterTea/EternalTerminal")
1053 (commit (string-append "et-v" version))))
1054 (file-name (git-file-name name version))
1056 (base32 "0sb1hypg2276y8c2a5vivrkcxp70swddvhnd9h273if3kv6j879r"))))
1057 (build-system cmake-build-system)
1059 '(#:configure-flags '("-DBUILD_TEST=ON")
1061 (modify-phases %standard-phases
1062 (add-after 'unpack 'insert-googletests
1063 (lambda* (#:key inputs #:allow-other-keys)
1064 (let ((tests (assoc-ref inputs "googletest")))
1065 (copy-recursively tests "external/googletest"))
1068 `(("gflags" ,gflags)
1069 ("libsodium" ,libsodium)
1070 ("protobuf" ,protobuf)))
1072 `(("googletest" ,(package-source googletest))))
1073 (home-page "https://mistertea.github.io/EternalTerminal/")
1074 (synopsis "Remote shell that reconnects without interrupting the session")
1075 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1076 automatically reconnects without interrupting the session. ET uses SSH to
1077 initialize a secure connection. Unlike SSH sessions, which must be killed and
1078 reconnected after a network outage an ET session will survive network outages
1079 and IP roaming. ET provides the same core functionality as @command{mosh},
1080 while also supporting native scrolling and @command{tmux} control mode
1081 (@code{tmux -CC}).")
1082 (license license:asl2.0)))
1085 (deprecated-package "et" eternalterminal))
1087 (define-public wterm
1095 (url "https://github.com/majestrate/wterm")
1096 (commit "0ae42717c08a85a6509214e881422c7fbe7ecc45")))
1099 "0g4lzmc1w6na81i6hny32xds4xfig4xzswzfijyi6p93a1226dv0"))
1100 (file-name (git-file-name name version))))
1101 (build-system gnu-build-system)
1103 `(("pkg-config" ,pkg-config)))
1105 `(("fontconfig" ,fontconfig)
1106 ("freetype" ,freetype)
1108 ("libxkbcommon" ,libxkbcommon)
1109 ("ncurses" ,ncurses)
1111 ("wayland" ,wayland)))
1115 ;; Without -j1 it fails to find file libwld.a.
1116 #:parallel-build? #f
1118 #:make-flags (list "CC=gcc"
1119 (string-append "PREFIX=" %output)
1120 (string-append "TERMINFO="
1121 (assoc-ref %outputs "out")
1124 (modify-phases %standard-phases
1126 (add-after 'unpack 'terminfo-fix
1128 (substitute* "Makefile"
1129 (("\ttic .*") "\tmkdir -p $(SHARE_PREFIX)/share/terminfo
1130 \ttic -o $(SHARE_PREFIX)/share/terminfo -s wterm.info\n"))
1132 (native-search-paths
1133 (list (search-path-specification
1134 (variable "TERMINFO_DIRS")
1135 (files '("share/terminfo")))))
1136 (home-page "https://github.com/majestrate/wterm")
1137 (synopsis "Terminal emulator for Wayland")
1138 (description "wterm is a native Wayland terminal emulator based on
1139 an st fork using wld. st is a simple terminal emulator for X originally
1141 (license license:x11)))
1143 (define-public alacritty
1151 (url "https://github.com/jwilm/alacritty")
1152 (commit (string-append "v" version))))
1153 (file-name (git-file-name name version))
1155 (base32 "05jcg33ifngpzw2hdhgb614j87ihhhlqgar0kky183rywg0dxikg"))
1156 (modules '((guix build utils)))
1158 ;; Don't use a custom location for winit-0.20-alpha6.
1159 '(begin (substitute* "Cargo.toml"
1162 (build-system cargo-build-system)
1165 (("rust-clap" ,rust-clap-2)
1166 ("rust-log" ,rust-log-0.4)
1167 ("rust-time" ,rust-time-0.1)
1168 ("rust-env-logger" ,rust-env-logger-0.7)
1169 ("rust-serde" ,rust-serde-1)
1170 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
1171 ("rust-serde-json" ,rust-serde-json-1)
1172 ("rust-glutin" ,rust-glutin-0.22) ; adjust 'patch-glutin-libgl-path as needed
1173 ("rust-notify" ,rust-notify-4)
1174 ("rust-libc" ,rust-libc-0.2)
1175 ("rust-unicode-width" ,rust-unicode-width-0.1)
1176 ("rust-parking-lot" ,rust-parking-lot-0.9)
1177 ("rust-urlocator" ,rust-urlocator-0.1)
1178 ("rust-xdg" ,rust-xdg-2.2)
1179 ("rust-image" ,rust-image-0.22)
1180 ("rust-dirs" ,rust-dirs-2.0)
1181 ("rust-x11-dl" ,rust-x11-dl-2)
1182 ("rust-winapi" ,rust-winapi-0.3)
1183 ("rust-base64" ,rust-base64-0.11)
1184 ("rust-bigflags" ,rust-bitflags-1)
1185 ("rust-fnv" ,rust-fnv-1)
1186 ("rust-mio" ,rust-mio-0.6)
1187 ("rust-mio-extras" ,rust-mio-extras-2)
1188 ("rust-terminfo" ,rust-terminfo-0.6)
1189 ("rust-url" ,rust-url-2)
1190 ("rust-vte" ,rust-vte-0.3)
1191 ("rust-nix" ,rust-nix-0.15)
1192 ("rust-miow" ,rust-miow-0.3)
1193 ("rust-mio-anonymous-pipes" ,rust-mio-anonymous-pipes-0.1)
1194 ("rust-mio-named-pipes" ,rust-mio-named-pipes-0.1)
1195 ("rust-signal-hook" ,rust-signal-hook-0.1)
1196 ("rust-clipboard-win" ,rust-clipboard-win-2.1)
1197 ("rust-objc" ,rust-objc-0.2)
1198 ("rust-objc-id" ,rust-objc-id-0.1)
1199 ("rust-objc-foundation" ,rust-objc-foundation-0.1)
1200 ("rust-x11-clipboard" ,rust-x11-clipboard-0.4)
1201 ("rust-smithay-clipboard" ,rust-smithay-clipboard-0.3)
1202 ("rust-wayland-client" ,rust-wayland-client-0.23)
1203 ("rust-euclid" ,rust-euclid-0.20)
1204 ("rust-foreign-types" ,rust-foreign-types-0.5)
1205 ("rust-servo-fontconfig" ,rust-servo-fontconfig-0.4)
1206 ("rust-freetype-rs" ,rust-freetype-rs-0.23)
1207 ("rust-core-foundation" ,rust-core-foundation-0.6)
1208 ("rust-core-foundation-sys" ,rust-core-foundation-sys-0.6)
1209 ("rust-core-text" ,rust-core-text-13)
1210 ("rust-core-graphics" ,rust-core-graphics-0.17)
1211 ("rust-dwrote" ,rust-dwrote-0.9)
1212 ("rust-winpty-sys" ,rust-winpty-sys-0.4))
1213 #:cargo-development-inputs
1214 (("rust-rustc-tools-util" ,rust-rustc-tools-util-0.2)
1215 ("rust-gl-generator" ,rust-gl-generator-0.14)
1216 ("rust-andrew" ,rust-andrew-0.2)
1217 ("rust-smithay-client-toolkit" ,rust-smithay-client-toolkit-0.6)
1218 ("rust-embed-resource" ,rust-embed-resource-1.3)
1219 ("rust-http-req" ,rust-http-req-0.5)
1220 ("rust-zip" ,rust-zip-0.5)
1221 ("rust-tempfile" ,rust-tempfile-3)
1222 ("rust-named-pipe" ,rust-named-pipe-0.4)
1223 ("rust-winapi" ,rust-winapi-0.3))
1225 (modify-phases %standard-phases
1226 (add-after 'configure 'patch-glutin-libgl-path
1227 (lambda* (#:key inputs cargo-inputs vendor-dir #:allow-other-keys)
1228 (let* ((glutin-name ,(package-name rust-glutin-0.22))
1229 (glutin-version ,(package-version rust-glutin-0.22))
1232 glutin-name "-" glutin-version ".tar.gz/src/api/"))
1233 (mesa (assoc-ref inputs "mesa")))
1234 (substitute* (string-append vendor-dir "/" src-api "glx/mod.rs")
1235 (("libGL.so") (string-append mesa "/lib/libGL.so")))
1236 (substitute* (string-append vendor-dir "/" src-api "egl/mod.rs")
1237 (("libEGL.so") (string-append mesa "/lib/libEGL.so")))
1239 (add-after 'configure 'remove-alacritty-vendor
1240 (lambda* (#:key vendor-dir #:allow-other-keys)
1241 ;; We don't want Alacritty to be a dependency of itself
1242 ;; If we don't delete it from guix-vendor then build will fail
1243 ;; because Alacritty has a virtual workspace Cargo.toml.
1244 (delete-file-recursively
1245 (string-append vendor-dir "/alacritty-" ,version ".tar.xz"))
1248 (lambda* (#:key inputs outputs #:allow-other-keys)
1249 (let* ((out (assoc-ref outputs "out"))
1250 (bin (string-append out "/bin"))
1251 (share (string-append out "/share"))
1252 (icons (string-append share "/icons/hicolor/scalable/apps"))
1253 (tic (string-append (assoc-ref inputs "ncurses") "/bin/tic"))
1254 (man (string-append share "/man/man1"))
1255 (alacritty-bin "target/release/alacritty"))
1257 ;; Install and wrap the binary.
1258 (install-file alacritty-bin bin)
1259 (wrap-program (string-append bin "/alacritty")
1260 ;; Both libraries are dlopen()d by cargo dependencies above
1261 ;; when running Alacritty on pure Wayland.
1262 ;; XXX Find out how to patch these at the source.
1263 `("LD_LIBRARY_PATH" ":" prefix
1264 (,(string-append (assoc-ref inputs "libxkbcommon") "/lib:"
1265 (assoc-ref inputs "wayland") "/lib"))))
1267 ;; Install man pages.
1269 (copy-file "extra/alacritty.man"
1270 (string-append man "/alacritty.1"))
1272 ;; Install desktop file.
1273 (install-file "extra/linux/alacritty.desktop"
1274 (string-append share "/applications"))
1278 (copy-file "extra/logo/alacritty-term.svg"
1279 (string-append icons "/Alacritty.svg"))
1281 ;; Install terminfo.
1282 (mkdir-p (string-append share "/terminfo"))
1283 ;; We don't compile alacritty-common entry because
1284 ;; it's being used only for inheritance.
1285 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1286 "-o" (string-append share "/terminfo/")
1287 "extra/alacritty.info")
1289 ;; Install completions.
1291 "extra/completions/alacritty.bash"
1292 (string-append out "/etc/bash_completion.d"))
1294 "extra/completions/_alacritty"
1295 (string-append share "/zsh/site-functions"))
1297 "extra/completions/alacritty.fish"
1298 (string-append share "/fish/vendor_completions.d"))
1302 ("fontconfig" ,fontconfig)
1303 ("freetype" ,freetype)
1306 ("libxcursor" ,libxcursor)
1308 ("libxkbcommon" ,libxkbcommon)
1309 ("libxrandr" ,libxrandr)
1310 ("libxxf86vm" ,libxxf86vm)
1311 ("wayland" ,wayland)
1315 ("ncurses" ,ncurses)
1316 ("pkg-config" ,pkg-config)
1317 ("python3" ,python)))
1318 (native-search-paths
1319 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1320 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1321 (list (search-path-specification
1322 (variable "TERMINFO_DIRS")
1323 (files '("share/terminfo")))))
1324 (home-page "https://github.com/alacritty/alacritty")
1325 (synopsis "GPU-accelerated terminal emulator")
1327 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1328 simplicity and performance. With such a strong focus on performance, included
1329 features are carefully considered and you can always expect Alacritty to be
1330 blazingly fast. By making sane choices for defaults, Alacritty requires no
1331 additional setup. However, it does allow configuration of many aspects of the
1332 terminal. Note that you need support for OpenGL 3.2 or higher.")
1333 (license license:asl2.0)))