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 python)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix packages)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages docbook)
41 #:use-module (gnu packages freedesktop)
42 #:use-module (gnu packages gettext)
43 #:use-module (gnu packages gl)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages gtk)
47 #:use-module (gnu packages linux)
48 #:use-module (gnu packages ncurses)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages perl-check)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages qt)
54 #:use-module (gnu packages wm)
55 #:use-module (gnu packages xdisorg)
56 #:use-module (gnu packages xml)
57 #:use-module (gnu packages xorg)
58 #:use-module (srfi srfi-26))
66 (uri (string-append "https://github.com/lanoxx/tilda/archive/"
67 "tilda-" version ".tar.gz"))
70 "1cc4qbg1m3i04lj5p6i6xbd0zvy1320pxdgmjhz5p3j95ibsbfki"))))
71 (build-system glib-or-gtk-build-system)
73 `(#:phases (modify-phases %standard-phases
74 (add-before 'patch-source-shebangs 'autogen
75 (lambda _ ; Avoid running ./configure.
76 (substitute* "autogen.sh"
77 (("^.*\\$srcdir/configure.*") ""))
78 (zero? (system* "sh" "autogen.sh")))))))
80 `(("autoconf" ,autoconf)
81 ("automake" ,automake)
82 ("gettext" ,gettext-minimal)
83 ("pkg-config" ,pkg-config)))
85 `(("libconfuse" ,libconfuse)
87 (synopsis "GTK+-based drop-down terminal")
88 (description "Tilda is a terminal emulator similar to normal terminals like
89 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
90 from the edge of a screen when a certain configurable hotkey is pressed. This
91 is similar to the built-in consoles in some applications. Tilda is highly
92 configurable through a graphical wizard.")
93 (home-page "https://github.com/lanoxx/tilda")
94 (license license:gpl2+)))
96 (define-public termite
104 (url (string-append "https://github.com/thestinger/"
106 (commit (string-append "v" version))
108 (file-name (string-append name "-" version "-checkout"))
111 "0s6dyg3vcqk5qcx90bs24wdnd3p56rdjdcanx4pcxvp6ksjl61jz"))))
112 (build-system gnu-build-system)
115 (modify-phases %standard-phases
118 ;; This sets the destination when installing the necessary terminal
119 ;; capability data, which are not provided by 'ncurses'. See
120 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
121 #:make-flags (list "PREFIX="
122 (string-append "VERSION=v" (version))
123 (string-append "DESTDIR="
124 (assoc-ref %outputs "out")))))
128 ("ncurses", ncurses)))
130 `(("pkg-config" ,pkg-config)))
132 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
133 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
135 (list (search-path-specification
136 (variable "TERMINFO_DIRS")
137 (files '("share/terminfo")))))
138 (home-page "https://github.com/thestinger/termite/")
139 (synopsis "Keyboard-centric, VTE-based terminal")
140 (description "Termite is a minimal terminal emulator designed for use with
141 tiling window managers. It is a modal application, similar to Vim, with an
142 insert mode and command mode where keybindings have different functions.")
144 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
145 (license license:lgpl2.0+)))
147 (define-public asciinema
154 (uri (pypi-uri "asciinema" version))
157 "1jrf8c8711gkdilmvyv3d37kp8xfvdc5cqighw5k92a6g9z4acgv"))))
158 (build-system python-build-system)
161 (modify-phases %standard-phases
162 (add-before 'build 'patch-exec-paths
163 (lambda* (#:key inputs #:allow-other-keys)
164 (let ((ncurses (assoc-ref inputs "ncurses")))
165 (substitute* "asciinema/recorder.py"
167 (string-append "'" ncurses "/bin/tput'"))))
169 (inputs `(("ncurses" ,ncurses)))
172 `(("python-requests" ,python-requests)))
173 (home-page "https://asciinema.org")
174 (synopsis "Terminal session recorder")
176 "Use asciinema to record and share your terminal sessions, the right way.
177 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
178 text-based approach to terminal recording.")
179 (license license:gpl3)))
181 (define-public libtsm
188 "https://freedesktop.org/software/kmscon/releases/"
189 "libtsm-" version ".tar.xz"))
192 "01ygwrsxfii0pngfikgqsb4fxp8n1bbs47l7hck81h9b9bc1ah8i"))))
193 (build-system gnu-build-system)
195 `(("pkg-config" ,pkg-config)))
197 `(("libxkbcommon" ,libxkbcommon)))
198 (synopsis "Xterm state machine library")
199 (description "TSM is a state machine for DEC VT100-VT520 compatible
200 terminal emulators. It tries to support all common standards while keeping
201 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
202 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
203 ;; Hash table implementation is lgpl2.1+ licensed.
204 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
206 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
207 ;; under the bsd 2 license.
208 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2))))
210 (define-public kmscon
217 "https://freedesktop.org/software/kmscon/releases/"
218 "kmscon-" version ".tar.xz"))
221 "0axfwrp3c8f4gb67ap2sqnkn75idpiw09s35wwn6kgagvhf1rc0a"))
222 (modules '((guix build utils)))
224 ;; Use elogind instead of systemd.
226 (substitute* "configure"
227 (("libsystemd-daemon libsystemd-login")
229 (substitute* "src/uterm_systemd.c"
230 (("#include <systemd/sd-login.h>")
231 "#include <elogind/sd-login.h>")
232 ;; We don't have this header.
233 (("#include <systemd/sd-daemon\\.h>")
235 ;; Replace the call to 'sd_booted' by the truth value.
238 (build-system gnu-build-system)
240 `(("pkg-config" ,pkg-config)
241 ("libxslt" ,libxslt) ;to build the man page
242 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
243 ("docbook-xsl" ,docbook-xsl)))
247 ("libxkbcommon" ,libxkbcommon)
252 (synopsis "Linux KMS-based terminal emulator")
253 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
254 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
255 implementation with a user-space console. Compared to the Linux console,
256 kmscon provides enhanced features including XKB-compatible internationalized
257 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
258 multi-seat support, a replacement for @command{mingetty}, and more.")
259 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
260 ;; Hash table implementation is lgpl2.1+ licensed.
261 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
263 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
264 ;; under the bsd 2 license.
265 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
266 ;; under the terms of the GNU GPL.
267 (license (list license:expat license:lgpl2.1+ license:bsd-2
269 (supported-systems (filter (cut string-suffix? "-linux" <>)
270 %supported-systems))))
272 (define-public libtermkey
278 (uri (string-append "http://www.leonerd.org.uk/code/"
279 name "/" name "-" version ".tar.gz"))
281 (base32 "1xfj6lchhfljmbcl6dz8dpakppyy13nbl4ykxiv5x4dr9b4qf3bc"))))
282 (build-system gnu-build-system)
286 (string-append "PREFIX=" (assoc-ref %outputs "out")))
287 #:phases (modify-phases %standard-phases
289 #:test-target "test"))
290 (inputs `(("ncurses", ncurses)))
291 (native-inputs `(("libtool", libtool)
292 ("perl-test-harness" ,perl-test-harness)
293 ("pkg-config", pkg-config)))
294 (synopsis "Keyboard entry processing library for terminal-based programs")
296 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
297 combining, and so on, with a simple interface.")
298 (home-page "http://www.leonerd.org.uk/code/libtermkey")
299 (license license:expat)))
301 (define-public picocom
308 "https://github.com/npat-efault/picocom"
309 "/archive/" version ".tar.gz"))
310 (file-name (string-append name "-" version ".tar.gz"))
313 "1knl6dglnrynx1fhy21nylw56i1q3dkizkgxzkq42mb7ilah8f9y"))))
314 (build-system gnu-build-system)
316 `(#:make-flags '("CC=gcc")
317 #:tests? #f ; No tests
319 (modify-phases %standard-phases
322 (lambda* (#:key outputs #:allow-other-keys)
323 (let* ((out (assoc-ref outputs "out"))
324 (bin (string-append out "/bin"))
325 (man (string-append out "/share/man/man1")))
326 (install-file "picocom" bin)
327 (install-file "picocom.1" man)))))))
328 (home-page "https://github.com/npat-efault/picocom")
329 (synopsis "Minimal dumb-terminal emulation program")
330 (description "It was designed to serve as a simple, manual, modem
331 configuration, testing, and debugging tool. It has also serves well
332 as a low-tech serial communications program to allow access to all
333 types of devices that provide serial consoles.")
334 (license license:gpl2+)))
342 (uri (string-append "http://www.johnath.com/" name "/"
343 name "-" version ".tar.gz"))
346 "0bgch6jq5cahakk3kbr9549iysf2dik09afixxy5brbxk1xfzb2r"))))
347 (build-system gnu-build-system)
349 `(#:tests? #f ; no tests.
351 (modify-phases %standard-phases
353 (add-after 'unpack 'patch-makefile
354 (lambda* (#:key outputs #:allow-other-keys)
355 (substitute* "Makefile" (("/usr") (assoc-ref outputs "out")))
357 (add-before 'install 'create-output-directories
358 (lambda* (#:key outputs #:allow-other-keys)
359 (let ((out (assoc-ref %outputs "out")))
360 (mkdir-p (string-append out "/bin"))
361 (mkdir-p (string-append out "/man/man1"))))))))
362 (synopsis "Linux command-line utility to control the PC speaker")
363 (description "beep allows the user to control the PC speaker with precision,
364 allowing different sounds to indicate different events. While it can be run
365 quite happily on the command line, its intended place of residence is within
366 scripts, notifying the user when something interesting occurs. Of course, it
367 has no notion of what's interesing, but it's very good at that notifying part.")
368 (home-page "http://www.johnath.com/beep")
369 (license license:gpl2+)))
371 (define-public unibilium
378 (uri (string-append "https://github.com/mauke/unibilium/"
379 "archive/v" version ".tar.gz"))
380 (file-name (string-append name "-" version ".tar.gz"))
383 "1n7a0jrlwhn9nnkna76sbnjrr808m0pmzbiwznmp7rhmjl4z2fk2"))))
384 (build-system gnu-build-system)
388 (string-append "PREFIX=" (assoc-ref %outputs "out")))
390 ;; FIXME: tests require "prove"
393 (modify-phases %standard-phases
394 (delete 'configure))))
396 `(("libtool" ,libtool)))
397 (home-page "https://github.com/mauke/unibilium")
398 (synopsis "Terminfo parsing library")
399 (description "Unibilium is a basic C terminfo library. It doesn't depend
400 on curses or any other library. It also doesn't use global variables, so it
401 should be thread-safe.")
402 (license license:lgpl3+)))
404 (define-public libvterm
411 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
412 "libvterm-" version ".tar.gz"))
415 "1s56c8p1qz6frkcri0hg4qyydv2wcccj6n2xmz1dwcdqn38ldsmb"))))
416 (build-system gnu-build-system)
420 (string-append "PREFIX=" (assoc-ref %outputs "out")))
423 (modify-phases %standard-phases
424 (delete 'configure))))
426 `(("libtool" ,libtool)
428 (home-page "http://www.leonerd.org.uk/code/libvterm/")
429 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
430 (description "Libvterm is an abstract C99 library which implements a VT220
431 or xterm-like terminal emulator. It doesn't use any particular graphics
432 toolkit or output system, instead it invokes callback function pointers that
433 its embedding program should provide it to draw on its behalf. It avoids
434 calling @code{malloc} during normal running state, allowing it to be used in
435 embedded kernel situations.")
436 (license license:expat)))
438 (define-public cool-retro-term
439 (let ((commit "e48719fa44e5307df71dbd0fad234f8a6a53f863")
442 (name "cool-retro-term")
443 (version (string-append "1.0.0-" revision "." (string-take commit 7)))
446 (file-name (string-append name "-" version "-checkout"))
448 (url (string-append "https://github.com/Swordfish90/" name))
452 (base32 "1sgqbirninkvgwchr35zgn5vzqvsmrf3cp7lqady1xgrawb8lsz3"))
454 (search-patches "cool-retro-term-remove-non-free-fonts.patch"
455 "cool-retro-term-fix-array-size.patch"
456 "cool-retro-term-dont-check-uninit-member.patch"
457 "cool-retro-term-memory-leak-1.patch"))
458 (modules '((guix build utils)))
460 '(for-each (lambda (font)
461 (delete-file-recursively
462 (string-append "app/qml/fonts/" font))
463 (substitute* '("app/qml/resources.qrc")
464 (((string-append "<file>fonts/" font ".*"))
466 '(;"1971-ibm-3278" ; BSD 3-clause
467 "1977-apple2" ; Non-Free
468 "1977-commodore-pet" ; Non-Free
469 "1979-atari-400-800" ; Non-Free
470 "1982-commodore64" ; Non-Free
472 "1985-ibm-pc-vga" ; Unclear
473 ;"modern-fixedsys-excelsior" ; Redistributable
474 ;"modern-hermit" ; SIL
475 ;"modern-inconsolata"; SIL
476 ;"modern-pro-font-win-tweaked" ; X11
477 ;"modern-proggy-tiny"; X11
478 ;"modern-terminus" ; SIL
479 "modern-monaco"))))) ; Apple non-free
480 (build-system gnu-build-system)
483 ("qtdeclarative" ,qtdeclarative)
484 ("qtgraphicaleffects" ,qtgraphicaleffects)
485 ("qtquickcontrols" ,qtquickcontrols)))
488 (modify-phases %standard-phases
490 (lambda* (#:key outputs #:allow-other-keys)
491 (let* ((out (assoc-ref outputs "out"))
492 (share (string-append out "/share")))
493 (substitute* '("qmltermwidget/qmltermwidget.pro")
494 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
495 (string-append "INSTALL_DIR = " out "/qml")))
496 (substitute* '("app/app.pro")
497 (("target.path \\+= /usr")
498 (string-append "target.path += " out))
499 (("icon32.path = /usr/share")
500 (string-append "icon32.path = " share))
501 (("icon64.path = /usr/share")
502 (string-append "icon64.path = " share))
503 (("icon128.path = /usr/share")
504 (string-append "icon128.path = " share))
505 (("icon256.path = /usr/share")
506 (string-append "icon256.path = " share)))
507 (zero? (system* "qmake")))))
508 (add-before 'install 'fix-Makefiles
509 (lambda* (#:key outputs #:allow-other-keys)
510 (let* ((out (assoc-ref outputs "out")))
511 (substitute* '("Makefile")
512 (("\\$\\(INSTALL_ROOT\\)/usr") out)))))
513 (add-after 'install 'wrap-executable
514 (lambda* (#:key inputs outputs #:allow-other-keys)
515 (let* ((out (assoc-ref outputs "out"))
517 (wrap-program (string-append out "/bin/cool-retro-term")
518 `("QML2_IMPORT_PATH" ":" prefix
519 (,(string-append out qml)
521 (assoc-ref inputs "qtdeclarative") qml)
523 (assoc-ref inputs "qtgraphicaleffects") qml)
525 (assoc-ref inputs "qtquickcontrols") qml)))))))
526 (add-after 'install 'add-alternate-name
527 (lambda* (#:key outputs #:allow-other-keys)
528 (let* ((bin (string-append (assoc-ref outputs "out") "/bin")))
529 (symlink (string-append bin "/cool-retro-term")
530 (string-append bin "/crt"))))))))
531 (synopsis "Terminal emulator")
533 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
534 feel of the old cathode ray tube (CRT) screens. It has been designed to be
535 eye-candy, customizable, and reasonably lightweight.")
536 (home-page "https://github.com/Swordfish90/cool-retro-term")
538 license:gpl2+ ; qmltermwidget
539 license:gpl3+ ; cool-retro-term
545 (define-public sakura
551 (uri (string-append "https://launchpad.net/" name "/trunk/"
552 version "/+download/" name "-" version
556 "0fhcn3540iw22l5zg3njh5z8cj0g2n9p6fvagjqa5zc323jfsc7b"))))
557 (build-system cmake-build-system)
562 `(("gettext" ,gettext-minimal)
563 ("perl" ,perl) ; for pod2man
564 ("pkg-config" ,pkg-config)))
568 (home-page "https://launchpad.net/sakura")
569 (synopsis "A simple but powerful libvte-based terminal emulator")
570 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
571 It's a terminal emulator with few dependencies, so you don't need a full GNOME
572 desktop installed to have a decent terminal emulator.")
573 (license license:gpl2)))