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 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 wm)
57 #:use-module (gnu packages xdisorg)
58 #:use-module (gnu packages xml)
59 #:use-module (gnu packages xorg)
60 #:use-module (srfi srfi-26))
68 (uri (string-append "https://github.com/lanoxx/tilda/archive/"
69 "tilda-" version ".tar.gz"))
72 "1cc4qbg1m3i04lj5p6i6xbd0zvy1320pxdgmjhz5p3j95ibsbfki"))))
73 (build-system glib-or-gtk-build-system)
75 `(#:phases (modify-phases %standard-phases
76 (add-before 'patch-source-shebangs 'autogen
77 (lambda _ ; Avoid running ./configure.
78 (substitute* "autogen.sh"
79 (("^.*\\$srcdir/configure.*") ""))
80 (zero? (system* "sh" "autogen.sh")))))))
82 `(("autoconf" ,autoconf)
83 ("automake" ,automake)
84 ("gettext" ,gettext-minimal)
85 ("pkg-config" ,pkg-config)))
87 `(("libconfuse" ,libconfuse)
89 (synopsis "GTK+-based drop-down terminal")
90 (description "Tilda is a terminal emulator similar to normal terminals like
91 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
92 from the edge of a screen when a certain configurable hotkey is pressed. This
93 is similar to the built-in consoles in some applications. Tilda is highly
94 configurable through a graphical wizard.")
95 (home-page "https://github.com/lanoxx/tilda")
96 (license license:gpl2+)))
98 (define-public termite
106 (url (string-append "https://github.com/thestinger/"
108 (commit (string-append "v" version))
110 (file-name (string-append name "-" version "-checkout"))
113 "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj"))))
114 (build-system gnu-build-system)
117 (modify-phases %standard-phases
120 ;; This sets the destination when installing the necessary terminal
121 ;; capability data, which are not provided by 'ncurses'. See
122 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
123 #:make-flags (list "PREFIX="
124 (string-append "VERSION=v" (version))
125 (string-append "DESTDIR="
126 (assoc-ref %outputs "out")))))
130 ("ncurses", ncurses)))
132 `(("pkg-config" ,pkg-config)))
134 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
135 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
137 (list (search-path-specification
138 (variable "TERMINFO_DIRS")
139 (files '("share/terminfo")))))
140 (home-page "https://github.com/thestinger/termite/")
141 (synopsis "Keyboard-centric, VTE-based terminal")
142 (description "Termite is a minimal terminal emulator designed for use with
143 tiling window managers. It is a modal application, similar to Vim, with an
144 insert mode and command mode where keybindings have different functions.")
146 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
147 (license license:lgpl2.0+)))
149 (define-public asciinema
156 (uri (pypi-uri "asciinema" version))
159 "1jrf8c8711gkdilmvyv3d37kp8xfvdc5cqighw5k92a6g9z4acgv"))))
160 (build-system python-build-system)
163 (modify-phases %standard-phases
164 (add-before 'build 'patch-exec-paths
165 (lambda* (#:key inputs #:allow-other-keys)
166 (let ((ncurses (assoc-ref inputs "ncurses")))
167 (substitute* "asciinema/recorder.py"
169 (string-append "'" ncurses "/bin/tput'"))))
171 (inputs `(("ncurses" ,ncurses)))
174 `(("python-requests" ,python-requests)))
175 (home-page "https://asciinema.org")
176 (synopsis "Terminal session recorder")
178 "Use asciinema to record and share your terminal sessions, the right way.
179 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
180 text-based approach to terminal recording.")
181 (license license:gpl3)))
183 (define-public libtsm
190 "https://freedesktop.org/software/kmscon/releases/"
191 "libtsm-" version ".tar.xz"))
194 "01ygwrsxfii0pngfikgqsb4fxp8n1bbs47l7hck81h9b9bc1ah8i"))))
195 (build-system gnu-build-system)
197 `(("pkg-config" ,pkg-config)))
199 `(("libxkbcommon" ,libxkbcommon)))
200 (synopsis "Xterm state machine library")
201 (description "TSM is a state machine for DEC VT100-VT520 compatible
202 terminal emulators. It tries to support all common standards while keeping
203 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
204 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
205 ;; Hash table implementation is lgpl2.1+ licensed.
206 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
208 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
209 ;; under the bsd 2 license.
210 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2))))
212 (define-public kmscon
219 "https://freedesktop.org/software/kmscon/releases/"
220 "kmscon-" version ".tar.xz"))
223 "0axfwrp3c8f4gb67ap2sqnkn75idpiw09s35wwn6kgagvhf1rc0a"))
224 (modules '((guix build utils)))
226 ;; Use elogind instead of systemd.
228 (substitute* "configure"
229 (("libsystemd-daemon libsystemd-login")
231 (substitute* "src/uterm_systemd.c"
232 (("#include <systemd/sd-login.h>")
233 "#include <elogind/sd-login.h>")
234 ;; We don't have this header.
235 (("#include <systemd/sd-daemon\\.h>")
237 ;; Replace the call to 'sd_booted' by the truth value.
240 (build-system gnu-build-system)
242 `(("pkg-config" ,pkg-config)
243 ("libxslt" ,libxslt) ;to build the man page
244 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
245 ("docbook-xsl" ,docbook-xsl)))
249 ("libxkbcommon" ,libxkbcommon)
254 (synopsis "Linux KMS-based terminal emulator")
255 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
256 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
257 implementation with a user-space console. Compared to the Linux console,
258 kmscon provides enhanced features including XKB-compatible internationalized
259 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
260 multi-seat support, a replacement for @command{mingetty}, and more.")
261 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
262 ;; Hash table implementation is lgpl2.1+ licensed.
263 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
265 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
266 ;; under the bsd 2 license.
267 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
268 ;; under the terms of the GNU GPL.
269 (license (list license:expat license:lgpl2.1+ license:bsd-2
271 (supported-systems (filter (cut string-suffix? "-linux" <>)
272 %supported-systems))))
274 (define-public libtermkey
280 (uri (string-append "http://www.leonerd.org.uk/code/"
281 name "/" name "-" version ".tar.gz"))
283 (base32 "1xfj6lchhfljmbcl6dz8dpakppyy13nbl4ykxiv5x4dr9b4qf3bc"))))
284 (build-system gnu-build-system)
288 (string-append "PREFIX=" (assoc-ref %outputs "out")))
289 #:phases (modify-phases %standard-phases
291 #:test-target "test"))
292 (inputs `(("ncurses", ncurses)))
293 (native-inputs `(("libtool", libtool)
294 ("perl-test-harness" ,perl-test-harness)
295 ("pkg-config", pkg-config)))
296 (synopsis "Keyboard entry processing library for terminal-based programs")
298 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
299 combining, and so on, with a simple interface.")
300 (home-page "http://www.leonerd.org.uk/code/libtermkey")
301 (license license:expat)))
303 (define-public picocom
310 "https://github.com/npat-efault/picocom"
311 "/archive/" version ".tar.gz"))
312 (file-name (string-append name "-" version ".tar.gz"))
315 "1knl6dglnrynx1fhy21nylw56i1q3dkizkgxzkq42mb7ilah8f9y"))))
316 (build-system gnu-build-system)
318 `(#:make-flags '("CC=gcc")
319 #:tests? #f ; No tests
321 (modify-phases %standard-phases
324 (lambda* (#:key outputs #:allow-other-keys)
325 (let* ((out (assoc-ref outputs "out"))
326 (bin (string-append out "/bin"))
327 (man (string-append out "/share/man/man1")))
328 (install-file "picocom" bin)
329 (install-file "picocom.1" man)))))))
330 (home-page "https://github.com/npat-efault/picocom")
331 (synopsis "Minimal dumb-terminal emulation program")
332 (description "It was designed to serve as a simple, manual, modem
333 configuration, testing, and debugging tool. It has also serves well
334 as a low-tech serial communications program to allow access to all
335 types of devices that provide serial consoles.")
336 (license license:gpl2+)))
344 (uri (string-append "http://www.johnath.com/" name "/"
345 name "-" version ".tar.gz"))
348 "0bgch6jq5cahakk3kbr9549iysf2dik09afixxy5brbxk1xfzb2r"))))
349 (build-system gnu-build-system)
351 `(#:tests? #f ; no tests.
353 (modify-phases %standard-phases
355 (add-after 'unpack 'patch-makefile
356 (lambda* (#:key outputs #:allow-other-keys)
357 (substitute* "Makefile" (("/usr") (assoc-ref outputs "out")))
359 (add-before 'install 'create-output-directories
360 (lambda* (#:key outputs #:allow-other-keys)
361 (let ((out (assoc-ref %outputs "out")))
362 (mkdir-p (string-append out "/bin"))
363 (mkdir-p (string-append out "/man/man1"))))))))
364 (synopsis "Linux command-line utility to control the PC speaker")
365 (description "beep allows the user to control the PC speaker with precision,
366 allowing different sounds to indicate different events. While it can be run
367 quite happily on the command line, its intended place of residence is within
368 scripts, notifying the user when something interesting occurs. Of course, it
369 has no notion of what's interesing, but it's very good at that notifying part.")
370 (home-page "http://www.johnath.com/beep")
371 (license license:gpl2+)))
373 (define-public unibilium
380 (uri (string-append "https://github.com/mauke/unibilium/"
381 "archive/v" version ".tar.gz"))
382 (file-name (string-append name "-" version ".tar.gz"))
385 "1n7a0jrlwhn9nnkna76sbnjrr808m0pmzbiwznmp7rhmjl4z2fk2"))))
386 (build-system gnu-build-system)
390 (string-append "PREFIX=" (assoc-ref %outputs "out")))
392 ;; FIXME: tests require "prove"
395 (modify-phases %standard-phases
396 (delete 'configure))))
398 `(("libtool" ,libtool)))
399 (home-page "https://github.com/mauke/unibilium")
400 (synopsis "Terminfo parsing library")
401 (description "Unibilium is a basic C terminfo library. It doesn't depend
402 on curses or any other library. It also doesn't use global variables, so it
403 should be thread-safe.")
404 (license license:lgpl3+)))
406 (define-public libvterm
413 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
414 "libvterm-" version ".tar.gz"))
417 "1s56c8p1qz6frkcri0hg4qyydv2wcccj6n2xmz1dwcdqn38ldsmb"))))
418 (build-system gnu-build-system)
422 (string-append "PREFIX=" (assoc-ref %outputs "out")))
425 (modify-phases %standard-phases
426 (delete 'configure))))
428 `(("libtool" ,libtool)
430 (home-page "http://www.leonerd.org.uk/code/libvterm/")
431 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
432 (description "Libvterm is an abstract C99 library which implements a VT220
433 or xterm-like terminal emulator. It doesn't use any particular graphics
434 toolkit or output system, instead it invokes callback function pointers that
435 its embedding program should provide it to draw on its behalf. It avoids
436 calling @code{malloc} during normal running state, allowing it to be used in
437 embedded kernel situations.")
438 (license license:expat)))
440 (define-public cool-retro-term
441 (let ((commit "e48719fa44e5307df71dbd0fad234f8a6a53f863")
444 (name "cool-retro-term")
445 (version (string-append "1.0.0-" revision "." (string-take commit 7)))
448 (file-name (string-append name "-" version "-checkout"))
450 (url (string-append "https://github.com/Swordfish90/" name))
454 (base32 "1sgqbirninkvgwchr35zgn5vzqvsmrf3cp7lqady1xgrawb8lsz3"))
456 (search-patches "cool-retro-term-remove-non-free-fonts.patch"
457 "cool-retro-term-fix-array-size.patch"
458 "cool-retro-term-dont-check-uninit-member.patch"
459 "cool-retro-term-memory-leak-1.patch"))
460 (modules '((guix build utils)))
462 '(for-each (lambda (font)
463 (delete-file-recursively
464 (string-append "app/qml/fonts/" font))
465 (substitute* '("app/qml/resources.qrc")
466 (((string-append "<file>fonts/" font ".*"))
468 '(;"1971-ibm-3278" ; BSD 3-clause
469 "1977-apple2" ; Non-Free
470 "1977-commodore-pet" ; Non-Free
471 "1979-atari-400-800" ; Non-Free
472 "1982-commodore64" ; Non-Free
474 "1985-ibm-pc-vga" ; Unclear
475 ;"modern-fixedsys-excelsior" ; Redistributable
476 ;"modern-hermit" ; SIL
477 ;"modern-inconsolata"; SIL
478 ;"modern-pro-font-win-tweaked" ; X11
479 ;"modern-proggy-tiny"; X11
480 ;"modern-terminus" ; SIL
481 "modern-monaco"))))) ; Apple non-free
482 (build-system gnu-build-system)
485 ("qtdeclarative" ,qtdeclarative)
486 ("qtgraphicaleffects" ,qtgraphicaleffects)
487 ("qtquickcontrols" ,qtquickcontrols)))
490 (modify-phases %standard-phases
492 (lambda* (#:key outputs #:allow-other-keys)
493 (let* ((out (assoc-ref outputs "out"))
494 (share (string-append out "/share")))
495 (substitute* '("qmltermwidget/qmltermwidget.pro")
496 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
497 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
498 (substitute* '("app/app.pro")
499 (("target.path \\+= /usr")
500 (string-append "target.path += " out))
501 (("icon32.path = /usr/share")
502 (string-append "icon32.path = " share))
503 (("icon64.path = /usr/share")
504 (string-append "icon64.path = " share))
505 (("icon128.path = /usr/share")
506 (string-append "icon128.path = " share))
507 (("icon256.path = /usr/share")
508 (string-append "icon256.path = " share)))
509 (zero? (system* "qmake")))))
510 (add-before 'install 'fix-Makefiles
511 (lambda* (#:key outputs #:allow-other-keys)
512 (let* ((out (assoc-ref outputs "out")))
513 (substitute* '("Makefile")
514 (("\\$\\(INSTALL_ROOT\\)/usr") out)))))
515 (add-after 'install 'wrap-executable
516 (lambda* (#:key inputs outputs #:allow-other-keys)
517 (let* ((out (assoc-ref outputs "out"))
518 (qml "/lib/qt5/qml"))
519 (wrap-program (string-append out "/bin/cool-retro-term")
520 `("QML2_IMPORT_PATH" ":" prefix
521 (,(string-append out qml)
523 (assoc-ref inputs "qtdeclarative") qml)
525 (assoc-ref inputs "qtgraphicaleffects") qml)
527 (assoc-ref inputs "qtquickcontrols") qml)))))))
528 (add-after 'install 'add-alternate-name
529 (lambda* (#:key outputs #:allow-other-keys)
530 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
531 (symlink (string-append bin "/cool-retro-term")
532 (string-append bin "/crt"))))))))
533 (synopsis "Terminal emulator")
535 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
536 feel of the old cathode ray tube (CRT) screens. It has been designed to be
537 eye-candy, customizable, and reasonably lightweight.")
538 (home-page "https://github.com/Swordfish90/cool-retro-term")
540 license:gpl2+ ; qmltermwidget
541 license:gpl3+ ; cool-retro-term
547 (define-public sakura
553 (uri (string-append "https://launchpad.net/" name "/trunk/"
554 version "/+download/" name "-" version
558 "0fhcn3540iw22l5zg3njh5z8cj0g2n9p6fvagjqa5zc323jfsc7b"))))
559 (build-system cmake-build-system)
564 `(("gettext" ,gettext-minimal)
565 ("perl" ,perl) ; for pod2man
566 ("pkg-config" ,pkg-config)))
570 (home-page "https://launchpad.net/sakura")
571 (synopsis "A simple but powerful libvte-based terminal emulator")
572 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
573 It's a terminal emulator with few dependencies, so you don't need a full GNOME
574 desktop installed to have a decent terminal emulator.")
575 (license license:gpl2)))
577 (define-public go-golang.org-x-crypto-ssh-terminal
578 (let ((commit "c78caca803c95773f48a844d3dcab04b9bc4d6dd")
581 (name "go-golang.org-x-crypto-ssh-terminal")
582 (version (git-version "0.0.0" revision commit))
586 (url "https://go.googlesource.com/crypto")
588 (file-name (git-file-name name version))
591 "0vxlfxr9y681yn2cfh6dbqmq35vvq4f45ay0mm31ffkny9cms0y4"))))
592 (build-system go-build-system)
594 '(#:import-path "golang.org/x/crypto/ssh/terminal"
595 #:unpack-path "golang.org/x/crypto"
597 (modify-phases %standard-phases
598 (add-before 'reset-gzip-timestamps 'make-gzip-archive-writable
599 (lambda* (#:key outputs #:allow-other-keys)
601 (make-file-writable file))
603 (string-append (assoc-ref outputs "out")
604 "/src/golang.org/x/crypto/ed25519/testdata")
607 (synopsis "Support functions for dealing with terminals in Go")
608 (description "@code{terminal} provides support functions for dealing
609 with terminals in Go.")
610 (home-page "https://go.googlesource.com/crypto/")
611 (license license:bsd-3))))