1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
3 ;;; Copyright © 2016 Mckinley Olsen <mck.olsen@gmail.com>
4 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
5 ;;; Copyright © 2016 David Craven <david@craven.ch>
6 ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
8 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
10 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages terminals)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix build utils)
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system glib-or-gtk)
34 #:use-module (guix build-system go)
35 #:use-module (guix build-system python)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix packages)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages docbook)
42 #:use-module (gnu packages freedesktop)
43 #:use-module (gnu packages gettext)
44 #:use-module (gnu packages gl)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnome)
47 #:use-module (gnu packages gtk)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages perl-check)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages python-web)
55 #:use-module (gnu packages qt)
56 #:use-module (gnu packages textutils)
57 #:use-module (gnu packages wm)
58 #:use-module (gnu packages xdisorg)
59 #:use-module (gnu packages xml)
60 #:use-module (gnu packages xorg)
61 #:use-module (srfi srfi-26))
69 (uri (string-append "https://github.com/lanoxx/tilda/archive/"
70 "tilda-" version ".tar.gz"))
73 "1cc4qbg1m3i04lj5p6i6xbd0zvy1320pxdgmjhz5p3j95ibsbfki"))))
74 (build-system glib-or-gtk-build-system)
76 `(#:phases (modify-phases %standard-phases
77 (add-before 'patch-source-shebangs 'autogen
78 (lambda _ ; Avoid running ./configure.
79 (substitute* "autogen.sh"
80 (("^.*\\$srcdir/configure.*") ""))
81 (zero? (system* "sh" "autogen.sh")))))))
83 `(("autoconf" ,autoconf)
84 ("automake" ,automake)
85 ("gettext" ,gettext-minimal)
86 ("pkg-config" ,pkg-config)))
88 `(("libconfuse" ,libconfuse)
90 (synopsis "GTK+-based drop-down terminal")
91 (description "Tilda is a terminal emulator similar to normal terminals like
92 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
93 from the edge of a screen when a certain configurable hotkey is pressed. This
94 is similar to the built-in consoles in some applications. Tilda is highly
95 configurable through a graphical wizard.")
96 (home-page "https://github.com/lanoxx/tilda")
97 (license license:gpl2+)))
99 (define-public termite
107 (url (string-append "https://github.com/thestinger/"
109 (commit (string-append "v" version))
111 (file-name (string-append name "-" version "-checkout"))
114 "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj"))))
115 (build-system gnu-build-system)
118 (modify-phases %standard-phases
121 ;; This sets the destination when installing the necessary terminal
122 ;; capability data, which are not provided by 'ncurses'. See
123 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
124 #:make-flags (list "PREFIX="
125 (string-append "VERSION=v" (version))
126 (string-append "DESTDIR="
127 (assoc-ref %outputs "out")))))
131 ("ncurses", ncurses)))
133 `(("pkg-config" ,pkg-config)))
135 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
136 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
138 (list (search-path-specification
139 (variable "TERMINFO_DIRS")
140 (files '("share/terminfo")))))
141 (home-page "https://github.com/thestinger/termite/")
142 (synopsis "Keyboard-centric, VTE-based terminal")
143 (description "Termite is a minimal terminal emulator designed for use with
144 tiling window managers. It is a modal application, similar to Vim, with an
145 insert mode and command mode where keybindings have different functions.")
147 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
148 (license license:lgpl2.0+)))
150 (define-public asciinema
157 (uri (pypi-uri "asciinema" version))
160 "1jrf8c8711gkdilmvyv3d37kp8xfvdc5cqighw5k92a6g9z4acgv"))))
161 (build-system python-build-system)
164 (modify-phases %standard-phases
165 (add-before 'build 'patch-exec-paths
166 (lambda* (#:key inputs #:allow-other-keys)
167 (let ((ncurses (assoc-ref inputs "ncurses")))
168 (substitute* "asciinema/recorder.py"
170 (string-append "'" ncurses "/bin/tput'"))))
172 (inputs `(("ncurses" ,ncurses)))
175 `(("python-requests" ,python-requests)))
176 (home-page "https://asciinema.org")
177 (synopsis "Terminal session recorder")
179 "Use asciinema to record and share your terminal sessions, the right way.
180 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
181 text-based approach to terminal recording.")
182 (license license:gpl3)))
184 (define-public libtsm
191 "https://freedesktop.org/software/kmscon/releases/"
192 "libtsm-" version ".tar.xz"))
195 "01ygwrsxfii0pngfikgqsb4fxp8n1bbs47l7hck81h9b9bc1ah8i"))))
196 (build-system gnu-build-system)
198 `(("pkg-config" ,pkg-config)))
200 `(("libxkbcommon" ,libxkbcommon)))
201 (synopsis "Xterm state machine library")
202 (description "TSM is a state machine for DEC VT100-VT520 compatible
203 terminal emulators. It tries to support all common standards while keeping
204 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
205 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
206 ;; Hash table implementation is lgpl2.1+ licensed.
207 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
209 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
210 ;; under the bsd 2 license.
211 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2))))
213 (define-public kmscon
220 "https://freedesktop.org/software/kmscon/releases/"
221 "kmscon-" version ".tar.xz"))
224 "0axfwrp3c8f4gb67ap2sqnkn75idpiw09s35wwn6kgagvhf1rc0a"))
225 (modules '((guix build utils)))
227 ;; Use elogind instead of systemd.
229 (substitute* "configure"
230 (("libsystemd-daemon libsystemd-login")
232 (substitute* "src/uterm_systemd.c"
233 (("#include <systemd/sd-login.h>")
234 "#include <elogind/sd-login.h>")
235 ;; We don't have this header.
236 (("#include <systemd/sd-daemon\\.h>")
238 ;; Replace the call to 'sd_booted' by the truth value.
241 (build-system gnu-build-system)
243 `(("pkg-config" ,pkg-config)
244 ("libxslt" ,libxslt) ;to build the man page
245 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
246 ("docbook-xsl" ,docbook-xsl)))
250 ("libxkbcommon" ,libxkbcommon)
255 (synopsis "Linux KMS-based terminal emulator")
256 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
257 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
258 implementation with a user-space console. Compared to the Linux console,
259 kmscon provides enhanced features including XKB-compatible internationalized
260 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
261 multi-seat support, a replacement for @command{mingetty}, and more.")
262 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
263 ;; Hash table implementation is lgpl2.1+ licensed.
264 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
266 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
267 ;; under the bsd 2 license.
268 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
269 ;; under the terms of the GNU GPL.
270 (license (list license:expat license:lgpl2.1+ license:bsd-2
272 (supported-systems (filter (cut string-suffix? "-linux" <>)
273 %supported-systems))))
275 (define-public libtermkey
281 (uri (string-append "http://www.leonerd.org.uk/code/"
282 name "/" name "-" version ".tar.gz"))
284 (base32 "1xfj6lchhfljmbcl6dz8dpakppyy13nbl4ykxiv5x4dr9b4qf3bc"))))
285 (build-system gnu-build-system)
289 (string-append "PREFIX=" (assoc-ref %outputs "out")))
290 #:phases (modify-phases %standard-phases
292 #:test-target "test"))
293 (inputs `(("ncurses", ncurses)))
294 (native-inputs `(("libtool", libtool)
295 ("perl-test-harness" ,perl-test-harness)
296 ("pkg-config", pkg-config)))
297 (synopsis "Keyboard entry processing library for terminal-based programs")
299 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
300 combining, and so on, with a simple interface.")
301 (home-page "http://www.leonerd.org.uk/code/libtermkey")
302 (license license:expat)))
304 (define-public picocom
311 "https://github.com/npat-efault/picocom"
312 "/archive/" version ".tar.gz"))
313 (file-name (string-append name "-" version ".tar.gz"))
316 "1knl6dglnrynx1fhy21nylw56i1q3dkizkgxzkq42mb7ilah8f9y"))))
317 (build-system gnu-build-system)
319 `(#:make-flags '("CC=gcc")
320 #:tests? #f ; No tests
322 (modify-phases %standard-phases
325 (lambda* (#:key outputs #:allow-other-keys)
326 (let* ((out (assoc-ref outputs "out"))
327 (bin (string-append out "/bin"))
328 (man (string-append out "/share/man/man1")))
329 (install-file "picocom" bin)
330 (install-file "picocom.1" man)))))))
331 (home-page "https://github.com/npat-efault/picocom")
332 (synopsis "Minimal dumb-terminal emulation program")
333 (description "It was designed to serve as a simple, manual, modem
334 configuration, testing, and debugging tool. It has also serves well
335 as a low-tech serial communications program to allow access to all
336 types of devices that provide serial consoles.")
337 (license license:gpl2+)))
345 (uri (string-append "http://www.johnath.com/" name "/"
346 name "-" version ".tar.gz"))
349 "0bgch6jq5cahakk3kbr9549iysf2dik09afixxy5brbxk1xfzb2r"))))
350 (build-system gnu-build-system)
352 `(#:tests? #f ; no tests.
354 (modify-phases %standard-phases
356 (add-after 'unpack 'patch-makefile
357 (lambda* (#:key outputs #:allow-other-keys)
358 (substitute* "Makefile" (("/usr") (assoc-ref outputs "out")))
360 (add-before 'install 'create-output-directories
361 (lambda* (#:key outputs #:allow-other-keys)
362 (let ((out (assoc-ref %outputs "out")))
363 (mkdir-p (string-append out "/bin"))
364 (mkdir-p (string-append out "/man/man1"))))))))
365 (synopsis "Linux command-line utility to control the PC speaker")
366 (description "beep allows the user to control the PC speaker with precision,
367 allowing different sounds to indicate different events. While it can be run
368 quite happily on the command line, its intended place of residence is within
369 scripts, notifying the user when something interesting occurs. Of course, it
370 has no notion of what's interesing, but it's very good at that notifying part.")
371 (home-page "http://www.johnath.com/beep")
372 (license license:gpl2+)))
374 (define-public unibilium
381 (uri (string-append "https://github.com/mauke/unibilium/"
382 "archive/v" version ".tar.gz"))
383 (file-name (string-append name "-" version ".tar.gz"))
386 "1hbf011d8nzsp7c96fidjiq8yw8zlxf6f1s050ii2yyampvb8ib0"))))
387 (build-system gnu-build-system)
391 (string-append "PREFIX=" (assoc-ref %outputs "out")))
393 ;; FIXME: tests require "prove"
396 (modify-phases %standard-phases
397 (delete 'configure))))
399 `(("libtool" ,libtool)))
400 (home-page "https://github.com/mauke/unibilium")
401 (synopsis "Terminfo parsing library")
402 (description "Unibilium is a basic C terminfo library. It doesn't depend
403 on curses or any other library. It also doesn't use global variables, so it
404 should be thread-safe.")
405 (license license:lgpl3+)))
407 (define-public libvterm
414 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
415 "libvterm-" version ".tar.gz"))
418 "1s56c8p1qz6frkcri0hg4qyydv2wcccj6n2xmz1dwcdqn38ldsmb"))))
419 (build-system gnu-build-system)
423 (string-append "PREFIX=" (assoc-ref %outputs "out")))
426 (modify-phases %standard-phases
427 (delete 'configure))))
429 `(("libtool" ,libtool)
431 (home-page "http://www.leonerd.org.uk/code/libvterm/")
432 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
433 (description "Libvterm is an abstract C99 library which implements a VT220
434 or xterm-like terminal emulator. It doesn't use any particular graphics
435 toolkit or output system, instead it invokes callback function pointers that
436 its embedding program should provide it to draw on its behalf. It avoids
437 calling @code{malloc} during normal running state, allowing it to be used in
438 embedded kernel situations.")
439 (license license:expat)))
441 (define-public cool-retro-term
442 (let ((commit "e48719fa44e5307df71dbd0fad234f8a6a53f863")
445 (name "cool-retro-term")
446 (version (string-append "1.0.0-" revision "." (string-take commit 7)))
449 (file-name (string-append name "-" version "-checkout"))
451 (url (string-append "https://github.com/Swordfish90/" name))
455 (base32 "1sgqbirninkvgwchr35zgn5vzqvsmrf3cp7lqady1xgrawb8lsz3"))
457 (search-patches "cool-retro-term-remove-non-free-fonts.patch"
458 "cool-retro-term-fix-array-size.patch"
459 "cool-retro-term-dont-check-uninit-member.patch"
460 "cool-retro-term-memory-leak-1.patch"))
461 (modules '((guix build utils)))
463 '(for-each (lambda (font)
464 (delete-file-recursively
465 (string-append "app/qml/fonts/" font))
466 (substitute* '("app/qml/resources.qrc")
467 (((string-append "<file>fonts/" font ".*"))
469 '(;"1971-ibm-3278" ; BSD 3-clause
470 "1977-apple2" ; Non-Free
471 "1977-commodore-pet" ; Non-Free
472 "1979-atari-400-800" ; Non-Free
473 "1982-commodore64" ; Non-Free
475 "1985-ibm-pc-vga" ; Unclear
476 ;"modern-fixedsys-excelsior" ; Redistributable
477 ;"modern-hermit" ; SIL
478 ;"modern-inconsolata"; SIL
479 ;"modern-pro-font-win-tweaked" ; X11
480 ;"modern-proggy-tiny"; X11
481 ;"modern-terminus" ; SIL
482 "modern-monaco"))))) ; Apple non-free
483 (build-system gnu-build-system)
486 ("qtdeclarative" ,qtdeclarative)
487 ("qtgraphicaleffects" ,qtgraphicaleffects)
488 ("qtquickcontrols" ,qtquickcontrols)))
491 (modify-phases %standard-phases
493 (lambda* (#:key outputs #:allow-other-keys)
494 (let* ((out (assoc-ref outputs "out"))
495 (share (string-append out "/share")))
496 (substitute* '("qmltermwidget/qmltermwidget.pro")
497 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
498 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
499 (substitute* '("app/app.pro")
500 (("target.path \\+= /usr")
501 (string-append "target.path += " out))
502 (("icon32.path = /usr/share")
503 (string-append "icon32.path = " share))
504 (("icon64.path = /usr/share")
505 (string-append "icon64.path = " share))
506 (("icon128.path = /usr/share")
507 (string-append "icon128.path = " share))
508 (("icon256.path = /usr/share")
509 (string-append "icon256.path = " share)))
510 (zero? (system* "qmake")))))
511 (add-before 'install 'fix-Makefiles
512 (lambda* (#:key outputs #:allow-other-keys)
513 (let* ((out (assoc-ref outputs "out")))
514 (substitute* '("Makefile")
515 (("\\$\\(INSTALL_ROOT\\)/usr") out)))))
516 (add-after 'install 'wrap-executable
517 (lambda* (#:key inputs outputs #:allow-other-keys)
518 (let* ((out (assoc-ref outputs "out"))
519 (qml "/lib/qt5/qml"))
520 (wrap-program (string-append out "/bin/cool-retro-term")
521 `("QML2_IMPORT_PATH" ":" prefix
522 (,(string-append out qml)
524 (assoc-ref inputs "qtdeclarative") qml)
526 (assoc-ref inputs "qtgraphicaleffects") qml)
528 (assoc-ref inputs "qtquickcontrols") qml)))))))
529 (add-after 'install 'add-alternate-name
530 (lambda* (#:key outputs #:allow-other-keys)
531 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
532 (symlink (string-append bin "/cool-retro-term")
533 (string-append bin "/crt"))))))))
534 (synopsis "Terminal emulator")
536 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
537 feel of the old cathode ray tube (CRT) screens. It has been designed to be
538 eye-candy, customizable, and reasonably lightweight.")
539 (home-page "https://github.com/Swordfish90/cool-retro-term")
541 license:gpl2+ ; qmltermwidget
542 license:gpl3+ ; cool-retro-term
548 (define-public sakura
554 (uri (string-append "https://launchpad.net/" name "/trunk/"
555 version "/+download/" name "-" version
559 "0fhcn3540iw22l5zg3njh5z8cj0g2n9p6fvagjqa5zc323jfsc7b"))))
560 (build-system cmake-build-system)
565 `(("gettext" ,gettext-minimal)
566 ("perl" ,perl) ; for pod2man
567 ("pkg-config" ,pkg-config)))
571 (home-page "https://launchpad.net/sakura")
572 (synopsis "A simple but powerful libvte-based terminal emulator")
573 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
574 It's a terminal emulator with few dependencies, so you don't need a full GNOME
575 desktop installed to have a decent terminal emulator.")
576 (license license:gpl2)))
578 (define-public go-github.com-nsf-termbox-go
579 (let ((commit "4ed959e0540971545eddb8c75514973d670cf739")
582 (name "go-github.com-nsf-termbox-go")
583 (version (git-version "0.0.0" revision commit))
587 (url "https://github.com/nsf/termbox-go.git")
589 (file-name (git-file-name name version))
592 "1vx64i1mg660if3wwm81p4b7lzxfb3qbr39i7misdyld3fc486p9"))))
593 (build-system go-build-system)
595 '(#:import-path "github.com/nsf/termbox-go"))
597 `(("go-github.com-mattn-go-runewidth"
598 ,go-github.com-mattn-go-runewidth)))
599 (synopsis "@code{termbox} provides a minimal API for text-based user
602 "Termbox is a library that provides a minimalistic API which allows the
603 programmer to write text-based user interfaces.")
604 (home-page "https://github.com/nsf/termbox-go")
605 (license license:expat))))
607 (define-public go-golang.org-x-crypto-ssh-terminal
608 (let ((commit "c78caca803c95773f48a844d3dcab04b9bc4d6dd")
611 (name "go-golang.org-x-crypto-ssh-terminal")
612 (version (git-version "0.0.0" revision commit))
616 (url "https://go.googlesource.com/crypto")
618 (file-name (git-file-name name version))
621 "0vxlfxr9y681yn2cfh6dbqmq35vvq4f45ay0mm31ffkny9cms0y4"))))
622 (build-system go-build-system)
624 '(#:import-path "golang.org/x/crypto/ssh/terminal"
625 #:unpack-path "golang.org/x/crypto"
627 (modify-phases %standard-phases
628 (add-before 'reset-gzip-timestamps 'make-gzip-archive-writable
629 (lambda* (#:key outputs #:allow-other-keys)
631 (make-file-writable file))
633 (string-append (assoc-ref outputs "out")
634 "/src/golang.org/x/crypto/ed25519/testdata")
637 (synopsis "Support functions for dealing with terminals in Go")
638 (description "@code{terminal} provides support functions for dealing
639 with terminals in Go.")
640 (home-page "https://go.googlesource.com/crypto/")
641 (license license:bsd-3))))
643 (define-public go-github.com-howeyc-gopass
644 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
647 (name "go-github.com-howeyc-gopass")
648 (version (git-version "0.0.0" revision commit))
652 (url "https://github.com/howeyc/gopass.git")
654 (file-name (git-file-name name version))
657 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
658 (build-system go-build-system)
660 '(#:import-path "github.com/howeyc/gopass"))
662 `(("go-golang.org-x-crypto-ssh-terminal"
663 ,go-golang.org-x-crypto-ssh-terminal)))
664 (synopsis "Retrieve password from a terminal or piped input in Go")
666 "@code{gopass} is a Go package for retrieving a password from user
667 terminal or piped input.")
668 (home-page "https://github.com/howeyc/gopass")
669 (license license:isc))))