1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 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 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 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages terminals)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix build utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system python)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix packages)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages freedesktop)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages gl)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gnome)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages wm)
48 #:use-module (gnu packages ncurses)
49 #:use-module (gnu packages gtk)
50 #:use-module (gnu packages gnome)
51 #:use-module (gnu packages xdisorg)
52 #:use-module (gnu packages xml)
53 #:use-module (gnu packages docbook)
54 #:use-module (gnu packages qt)
55 #:use-module (srfi srfi-26))
63 (uri (string-append "https://github.com/lanoxx/tilda/archive/"
64 "tilda-" version ".tar.gz"))
67 "1cc4qbg1m3i04lj5p6i6xbd0zvy1320pxdgmjhz5p3j95ibsbfki"))))
68 (build-system gnu-build-system)
70 `(#:phases (modify-phases %standard-phases
71 (add-before 'patch-source-shebangs 'autogen
72 (lambda _ ; Avoid running ./configure.
73 (substitute* "autogen.sh"
74 (("^.*\\$srcdir/configure.*") ""))
75 (zero? (system* "sh" "autogen.sh")))))))
77 `(("autoconf" ,autoconf)
78 ("automake" ,automake)
79 ("gettext" ,gettext-minimal)
80 ("pkg-config" ,pkg-config)))
82 `(("glib" ,glib "bin")
84 ("libconfuse" ,libconfuse)
86 (synopsis "GTK+-based drop-down terminal")
87 (description "Tilda is a terminal emulator similar to normal terminals like
88 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
89 from the edge of a screen when a certain configurable hotkey is pressed. This
90 is similar to the built-in consoles in some applications. Tilda is highly
91 configurable through a graphical wizard.")
92 (home-page "https://github.com/lanoxx/tilda")
93 (license license:gpl2+)))
95 (define-public termite
103 (url (string-append "https://github.com/thestinger/"
105 (commit (string-append "v" version))
107 (file-name (string-append name "-" version "-checkout"))
110 "0s6dyg3vcqk5qcx90bs24wdnd3p56rdjdcanx4pcxvp6ksjl61jz"))))
111 (build-system gnu-build-system)
114 (modify-phases %standard-phases
117 ;; This sets the destination when installing the necessary terminal
118 ;; capability data, which are not provided by 'ncurses'. See
119 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
120 #:make-flags (list "PREFIX="
121 (string-append "VERSION=v" (version))
122 (string-append "DESTDIR="
123 (assoc-ref %outputs "out")))))
127 ("ncurses", ncurses)))
129 `(("pkg-config" ,pkg-config)))
131 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
132 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
134 (list (search-path-specification
135 (variable "TERMINFO_DIRS")
136 (files '("share/terminfo")))))
137 (home-page "https://github.com/thestinger/termite/")
138 (synopsis "Keyboard-centric, VTE-based terminal")
139 (description "Termite is a minimal terminal emulator designed for use with
140 tiling window managers. It is a modal application, similar to Vim, with an
141 insert mode and command mode where keybindings have different functions.")
143 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
144 (license license:lgpl2.0+)))
146 (define-public asciinema
153 (uri (pypi-uri "asciinema" version))
156 "1jrf8c8711gkdilmvyv3d37kp8xfvdc5cqighw5k92a6g9z4acgv"))))
157 (build-system python-build-system)
160 (modify-phases %standard-phases
161 (add-before 'build 'patch-exec-paths
162 (lambda* (#:key inputs #:allow-other-keys)
163 (let ((ncurses (assoc-ref inputs "ncurses")))
164 (substitute* "asciinema/recorder.py"
166 (string-append "'" ncurses "/bin/tput'"))))
168 (inputs `(("ncurses" ,ncurses)))
171 `(("python-requests" ,python-requests)))
172 (home-page "https://asciinema.org")
173 (synopsis "Terminal session recorder")
175 "Use asciinema to record and share your terminal sessions, the right way.
176 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
177 text-based approach to terminal recording.")
178 (license license:gpl3)))
180 (define-public libtsm
187 "https://freedesktop.org/software/kmscon/releases/"
188 "libtsm-" version ".tar.xz"))
191 "01ygwrsxfii0pngfikgqsb4fxp8n1bbs47l7hck81h9b9bc1ah8i"))))
192 (build-system gnu-build-system)
194 `(("pkg-config" ,pkg-config)))
196 `(("libxkbcommon" ,libxkbcommon)))
197 (synopsis "Xterm state machine library")
198 (description "TSM is a state machine for DEC VT100-VT520 compatible
199 terminal emulators. It tries to support all common standards while keeping
200 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
201 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
202 ;; Hash table implementation is lgpl2.1+ licensed.
203 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
205 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
206 ;; under the bsd 2 license.
207 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2))))
209 (define-public kmscon
216 "https://freedesktop.org/software/kmscon/releases/"
217 "kmscon-" version ".tar.xz"))
220 "0axfwrp3c8f4gb67ap2sqnkn75idpiw09s35wwn6kgagvhf1rc0a"))
221 (modules '((guix build utils)))
223 ;; Use elogind instead of systemd.
225 (substitute* "configure"
226 (("libsystemd-daemon libsystemd-login")
228 (substitute* "src/uterm_systemd.c"
229 (("#include <systemd/sd-login.h>")
230 "#include <elogind/sd-login.h>")
231 ;; We don't have this header.
232 (("#include <systemd/sd-daemon\\.h>")
234 ;; Replace the call to 'sd_booted' by the truth value.
237 (build-system gnu-build-system)
239 `(("pkg-config" ,pkg-config)
240 ("libxslt" ,libxslt) ;to build the man page
241 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
242 ("docbook-xsl" ,docbook-xsl)))
246 ("libxkbcommon" ,libxkbcommon)
251 (synopsis "Linux KMS-based terminal emulator")
252 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
253 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
254 implementation with a user-space console. Compared to the Linux console,
255 kmscon provides enhanced features including XKB-compatible internationalized
256 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
257 multi-seat support, a replacement for @command{mingetty}, and more.")
258 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
259 ;; Hash table implementation is lgpl2.1+ licensed.
260 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
262 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
263 ;; under the bsd 2 license.
264 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
265 ;; under the terms of the GNU GPL.
266 (license (list license:expat license:lgpl2.1+ license:bsd-2
268 (supported-systems (filter (cut string-suffix? "-linux" <>)
269 %supported-systems))))
271 (define-public libtermkey
277 (uri (string-append "http://www.leonerd.org.uk/code/"
278 name "/" name "-" version ".tar.gz"))
280 (base32 "1xfj6lchhfljmbcl6dz8dpakppyy13nbl4ykxiv5x4dr9b4qf3bc"))))
281 (build-system gnu-build-system)
285 (string-append "PREFIX=" (assoc-ref %outputs "out")))
286 #:phases (modify-phases %standard-phases
288 #:test-target "test"))
289 (inputs `(("ncurses", ncurses)))
290 (native-inputs `(("libtool", libtool)
291 ("perl-test-harness" ,perl-test-harness)
292 ("pkg-config", pkg-config)))
293 (synopsis "Keyboard entry processing library for terminal-based programs")
295 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
296 combining, and so on, with a simple interface.")
297 (home-page "http://www.leonerd.org.uk/code/libtermkey")
298 (license license:expat)))
300 (define-public picocom
307 "https://github.com/npat-efault/picocom"
308 "/archive/" version ".tar.gz"))
309 (file-name (string-append name "-" version ".tar.gz"))
312 "1knl6dglnrynx1fhy21nylw56i1q3dkizkgxzkq42mb7ilah8f9y"))))
313 (build-system gnu-build-system)
315 `(#:make-flags '("CC=gcc")
316 #:tests? #f ; No tests
318 (modify-phases %standard-phases
321 (lambda* (#:key outputs #:allow-other-keys)
322 (let* ((out (assoc-ref outputs "out"))
323 (bin (string-append out "/bin"))
324 (man (string-append out "/share/man/man1")))
325 (install-file "picocom" bin)
326 (install-file "picocom.1" man)))))))
327 (home-page "https://github.com/npat-efault/picocom")
328 (synopsis "Minimal dumb-terminal emulation program")
329 (description "It was designed to serve as a simple, manual, modem
330 configuration, testing, and debugging tool. It has also serves well
331 as a low-tech serial communications program to allow access to all
332 types of devices that provide serial consoles.")
333 (license license:gpl2+)))
341 (uri (string-append "http://www.johnath.com/" name "/"
342 name "-" version ".tar.gz"))
345 "0bgch6jq5cahakk3kbr9549iysf2dik09afixxy5brbxk1xfzb2r"))))
346 (build-system gnu-build-system)
348 `(#:tests? #f ; no tests.
350 (modify-phases %standard-phases
352 (add-after 'unpack 'patch-makefile
353 (lambda* (#:key outputs #:allow-other-keys)
354 (substitute* "Makefile" (("/usr") (assoc-ref outputs "out")))
356 (add-before 'install 'create-output-directories
357 (lambda* (#:key outputs #:allow-other-keys)
358 (let ((out (assoc-ref %outputs "out")))
359 (mkdir-p (string-append out "/bin"))
360 (mkdir-p (string-append out "/man/man1"))))))))
361 (synopsis "Linux command-line utility to control the PC speaker")
362 (description "beep allows the user to control the PC speaker with precision,
363 allowing different sounds to indicate different events. While it can be run
364 quite happily on the command line, its intended place of residence is within
365 scripts, notifying the user when something interesting occurs. Of course, it
366 has no notion of what's interesing, but it's very good at that notifying part.")
367 (home-page "http://www.johnath.com/beep")
368 (license license:gpl2+)))
370 (define-public unibilium
377 (uri (string-append "https://github.com/mauke/unibilium/"
378 "archive/v" version ".tar.gz"))
379 (file-name (string-append name "-" version ".tar.gz"))
382 "1n7a0jrlwhn9nnkna76sbnjrr808m0pmzbiwznmp7rhmjl4z2fk2"))))
383 (build-system gnu-build-system)
387 (string-append "PREFIX=" (assoc-ref %outputs "out")))
389 ;; FIXME: tests require "prove"
392 (modify-phases %standard-phases
393 (delete 'configure))))
395 `(("libtool" ,libtool)))
396 (home-page "https://github.com/mauke/unibilium")
397 (synopsis "Terminfo parsing library")
398 (description "Unibilium is a basic C terminfo library. It doesn't depend
399 on curses or any other library. It also doesn't use global variables, so it
400 should be thread-safe.")
401 (license license:lgpl3+)))
403 (define-public libvterm
410 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
411 "libvterm-" version ".tar.gz"))
414 "1s56c8p1qz6frkcri0hg4qyydv2wcccj6n2xmz1dwcdqn38ldsmb"))))
415 (build-system gnu-build-system)
419 (string-append "PREFIX=" (assoc-ref %outputs "out")))
422 (modify-phases %standard-phases
423 (delete 'configure))))
425 `(("libtool" ,libtool)
427 (home-page "http://www.leonerd.org.uk/code/libvterm/")
428 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
429 (description "Libvterm is an abstract C99 library which implements a VT220
430 or xterm-like terminal emulator. It doesn't use any particular graphics
431 toolkit or output system, instead it invokes callback function pointers that
432 its embedding program should provide it to draw on its behalf. It avoids
433 calling @code{malloc} during normal running state, allowing it to be used in
434 embedded kernel situations.")
435 (license license:expat)))
437 (define-public cool-retro-term
438 (let ((commit "e48719fa44e5307df71dbd0fad234f8a6a53f863")
441 (name "cool-retro-term")
442 (version (string-append "1.0.0-" revision "." (string-take commit 7)))
445 (file-name (string-append name "-" version "-checkout"))
447 (url (string-append "https://github.com/Swordfish90/" name))
451 (base32 "1sgqbirninkvgwchr35zgn5vzqvsmrf3cp7lqady1xgrawb8lsz3"))
453 (search-patches "cool-retro-term-remove-non-free-fonts.patch"
454 "cool-retro-term-fix-array-size.patch"
455 "cool-retro-term-dont-check-uninit-member.patch"
456 "cool-retro-term-memory-leak-1.patch"))
457 (modules '((guix build utils)))
459 '(for-each (lambda (font)
460 (delete-file-recursively
461 (string-append "app/qml/fonts/" font))
462 (substitute* '("app/qml/resources.qrc")
463 (((string-append "<file>fonts/" font ".*"))
465 '(;"1971-ibm-3278" ; BSD 3-clause
466 "1977-apple2" ; Non-Free
467 "1977-commodore-pet" ; Non-Free
468 "1979-atari-400-800" ; Non-Free
469 "1982-commodore64" ; Non-Free
471 "1985-ibm-pc-vga" ; Unclear
472 ;"modern-fixedsys-excelsior" ; Redistributable
473 ;"modern-hermit" ; SIL
474 ;"modern-inconsolata"; SIL
475 ;"modern-pro-font-win-tweaked" ; X11
476 ;"modern-proggy-tiny"; X11
477 ;"modern-terminus" ; SIL
478 "modern-monaco"))))) ; Apple non-free
479 (build-system gnu-build-system)
482 ("qtdeclarative" ,qtdeclarative)
483 ("qtgraphicaleffects" ,qtgraphicaleffects)
484 ("qtquickcontrols" ,qtquickcontrols)))
487 (modify-phases %standard-phases
489 (lambda* (#:key outputs #:allow-other-keys)
490 (let* ((out (assoc-ref outputs "out"))
491 (share (string-append out "/share")))
492 (substitute* '("qmltermwidget/qmltermwidget.pro")
493 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
494 (string-append "INSTALL_DIR = " out "/qml")))
495 (substitute* '("app/app.pro")
496 (("target.path \\+= /usr")
497 (string-append "target.path += " out))
498 (("icon32.path = /usr/share")
499 (string-append "icon32.path = " share))
500 (("icon64.path = /usr/share")
501 (string-append "icon64.path = " share))
502 (("icon128.path = /usr/share")
503 (string-append "icon128.path = " share))
504 (("icon256.path = /usr/share")
505 (string-append "icon256.path = " share)))
506 (zero? (system* "qmake")))))
507 (add-before 'install 'fix-Makefiles
508 (lambda* (#:key outputs #:allow-other-keys)
509 (let* ((out (assoc-ref outputs "out")))
510 (substitute* '("Makefile")
511 (("\\$\\(INSTALL_ROOT\\)/usr") out)))))
512 (add-after 'install 'wrap-executable
513 (lambda* (#:key inputs outputs #:allow-other-keys)
514 (let* ((out (assoc-ref outputs "out"))
516 (wrap-program (string-append out "/bin/cool-retro-term")
517 `("QML2_IMPORT_PATH" ":" prefix
518 (,(string-append out qml)
520 (assoc-ref inputs "qtdeclarative") qml)
522 (assoc-ref inputs "qtgraphicaleffects") qml)
524 (assoc-ref inputs "qtquickcontrols") qml)))))))
525 (add-after 'install 'add-alternate-name
526 (lambda* (#:key outputs #:allow-other-keys)
527 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
528 (symlink (string-append bin "/cool-retro-term")
529 (string-append bin "/crt"))))))))
530 (synopsis "Terminal emulator")
532 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
533 feel of the old cathode ray tube (CRT) screens. It has been designed to be
534 eye-candy, customizable, and reasonably lightweight.")
535 (home-page "https://github.com/Swordfish90/cool-retro-term")
537 license:gpl2+ ; qmltermwidget
538 license:gpl3+ ; cool-retro-term