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>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages terminals)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix build-system cargo)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system glib-or-gtk)
44 #:use-module (guix build-system go)
45 #:use-module (guix build-system python)
46 #:use-module (guix download)
47 #:use-module (guix git-download)
48 #:use-module (guix packages)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages cmake)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages crates-io)
55 #:use-module (gnu packages crypto)
56 #:use-module (gnu packages docbook)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages freedesktop)
59 #:use-module (gnu packages gcc)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages golang)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages libcanberra)
68 #:use-module (gnu packages libevent)
69 #:use-module (gnu packages linux)
70 #:use-module (gnu packages ncurses)
71 #:use-module (gnu packages perl)
72 #:use-module (gnu packages perl-check)
73 #:use-module (gnu packages pkg-config)
74 #:use-module (gnu packages popt)
75 #:use-module (gnu packages protobuf)
76 #:use-module (gnu packages python)
77 #:use-module (gnu packages python-web)
78 #:use-module (gnu packages python-xyz)
79 #:use-module (gnu packages qt)
80 #:use-module (gnu packages serialization)
81 #:use-module (gnu packages sphinx)
82 #:use-module (gnu packages ssh)
83 #:use-module (gnu packages textutils)
84 #:use-module (gnu packages xdisorg)
85 #:use-module (gnu packages xml)
86 #:use-module (gnu packages xorg)
87 #:use-module (srfi srfi-26))
96 (url "https://github.com/lanoxx/tilda.git")
97 (commit (string-append "tilda-" version))))
98 (file-name (git-file-name name version))
101 "13djibj3s7ig13c57ywy38pxy3qfmqihii2c0g15fy2h9q8xp1gx"))))
102 (build-system glib-or-gtk-build-system)
104 '(#:phases (modify-phases %standard-phases
107 (setenv "NOCONFIGURE" "true")
108 (invoke "sh" "autogen.sh"))))))
110 `(("autoconf" ,autoconf)
111 ("automake" ,automake)
112 ("gettext" ,gettext-minimal)
113 ("pkg-config" ,pkg-config)))
115 `(("libconfuse" ,libconfuse)
117 (synopsis "GTK+-based drop-down terminal")
118 (description "Tilda is a terminal emulator similar to normal terminals like
119 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
120 from the edge of a screen when a certain configurable hotkey is pressed. This
121 is similar to the built-in consoles in some applications. Tilda is highly
122 configurable through a graphical wizard.")
123 (home-page "https://github.com/lanoxx/tilda")
124 (license license:gpl2+)))
126 (define-public termite
134 (url (string-append "https://github.com/thestinger/"
136 (commit (string-append "v" version))
138 (file-name (string-append name "-" version "-checkout"))
141 "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k"))))
142 (build-system gnu-build-system)
145 (modify-phases %standard-phases
146 (add-after 'unpack 'patch-xdg-open
148 (substitute* "termite.cc"
149 (("xdg-open") (which "xdg-open")))
153 ;; This sets the destination when installing the necessary terminal
154 ;; capability data, which are not provided by 'ncurses'. See
155 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
156 #:make-flags (list "PREFIX="
157 (string-append "VERSION=v" (version))
158 (string-append "DESTDIR="
159 (assoc-ref %outputs "out")))))
163 ("xdg-utils" ,xdg-utils)
164 ("ncurses" ,ncurses)))
166 `(("pkg-config" ,pkg-config)))
168 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
169 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
171 (list (search-path-specification
172 (variable "TERMINFO_DIRS")
173 (files '("share/terminfo")))))
174 (home-page "https://github.com/thestinger/termite/")
175 (synopsis "Keyboard-centric, VTE-based terminal")
176 (description "Termite is a minimal terminal emulator designed for use with
177 tiling window managers. It is a modal application, similar to Vim, with an
178 insert mode and command mode where keybindings have different functions.")
180 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
181 (license license:lgpl2.0+)))
183 (define-public asciinema
191 (url "https://github.com/asciinema/asciinema")
192 (commit (string-append "v" version))))
193 (file-name (git-file-name name version))
196 "1a2pysxnp6icyd08mgf66xr6f6j0irnfxdpf3fmzcz31ix7l9kc4"))))
197 (build-system python-build-system)
200 (modify-phases %standard-phases
201 (add-before 'build 'patch-exec-paths
202 (lambda* (#:key inputs #:allow-other-keys)
203 (let ((ncurses (assoc-ref inputs "ncurses")))
204 (substitute* "asciinema/term.py"
206 (string-append "'" ncurses "/bin/tput'"))))
209 (lambda _ (invoke "nosetests" "-v"))))))
210 (inputs `(("ncurses" ,ncurses)))
213 `(("python-nose" ,python-nose)))
214 (home-page "https://asciinema.org")
215 (synopsis "Terminal session recorder")
217 "Use asciinema to record and share your terminal sessions, the right way.
218 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
219 text-based approach to terminal recording.")
220 (license license:gpl3)))
222 (define-public libtsm
223 (let ((commit "f70e37982f382b03c6939dac3d5f814450bda253")
227 (version (git-version "0.0.0" revision commit))
230 ;; The freedesktop repository is no longer maintained.
232 (url (string-append "https://github.com/Aetf/" name))
234 (file-name (git-file-name name version))
237 "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx"))))
238 (build-system cmake-build-system)
240 `(#:configure-flags '("-DBUILD_TESTING=ON")))
242 `(("pkg-config" ,pkg-config)))
244 `(("libxkbcommon" ,libxkbcommon)
246 (synopsis "Xterm state machine library")
247 (description "TSM is a state machine for DEC VT100-VT520 compatible
248 terminal emulators. It tries to support all common standards while keeping
249 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
250 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
251 ;; Hash table implementation is lgpl2.1+ licensed.
252 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
254 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
255 ;; under the bsd 2 license.
256 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2)))))
258 (define-public kmscon
259 (let ((commit "01dd0a231e2125a40ceba5f59fd945ff29bf2cdc")
263 (version (git-version "0.0.0" revision commit))
266 ;; The freedesktop repository is no longer maintained.
268 (url (string-append "https://github.com/Aetf/" name))
272 "0q62kjsvy2iwy8adfiygx2bfwlh83rphgxbis95ycspqidg9py87"))
274 (search-patches "kmscon-runtime-keymap-switch.patch"))
275 (modules '((guix build utils)))
276 (file-name (git-file-name name version))))
277 (build-system gnu-build-system)
279 `(;; The closure of MESA is huge so we'd rather avoid it.
280 #:disallowed-references (,mesa)
282 #:phases (modify-phases %standard-phases
285 (setenv "NOCONFIGURE" "indeed")
286 (invoke "sh" "autogen.sh")))
287 ;; Use elogind instead of systemd.
288 (add-before 'configure 'remove-systemd
290 (substitute* "configure"
291 (("libsystemd-daemon libsystemd-login")
293 (substitute* "src/uterm_systemd.c"
294 (("#include <systemd/sd-login.h>")
295 "#include <elogind/sd-login.h>")
296 ;; We don't have this header.
297 (("#include <systemd/sd-daemon\\.h>")
299 ;; Replace the call to 'sd_booted' by the truth value.
303 `(("pkg-config" ,pkg-config)
304 ("autoconf" ,autoconf)
305 ("automake" ,automake)
307 ("libxslt" ,libxslt) ;to build the man page
308 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
309 ("docbook-xsl" ,docbook-xsl)))
313 ("libxkbcommon" ,libxkbcommon)
315 ;; MESA can be used for accelerated video output via OpenGLESv2, but
316 ;; it's a bit dependency that we'd rather avoid in the installation
321 (synopsis "Linux KMS-based terminal emulator")
322 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
323 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
324 implementation with a user-space console. Compared to the Linux console,
325 kmscon provides enhanced features including XKB-compatible internationalized
326 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
327 multi-seat support, a replacement for @command{mingetty}, and more.")
328 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
329 ;; Hash table implementation is lgpl2.1+ licensed.
330 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
332 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
333 ;; under the bsd 2 license.
334 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
335 ;; under the terms of the GNU GPL.
336 (license (list license:expat license:lgpl2.1+ license:bsd-2
338 (supported-systems (filter (cut string-suffix? "-linux" <>)
339 %supported-systems)))))
341 (define-public libtermkey
347 (uri (string-append "http://www.leonerd.org.uk/code/libtermkey/"
348 "libtermkey-" version ".tar.gz"))
350 (base32 "0psd0kf10q5ixfima0mxz10syy7qq1ilz1npr0rz862xycvzgjyf"))))
351 (build-system gnu-build-system)
355 (string-append "PREFIX=" (assoc-ref %outputs "out")))
356 #:phases (modify-phases %standard-phases
357 (delete 'configure)) ; no configure script
358 #:test-target "test"))
359 (inputs `(("ncurses" ,ncurses)))
360 (native-inputs `(("libtool" ,libtool)
361 ("perl-test-harness" ,perl-test-harness)
362 ("pkg-config" ,pkg-config)))
363 (synopsis "Keyboard entry processing library for terminal-based programs")
365 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
366 combining, and so on, with a simple interface.")
367 (home-page "http://www.leonerd.org.uk/code/libtermkey")
368 (license license:expat)))
370 (define-public picocom
377 (url "https://github.com/npat-efault/picocom.git")
379 (file-name (git-file-name name version))
382 "1vvjydqf0ax47nvdyyl67jafw5b3sfsav00xid6qpgia1gs2r72n"))))
383 (build-system gnu-build-system)
385 `(#:make-flags '("CC=gcc")
386 #:tests? #f ; no tests
388 (modify-phases %standard-phases
389 (delete 'configure) ; no configure script
391 ;; The Makefile lacks an ‘install’ target.
392 (lambda* (#:key outputs #:allow-other-keys)
393 (let* ((out (assoc-ref outputs "out"))
394 (bin (string-append out "/bin"))
395 (man (string-append out "/share/man/man1")))
396 (install-file "picocom" bin)
397 (install-file "picocom.1" man)))))))
398 (home-page "https://github.com/npat-efault/picocom")
399 (synopsis "Minimal dumb-terminal emulator")
401 "Picocom is a minimal dumb-terminal emulation program. It was designed to
402 serve as a simple and manual modem configuration, testing, and debugging tool.
403 It also serves well as a low-tech serial communications program to allow access
404 to all types of devices that provide serial consoles.")
405 (license license:gpl2+)))
415 ;; The original beep 1.3 at <http://www.johnath.com/beep> has been
416 ;; unmaintained for some time, and vulnerable to at least two CVEs:
417 ;; https://github.com/johnath/beep/issues/11#issuecomment-454056858
418 ;; Use this maintained fork instead.
419 (url "https://github.com/spkr-beep/beep.git")
420 (commit (string-append "v" version))))
421 (file-name (git-file-name name version))
423 (base32 "0jmvqk6g5n0wzj9znw42njxq3mzw1769f4db99b83927hf4aidi4"))))
424 (build-system gnu-build-system)
426 `(#:tests? #f ; no tests
428 (list (string-append "prefix=" (assoc-ref %outputs "out"))
429 (string-append "pkgdocdir=$(docdir)/" ,name "-" ,version))
431 (modify-phases %standard-phases
432 (delete 'configure)))) ; no configure script
433 (synopsis "Linux command-line utility to control the PC speaker")
434 (description "beep allows the user to control the PC speaker with precision,
435 allowing different sounds to indicate different events. While it can be run
436 quite happily on the command line, its intended place of residence is within
437 scripts, notifying the user when something interesting occurs. Of course, it
438 has no notion of what's interesing, but it's very good at that notifying part.")
439 (home-page "https://github.com/spkr-beep/beep")
440 (license license:gpl2+)))
442 (define-public unibilium
450 (url "https://github.com/mauke/unibilium.git")
451 (commit (string-append "v" version))))
452 (file-name (git-file-name name version))
455 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
456 (build-system gnu-build-system)
460 (string-append "PREFIX=" (assoc-ref %outputs "out")))
462 ;; FIXME: tests require "prove"
465 (modify-phases %standard-phases
466 (delete 'configure))))
468 `(("libtool" ,libtool)
470 (home-page "https://github.com/mauke/unibilium")
471 (synopsis "Terminfo parsing library")
472 (description "Unibilium is a basic C terminfo library. It doesn't depend
473 on curses or any other library. It also doesn't use global variables, so it
474 should be thread-safe.")
475 (license license:lgpl3+)))
477 (define-public libvterm
484 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
485 "libvterm-" version ".tar.gz"))
488 "1n5maylann2anfifjy576vzyar9q5m1kzpyiz2hca2pacxy8xf4v"))))
489 (build-system gnu-build-system)
493 (string-append "PREFIX=" (assoc-ref %outputs "out")))
496 (modify-phases %standard-phases
497 (delete 'configure))))
499 `(("libtool" ,libtool)
501 (home-page "http://www.leonerd.org.uk/code/libvterm/")
502 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
503 (description "Libvterm is an abstract C99 library which implements a VT220
504 or xterm-like terminal emulator. It doesn't use any particular graphics
505 toolkit or output system, instead it invokes callback function pointers that
506 its embedding program should provide it to draw on its behalf. It avoids
507 calling @code{malloc} during normal running state, allowing it to be used in
508 embedded kernel situations.")
509 (license license:expat)))
511 (define-public cool-retro-term
512 (let ((commit "1.1.1")
513 (revision "0")) ;not used currently
515 (name "cool-retro-term")
519 (file-name (string-append name "-" version "-checkout"))
521 (url (string-append "https://github.com/Swordfish90/" name))
525 (base32 "0wb6anchxa5jpn9c73kr4byrf2xlj8x8qzc5x7ny6saj7kbbvp75"))
526 (modules '((guix build utils)
532 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
533 "1977-apple2" ; Non-Free
534 "1977-commodore-pet" ; Non-Free
535 "1979-atari-400-800" ; Non-Free
536 ;"1981-ibm-pc ; CC-SA 4.0
537 "1982-commodore64")) ; Non-Free
538 ;"1985-ibm-pc-vga" ; CC-SA 4.0
539 ;"modern-fixedsys-excelsior" ; Redistributable
540 ;"modern-hermit" ; SIL
541 ;"modern-inconsolata"; SIL
542 ;"modern-pro-font-win-tweaked" ; X11
543 ;"modern-proggy-tiny"; X11
544 ;"modern-terminus" ; SIL
545 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
546 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
547 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
549 ;; Gather font names from all Fonts*.qml files.
550 ;; These will be used to remove items from the
553 (lambda (font-file names)
554 (call-with-input-file font-file
556 (let loop ((name #f) (names names))
557 (let ((line (read-line port)))
559 ((eof-object? line) (pk 'names names))
560 ((regexp-exec name-rx line)
562 (loop (match:substring m 1) names)))
563 ((regexp-exec source-rx line)
565 (let ((font (match:substring m 1)))
566 (if (member font fonts)
567 (loop #f (lset-adjoin string=?
570 (else (loop name names))))))))
571 '() (find-files "app/qml" "Font.*\\.qml"))))
572 ;; Remove the font files themselves
573 (for-each (lambda (font)
574 (delete-file-recursively
575 (string-append "app/qml/fonts/" font)))
577 ;; Remove mention of those fonts in the source
578 (substitute* "app/qml/resources.qrc"
579 (((string-append " *<file>fonts/("
580 (string-join fonts "|")
585 (let ((start-rx (make-regexp " *ListElement\\{"))
586 (end-rx (make-regexp " *\\}")))
587 (with-atomic-file-replacement file
589 (let loop ((line-buffer '())
592 (let ((line (read-line in 'concat)))
594 ((eof-object? line) #t) ;done
595 ((regexp-exec start-rx line)
596 (loop (cons line line-buffer) #t #f))
597 ((or (regexp-exec source-rx line)
598 (regexp-exec fontname-rx line))
600 (let ((font-or-name (match:substring m 1)))
601 (if (or (member font-or-name fonts)
602 (member font-or-name names))
604 (loop (cons line line-buffer)
606 ((regexp-exec end-rx line)
608 (for-each (cut display <> out)
609 (reverse line-buffer))
612 (hold? (loop (cons line line-buffer)
614 (discard? (loop line-buffer #f #t))
615 (else (display line out)
616 (loop '() #f #f)))))))))
617 '("app/qml/FontPixels.qml"
618 "app/qml/FontScanlines.qml"
620 "app/qml/ApplicationSettings.qml"))
621 ;; Final substitution for default scanline and pixel fonts
622 (substitute* "app/qml/ApplicationSettings.qml"
623 (("COMMODORE_PET") "PROGGY_TINY"))
625 (build-system gnu-build-system)
628 ("qtdeclarative" ,qtdeclarative)
629 ("qtgraphicaleffects" ,qtgraphicaleffects)
630 ("qtquickcontrols" ,qtquickcontrols)))
633 (modify-phases %standard-phases
635 (lambda* (#:key outputs #:allow-other-keys)
636 (let ((out (assoc-ref outputs "out")))
637 (substitute* '("qmltermwidget/qmltermwidget.pro")
638 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
639 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
640 (substitute* '("cool-retro-term.pro" "app/app.pro")
643 (add-after 'install 'wrap-executable
644 (lambda* (#:key inputs outputs #:allow-other-keys)
645 (let ((out (assoc-ref outputs "out"))
646 (qml "/lib/qt5/qml"))
647 (wrap-program (string-append out "/bin/cool-retro-term")
648 `("QML2_IMPORT_PATH" ":" prefix
649 (,(string-append out qml)
651 (string-append (assoc-ref inputs i) qml))
654 "qtquickcontrols")))))
656 (add-after 'install 'add-alternate-name
657 (lambda* (#:key outputs #:allow-other-keys)
658 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
659 (symlink (string-append bin "/cool-retro-term")
660 (string-append bin "/crt"))
662 (add-after 'install 'install-man
663 (lambda* (#:key outputs #:allow-other-keys)
664 (let ((mandir (string-append (assoc-ref outputs "out")
666 (install-file "packaging/debian/cool-retro-term.1" mandir)
668 (synopsis "Terminal emulator")
670 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
671 feel of the old cathode ray tube (CRT) screens. It has been designed to be
672 eye-candy, customizable, and reasonably lightweight.")
673 (home-page "https://github.com/Swordfish90/cool-retro-term")
675 license:gpl2+ ; qmltermwidget
676 license:gpl3+ ; cool-retro-term
682 (define-public sakura
688 (uri (string-append "https://launchpad.net/" name "/trunk/"
689 version "/+download/" name "-" version
693 "15gskj5yv5qs3cj4ps43735kfx2nzjlhq4dk9ghirl8lvhhxsm5m"))))
694 (build-system cmake-build-system)
696 '(#:tests? #f)) ; no check phase
698 `(("gettext" ,gettext-minimal)
699 ("perl" ,perl) ; for pod2man
700 ("pkg-config" ,pkg-config)))
704 (home-page "https://launchpad.net/sakura")
705 (synopsis "A simple but powerful libvte-based terminal emulator")
706 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
707 It's a terminal emulator with few dependencies, so you don't need a full GNOME
708 desktop installed to have a decent terminal emulator.")
709 (license license:gpl2)))
711 (define-public go-github.com-nsf-termbox-go
712 (let ((commit "288510b9734e30e7966ec2f22b87c5f8e67345e3")
715 (name "go-github.com-nsf-termbox-go")
716 (version (git-version "0.0.0" revision commit))
720 (url "https://github.com/nsf/termbox-go.git")
722 (file-name (git-file-name name version))
725 "0hdyisfaf8yb55h3p03p4sbq19546mp9fy28f2kn659mycmhxqk4"))))
726 (build-system go-build-system)
728 '(#:import-path "github.com/nsf/termbox-go"))
730 `(("go-github.com-mattn-go-runewidth"
731 ,go-github.com-mattn-go-runewidth)))
732 (synopsis "@code{termbox} provides a minimal API for text-based user
735 "Termbox is a library that provides a minimalistic API which allows the
736 programmer to write text-based user interfaces.")
737 (home-page "https://github.com/nsf/termbox-go")
738 (license license:expat))))
740 (define-public go-github-com-junegunn-fzf
742 (name "go-github-com-junegunn-fzf")
748 (url "https://github.com/junegunn/fzf")
750 (file-name (git-file-name name version))
753 "0pwpr4fpw56yzzkcabzzgbgwraaxmp7xzzmap7w1xsrkbj7dl2xl"))))
754 (build-system go-build-system)
756 `(#:import-path "github.com/junegunn/fzf"))
758 `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
759 ("go-github-com-mattn-go-shellwords" ,go-github-com-mattn-go-shellwords)
760 ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
761 ("go-github-com-gdamore-tcell" ,go-github-com-gdamore-tcell)
762 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
763 (home-page "https://github.com/junegunn/fzf")
764 (synopsis "Command-line fuzzy-finder")
765 (description "This package provides an interactive command-line filter
766 usable with any list--including files, command history, processes and more.")
767 (license license:expat)))
769 (define-public go-github.com-howeyc-gopass
770 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
773 (name "go-github.com-howeyc-gopass")
774 (version (git-version "0.0.0" revision commit))
778 (url "https://github.com/howeyc/gopass.git")
780 (file-name (git-file-name name version))
783 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
784 (build-system go-build-system)
786 '(#:import-path "github.com/howeyc/gopass"))
788 `(("go-golang-org-x-crypto"
789 ,go-golang-org-x-crypto)))
790 (synopsis "Retrieve password from a terminal or piped input in Go")
792 "@code{gopass} is a Go package for retrieving a password from user
793 terminal or piped input.")
794 (home-page "https://github.com/howeyc/gopass")
795 (license license:isc))))
797 (define-public python-pyte
804 (uri (pypi-uri "pyte" version))
807 "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
808 (build-system python-build-system)
811 (modify-phases %standard-phases
812 (add-after 'unpack 'remove-failing-test
813 ;; TODO: Reenable when the `captured` files required by this test
814 ;; are included in the archive.
816 (delete-file "tests/test_input_output.py")
819 `(("python-wcwidth" ,python-wcwidth)))
821 `(("python-pytest-runner" ,python-pytest-runner)
822 ("python-pytest" ,python-pytest)))
823 (home-page "https://pyte.readthedocs.io/")
824 (synopsis "Simple VTXXX-compatible terminal emulator")
825 (description "@code{pyte} is an in-memory VTxxx-compatible terminal
826 emulator. @var{VTxxx} stands for a series of video terminals, developed by
827 DEC between 1970 and 1995. The first and probably most famous one was the
828 VT100 terminal, which is now a de-facto standard for all virtual terminal
831 pyte is a fork of vt102, which was an incomplete pure Python implementation
833 (license license:lgpl3+)))
835 (define-public python2-pyte
836 (package-with-python2 python-pyte))
838 (define-public python-blessings
840 (name "python-blessings")
845 (uri (pypi-uri "blessings" version))
848 "0z8mgkbmisxs10rz88qg46l1c9a8n08k8cy2iassal2zh16qbrcq"))))
849 (build-system python-build-system)
851 ;; FIXME: Test suite is unable to detect TTY conditions.
854 `(("python-nose" ,python-nose)
855 ("python-six" ,python-six)))
856 (home-page "https://github.com/erikrose/blessings")
857 (synopsis "Python module to manage terminal color, styling, and
859 (description "Blessings is a pythonic API to manipulate terminal color,
860 styling, and positioning. It provides similar features to curses but avoids
861 some of curses’s limitations: it does not require clearing the whole screen
862 for little changes, provides a scroll-back buffer after the program exits, and
863 avoids styling altogether when the output is redirected to something other
865 (license license:expat)))
867 (define-public python2-blessings
868 (package-with-python2 python-blessings))
870 (define-public python-curtsies
872 (name "python-curtsies")
877 (uri (pypi-uri "curtsies" version))
880 "1vljmw3sy6lrqahhpyg4gk13mzcx3mwhvg8s41698ms3cpgkjipc"))))
881 (build-system python-build-system)
884 (modify-phases %standard-phases
887 (invoke "nosetests" "-v"))))))
889 `(("python-blessings" ,python-blessings)
890 ("python-wcwidth" ,python-wcwidth)))
892 `(("python-mock" ,python-mock)
893 ("python-pyte" ,python-pyte)
894 ("python-nose" ,python-nose)))
895 (home-page "https://github.com/thomasballinger/curtsies")
896 (synopsis "Library for curses-like terminal interaction with colored
898 (description "Curtsies is a Python library for interacting with the
899 terminal. It features string-like objects which carry formatting information,
900 per-line fullscreen terminal rendering, and keyboard input event reporting.")
901 (license license:expat)))
903 (define-public python2-curtsies
904 (package-with-python2 python-curtsies))
914 (url "https://github.com/tmate-io/tmate.git")
916 (file-name (git-file-name name version))
919 "0pfl9vrswzim9ydi1n652h3rax2zrmy6sqkp0r09yy3lw83h4y1r"))))
920 (build-system gnu-build-system)
922 `(("libevent" ,libevent)
925 ("ncurses" ,ncurses)))
927 `(("autoconf" ,autoconf)
928 ("automake" ,automake)
929 ("pkg-config" ,pkg-config)))
930 (home-page "https://tmate.io/")
931 (synopsis "Terminal sharing application")
932 (description "tmate is a terminal sharing application that allows you to
933 share your terminal with other users over the Internet. tmate is a fork of
935 (license license:isc)))
941 (home-page "https://sw.kovidgoyal.net/kitty/")
946 (url "https://github.com/kovidgoyal/kitty.git")
947 (commit (string-append "v" version))))
948 (file-name (git-file-name name version))
950 (base32 "1bszyddar0g1gdz67h8rd3gbrdhi6ahjg7j14cjiqxm1938z9ajf"))
951 (modules '((guix build utils)))
954 ;; patch needed as sphinx-build is used as a python script
955 ;; whereas the guix package uses a bash script launching the
957 (substitute* "docs/conf.py"
958 (("(from kitty.constants import str_version)" kitty-imp)
959 (string-append "sys.path.append(\"..\")\n" kitty-imp)))
960 (substitute* "docs/Makefile"
961 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
962 "SPHINXBUILD = sphinx-build\n"))
964 (build-system gnu-build-system)
967 ("harfbuzz" ,harfbuzz)
969 ("libcanberra" ,libcanberra)
971 ("freetype" ,freetype)
972 ("fontconfig" ,fontconfig)
973 ("pygments" ,python-pygments)
974 ("wayland" ,wayland)))
976 `(("pkg-config" ,pkg-config)
977 ("libxrandr" ,libxrandr)
979 ("libxcursor" ,libxcursor)
981 ("libxinerama" ,libxinerama)
982 ("libgl1-mesa" ,mesa)
983 ("libxkbcommon" ,libxkbcommon)
984 ("sphinx" ,python-sphinx)
985 ("ncurses" ,ncurses) ;; for tic command
986 ("wayland-protocols" ,wayland-protocols)))
988 '(#:phases (modify-phases %standard-phases
990 ;; Wayland backend requires EGL, which isn't found
991 ;; out-of-the-box for some reason. Hard-code it instead.
992 (add-after 'unpack 'hard-code-libegl
994 (let* ((mesa (assoc-ref %build-inputs "libgl1-mesa"))
995 (libegl (string-append mesa "/lib/libEGL.so.1")))
996 (substitute* "glfw/egl_context.c"
997 (("libEGL.so.1") libegl)))
1001 (invoke "python3" "setup.py" "linux-package")))
1004 (invoke "python3" "setup.py" "test")))
1005 (add-before 'install 'rm-pycache
1006 ;; created python cache __pycache__ are non deterministic
1008 (let ((pycaches (find-files "linux-package/"
1010 #:directories? #t)))
1011 (for-each delete-file-recursively pycaches)
1015 (let* ((out (assoc-ref %outputs "out"))
1016 (obin (string-append out "/bin"))
1017 (olib (string-append out "/lib"))
1018 (oshare (string-append out "/share")))
1019 (copy-recursively "linux-package/bin" obin)
1020 (copy-recursively "linux-package/share" oshare)
1021 (copy-recursively "linux-package/lib" olib)
1023 (synopsis "Fast, featureful, GPU based terminal emulator")
1024 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1026 @item Offloads rendering to the GPU for lower system load and buttery smooth
1027 scrolling. Uses threaded rendering to minimize input latency.
1028 @item Supports all modern terminal features: graphics (images), unicode,
1029 true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1030 paste and several new terminal protocol extensions.
1031 @item Supports tiling multiple terminal windows side by side in different
1032 layouts without needing to use an extra program like tmux.
1033 @item Can be controlled from scripts or the shell prompt, even over SSH.
1034 @item Has a framework for Kittens, small terminal programs that can be used to
1035 extend kitty's functionality. For example, they are used for Unicode input,
1036 hints, and side-by-side diff.
1037 @item Supports startup sessions which allow you to specify the window/tab
1038 layout, working directories and programs to run on startup.
1039 @item Allows you to open the scrollback buffer in a separate window using
1040 arbitrary programs of your choice. This is useful for browsing the history
1041 comfortably in a pager or editor.
1043 (license license:gpl3+)))
1045 (define-public eternalterminal
1047 (name "eternalterminal")
1053 (url "https://github.com/MisterTea/EternalTerminal.git")
1054 (commit (string-append "et-v" version))))
1055 (file-name (git-file-name name version))
1057 (base32 "0jh89229bd9s82h3aj6faaybwr5xvnk8w2kgz47gq263pz021zpl"))))
1058 (build-system cmake-build-system)
1060 '(#:configure-flags '("-DBUILD_TEST=ON")
1062 (modify-phases %standard-phases
1063 (add-after 'unpack 'insert-googletests
1064 (lambda* (#:key inputs #:allow-other-keys)
1065 (let ((tests (assoc-ref inputs "googletest")))
1066 (copy-recursively tests "external/googletest"))
1068 (add-after 'install 'dont-provide-gtest-libraries
1069 (lambda* (#:key outputs #:allow-other-keys)
1070 (let ((out (assoc-ref outputs "out")))
1071 (delete-file-recursively (string-append out "/include"))
1072 (delete-file-recursively (string-append out "/lib")))
1075 `(("gflags" ,gflags)
1076 ("libsodium" ,libsodium)
1077 ("protobuf" ,protobuf)))
1079 `(("googletest" ,(package-source googletest))))
1080 (home-page "https://mistertea.github.io/EternalTerminal/")
1081 (synopsis "Remote shell that reconnects without interrupting the session")
1082 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1083 automatically reconnects without interrupting the session. ET uses SSH to
1084 initialize a secure connection. Unlike SSH sessions, which must be killed and
1085 reconnected after a network outage an ET session will survive network outages
1086 and IP roaming. ET provides the same core functionality as @command{mosh},
1087 while also supporting native scrolling and @command{tmux} control mode
1088 (@code{tmux -CC}).")
1089 (license license:asl2.0)))
1091 (define-public wterm
1099 (url "https://github.com/majestrate/wterm.git")
1100 (commit "0ae42717c08a85a6509214e881422c7fbe7ecc45")))
1103 "0g4lzmc1w6na81i6hny32xds4xfig4xzswzfijyi6p93a1226dv0"))
1104 (file-name (git-file-name name version))))
1105 (build-system gnu-build-system)
1107 `(("pkg-config" ,pkg-config)))
1109 `(("fontconfig" ,fontconfig)
1110 ("freetype" ,freetype)
1112 ("libxkbcommon" ,libxkbcommon)
1113 ("ncurses" ,ncurses)
1115 ("wayland" ,wayland)))
1119 ;; Without -j1 it fails to find file libwld.a.
1120 #:parallel-build? #f
1122 #:make-flags (list "CC=gcc"
1123 (string-append "PREFIX=" %output)
1124 (string-append "TERMINFO="
1125 (assoc-ref %outputs "out")
1128 (modify-phases %standard-phases
1130 (add-after 'unpack 'terminfo-fix
1132 (substitute* "Makefile"
1133 (("\ttic .*") "\tmkdir -p $(SHARE_PREFIX)/share/terminfo
1134 \ttic -o $(SHARE_PREFIX)/share/terminfo -s wterm.info\n"))
1136 (native-search-paths
1137 (list (search-path-specification
1138 (variable "TERMINFO_DIRS")
1139 (files '("share/terminfo")))))
1140 (home-page "https://github.com/majestrate/wterm")
1141 (synopsis "Terminal emulator for Wayland")
1142 (description "wterm is a native Wayland terminal emulator based on
1143 an st fork using wld. st is a simple terminal emulator for X originally
1145 (license license:x11)))
1147 (define-public alacritty
1155 (url "https://github.com/jwilm/alacritty.git")
1156 (commit (string-append "v" version))))
1157 (file-name (git-file-name name version))
1159 (base32 "05jcg33ifngpzw2hdhgb614j87ihhhlqgar0kky183rywg0dxikg"))
1160 (modules '((guix build utils)))
1162 ;; Don't use a custom location for winit-0.20-alpha6.
1163 '(begin (substitute* "Cargo.toml"
1166 (build-system cargo-build-system)
1169 (("rust-clap" ,rust-clap-2)
1170 ("rust-log" ,rust-log-0.4)
1171 ("rust-time" ,rust-time-0.1)
1172 ("rust-env-logger" ,rust-env-logger-0.7)
1173 ("rust-serde" ,rust-serde-1.0)
1174 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
1175 ("rust-serde-json" ,rust-serde-json-1.0)
1176 ("rust-glutin" ,rust-glutin-0.22) ; adjust 'patch-glutin-libgl-path as needed
1177 ("rust-notify" ,rust-notify-4)
1178 ("rust-libc" ,rust-libc-0.2)
1179 ("rust-unicode-width" ,rust-unicode-width-0.1)
1180 ("rust-parking-lot" ,rust-parking-lot-0.9)
1181 ("rust-urlocator" ,rust-urlocator-0.1)
1182 ("rust-xdg" ,rust-xdg-2.2)
1183 ("rust-image" ,rust-image-0.22)
1184 ("rust-dirs" ,rust-dirs-2.0)
1185 ("rust-x11-dl" ,rust-x11-dl-2)
1186 ("rust-winapi" ,rust-winapi-0.3)
1187 ("rust-base64" ,rust-base64-0.11)
1188 ("rust-bigflags" ,rust-bitflags-1)
1189 ("rust-fnv" ,rust-fnv-1.0)
1190 ("rust-mio" ,rust-mio-0.6)
1191 ("rust-mio-extras" ,rust-mio-extras-2)
1192 ("rust-terminfo" ,rust-terminfo-0.6)
1193 ("rust-url" ,rust-url-2.1)
1194 ("rust-vte" ,rust-vte-0.3)
1195 ("rust-nix" ,rust-nix-0.15)
1196 ("rust-miow" ,rust-miow-0.3)
1197 ("rust-mio-anonymous-pipes" ,rust-mio-anonymous-pipes-0.1)
1198 ("rust-mio-named-pipes" ,rust-mio-named-pipes-0.1)
1199 ("rust-signal-hook" ,rust-signal-hook-0.1)
1200 ("rust-clipboard-win" ,rust-clipboard-win-2.1)
1201 ("rust-objc" ,rust-objc-0.2)
1202 ("rust-objc-id" ,rust-objc-id-0.1)
1203 ("rust-objc-foundation" ,rust-objc-foundation-0.1)
1204 ("rust-x11-clipboard" ,rust-x11-clipboard-0.4)
1205 ("rust-smithay-clipboard" ,rust-smithay-clipboard-0.3)
1206 ("rust-wayland-client" ,rust-wayland-client-0.23)
1207 ("rust-euclid" ,rust-euclid-0.20)
1208 ("rust-foreign-types" ,rust-foreign-types-0.5)
1209 ("rust-servo-fontconfig" ,rust-servo-fontconfig-0.4)
1210 ("rust-freetype-rs" ,rust-freetype-rs-0.23)
1211 ("rust-core-foundation" ,rust-core-foundation-0.6)
1212 ("rust-core-foundation-sys" ,rust-core-foundation-sys-0.6)
1213 ("rust-core-text" ,rust-core-text-13)
1214 ("rust-core-graphics" ,rust-core-graphics-0.17)
1215 ("rust-dwrote" ,rust-dwrote-0.9)
1216 ("rust-winpty-sys" ,rust-winpty-sys-0.4))
1217 #:cargo-development-inputs
1218 (("rust-rustc-tools-util" ,rust-rustc-tools-util-0.2)
1219 ("rust-gl-generator" ,rust-gl-generator-0.14)
1220 ("rust-andrew" ,rust-andrew-0.2)
1221 ("rust-smithay-client-toolkit" ,rust-smithay-client-toolkit-0.6)
1222 ("rust-embed-resource" ,rust-embed-resource-1.3)
1223 ("rust-http-req" ,rust-http-req-0.5)
1224 ("rust-zip" ,rust-zip-0.5)
1225 ("rust-tempfile" ,rust-tempfile-3.1)
1226 ("rust-named-pipe" ,rust-named-pipe-0.4)
1227 ("rust-winapi" ,rust-winapi-0.3))
1229 (modify-phases %standard-phases
1230 (add-after 'configure 'patch-glutin-libgl-path
1231 (lambda* (#:key inputs cargo-inputs vendor-dir #:allow-other-keys)
1232 (let* ((glutin-name ,(package-name rust-glutin-0.22))
1233 (glutin-version ,(package-version rust-glutin-0.22))
1236 glutin-name "-" glutin-version ".tar.gz/src/api/"))
1237 (mesa (assoc-ref inputs "mesa")))
1238 (substitute* (string-append vendor-dir "/" src-api "glx/mod.rs")
1239 (("libGL.so") (string-append mesa "/lib/libGL.so")))
1240 (substitute* (string-append vendor-dir "/" src-api "egl/mod.rs")
1241 (("libEGL.so") (string-append mesa "/lib/libEGL.so")))
1243 (add-after 'configure 'remove-alacritty-vendor
1244 (lambda* (#:key vendor-dir #:allow-other-keys)
1245 ;; We don't want Alacritty to be a dependency of itself
1246 ;; If we don't delete it from guix-vendor then build will fail
1247 ;; because Alacritty has a virtual workspace Cargo.toml.
1248 (delete-file-recursively
1249 (string-append vendor-dir "/alacritty-" ,version ".tar.xz"))
1252 (lambda* (#:key inputs outputs #:allow-other-keys)
1253 (let* ((out (assoc-ref outputs "out"))
1254 (share (string-append out "/share"))
1255 (icons (string-append share "/icons/hicolor/scalable/apps"))
1256 (tic (string-append (assoc-ref inputs "ncurses") "/bin/tic"))
1257 (man (string-append share "/man/man1"))
1258 (alacritty-bin "target/release/alacritty"))
1261 (install-file alacritty-bin (string-append out "/bin"))
1263 ;; Install man pages
1265 (copy-file "extra/alacritty.man"
1266 (string-append man "/alacritty.1"))
1268 ;; Install desktop file
1269 (install-file "extra/linux/alacritty.desktop"
1270 (string-append share "/applications"))
1274 (copy-file "extra/logo/alacritty-term.svg"
1275 (string-append icons "/Alacritty.svg"))
1278 (mkdir-p (string-append share "/terminfo"))
1279 ;; We don't compile alacritty-common entry because
1280 ;; it's being used only for inheritance.
1281 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1282 "-o" (string-append share "/terminfo/")
1283 "extra/alacritty.info")
1285 ;; Install completions
1287 "extra/completions/alacritty.bash"
1288 (string-append out "/etc/bash_completion.d"))
1290 "extra/completions/_alacritty"
1291 (string-append share "/zsh/site-functions"))
1293 "extra/completions/alacritty.fish"
1294 (string-append share "/fish/vendor_completions.d"))
1298 ("fontconfig" ,fontconfig)
1299 ("freetype" ,freetype)
1302 ("libxcursor" ,libxcursor)
1304 ("libxkbcommon" ,libxkbcommon)
1305 ("libxrandr" ,libxrandr)
1306 ("libxxf86vm" ,libxxf86vm)
1307 ("wayland" ,wayland)
1311 ("ncurses" ,ncurses)
1312 ("pkg-config" ,pkg-config)
1313 ("python3" ,python)))
1314 (home-page "https://github.com/alacritty/alacritty")
1315 (synopsis "GPU-accelerated terminal emulator")
1317 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1318 simplicity and performance. With such a strong focus on performance, included
1319 features are carefully considered and you can always expect Alacritty to be
1320 blazingly fast. By making sane choices for defaults, Alacritty requires no
1321 additional setup. However, it does allow configuration of many aspects of the
1322 terminal. Note that you need support for OpenGL 3.2 or higher.")
1323 (license license:asl2.0)))