Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / terminals.scm
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>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
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.
18 ;;;
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.
23 ;;;
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/>.
26
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))
56
57 (define-public tilda
58 (package
59 (name "tilda")
60 (version "1.3.3")
61 (source (origin
62 (method url-fetch)
63 (uri (string-append "https://github.com/lanoxx/tilda/archive/"
64 "tilda-" version ".tar.gz"))
65 (sha256
66 (base32
67 "1cc4qbg1m3i04lj5p6i6xbd0zvy1320pxdgmjhz5p3j95ibsbfki"))))
68 (build-system gnu-build-system)
69 (arguments
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")))))))
76 (native-inputs
77 `(("autoconf" ,autoconf)
78 ("automake" ,automake)
79 ("gettext" ,gettext-minimal)
80 ("pkg-config" ,pkg-config)))
81 (inputs
82 `(("glib" ,glib "bin")
83 ("gtk+" ,gtk+)
84 ("libconfuse" ,libconfuse)
85 ("vte" ,vte)))
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+)))
94
95 (define-public termite
96 (package
97 (name "termite")
98 (version "12")
99 (source
100 (origin
101 (method git-fetch)
102 (uri (git-reference
103 (url (string-append "https://github.com/thestinger/"
104 name ".git"))
105 (commit (string-append "v" version))
106 (recursive? #t)))
107 (file-name (string-append name "-" version "-checkout"))
108 (sha256
109 (base32
110 "0s6dyg3vcqk5qcx90bs24wdnd3p56rdjdcanx4pcxvp6ksjl61jz"))))
111 (build-system gnu-build-system)
112 (arguments
113 `(#:phases
114 (modify-phases %standard-phases
115 (delete 'configure))
116 #:tests? #f
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")))))
124 (inputs
125 `(("vte", vte-ng)
126 ("gtk+", gtk+)
127 ("ncurses", ncurses)))
128 (native-inputs
129 `(("pkg-config" ,pkg-config)))
130
131 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
132 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
133 (native-search-paths
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.")
142
143 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
144 (license license:lgpl2.0+)))
145
146 (define-public asciinema
147 (package
148 (name "asciinema")
149 (version "1.4.0")
150 (source
151 (origin
152 (method url-fetch)
153 (uri (pypi-uri "asciinema" version))
154 (sha256
155 (base32
156 "1jrf8c8711gkdilmvyv3d37kp8xfvdc5cqighw5k92a6g9z4acgv"))))
157 (build-system python-build-system)
158 (arguments
159 `(#:phases
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"
165 (("'tput'")
166 (string-append "'" ncurses "/bin/tput'"))))
167 #t)))))
168 (inputs `(("ncurses" ,ncurses)))
169 (native-inputs
170 ;; For tests.
171 `(("python-requests" ,python-requests)))
172 (home-page "https://asciinema.org")
173 (synopsis "Terminal session recorder")
174 (description
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)))
179
180 (define-public libtsm
181 (package
182 (name "libtsm")
183 (version "3")
184 (source (origin
185 (method url-fetch)
186 (uri (string-append
187 "https://freedesktop.org/software/kmscon/releases/"
188 "libtsm-" version ".tar.xz"))
189 (sha256
190 (base32
191 "01ygwrsxfii0pngfikgqsb4fxp8n1bbs47l7hck81h9b9bc1ah8i"))))
192 (build-system gnu-build-system)
193 (native-inputs
194 `(("pkg-config" ,pkg-config)))
195 (inputs
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
204 ;; derived from ISC.
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))))
208
209 (define-public kmscon
210 (package
211 (name "kmscon")
212 (version "8")
213 (source (origin
214 (method url-fetch)
215 (uri (string-append
216 "https://freedesktop.org/software/kmscon/releases/"
217 "kmscon-" version ".tar.xz"))
218 (sha256
219 (base32
220 "0axfwrp3c8f4gb67ap2sqnkn75idpiw09s35wwn6kgagvhf1rc0a"))
221 (modules '((guix build utils)))
222 (snippet
223 ;; Use elogind instead of systemd.
224 '(begin
225 (substitute* "configure"
226 (("libsystemd-daemon libsystemd-login")
227 "libelogind"))
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>")
233 "")
234 ;; Replace the call to 'sd_booted' by the truth value.
235 (("sd_booted\\(\\)")
236 "1"))))))
237 (build-system gnu-build-system)
238 (native-inputs
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)))
243 (inputs
244 `(("libdrm" ,libdrm)
245 ("libtsm" ,libtsm)
246 ("libxkbcommon" ,libxkbcommon)
247 ("logind" ,elogind)
248 ("mesa" ,mesa)
249 ("pango" ,pango)
250 ("udev" ,eudev)))
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
261 ;; derived from ISC.
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
267 license:gpl2+))
268 (supported-systems (filter (cut string-suffix? "-linux" <>)
269 %supported-systems))))
270
271 (define-public libtermkey
272 (package
273 (name "libtermkey")
274 (version "0.20")
275 (source (origin
276 (method url-fetch)
277 (uri (string-append "http://www.leonerd.org.uk/code/"
278 name "/" name "-" version ".tar.gz"))
279 (sha256
280 (base32 "1xfj6lchhfljmbcl6dz8dpakppyy13nbl4ykxiv5x4dr9b4qf3bc"))))
281 (build-system gnu-build-system)
282 (arguments
283 '(#:make-flags (list
284 "CC=gcc"
285 (string-append "PREFIX=" (assoc-ref %outputs "out")))
286 #:phases (modify-phases %standard-phases
287 (delete 'configure))
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")
294 (description
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)))
299
300 (define-public picocom
301 (package
302 (name "picocom")
303 (version "2.2")
304 (source (origin
305 (method url-fetch)
306 (uri (string-append
307 "https://github.com/npat-efault/picocom"
308 "/archive/" version ".tar.gz"))
309 (file-name (string-append name "-" version ".tar.gz"))
310 (sha256
311 (base32
312 "1knl6dglnrynx1fhy21nylw56i1q3dkizkgxzkq42mb7ilah8f9y"))))
313 (build-system gnu-build-system)
314 (arguments
315 `(#:make-flags '("CC=gcc")
316 #:tests? #f ; No tests
317 #:phases
318 (modify-phases %standard-phases
319 (delete 'configure)
320 (replace 'install
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+)))
334
335 (define-public beep
336 (package
337 (name "beep")
338 (version "1.3")
339 (source (origin
340 (method url-fetch)
341 (uri (string-append "http://www.johnath.com/" name "/"
342 name "-" version ".tar.gz"))
343 (sha256
344 (base32
345 "0bgch6jq5cahakk3kbr9549iysf2dik09afixxy5brbxk1xfzb2r"))))
346 (build-system gnu-build-system)
347 (arguments
348 `(#:tests? #f ; no tests.
349 #:phases
350 (modify-phases %standard-phases
351 (delete 'configure)
352 (add-after 'unpack 'patch-makefile
353 (lambda* (#:key outputs #:allow-other-keys)
354 (substitute* "Makefile" (("/usr") (assoc-ref outputs "out")))
355 #t))
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+)))
369
370 (define-public unibilium
371 (package
372 (name "unibilium")
373 (version "1.2.0")
374 (source
375 (origin
376 (method url-fetch)
377 (uri (string-append "https://github.com/mauke/unibilium/"
378 "archive/v" version ".tar.gz"))
379 (file-name (string-append name "-" version ".tar.gz"))
380 (sha256
381 (base32
382 "1n7a0jrlwhn9nnkna76sbnjrr808m0pmzbiwznmp7rhmjl4z2fk2"))))
383 (build-system gnu-build-system)
384 (arguments
385 `(#:make-flags
386 (list "CC=gcc"
387 (string-append "PREFIX=" (assoc-ref %outputs "out")))
388 #:test-target "test"
389 ;; FIXME: tests require "prove"
390 #:tests? #f
391 #:phases
392 (modify-phases %standard-phases
393 (delete 'configure))))
394 (native-inputs
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+)))
402
403 (define-public libvterm
404 (package
405 (name "libvterm")
406 (version "0+bzr681")
407 (source
408 (origin
409 (method url-fetch)
410 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
411 "libvterm-" version ".tar.gz"))
412 (sha256
413 (base32
414 "1s56c8p1qz6frkcri0hg4qyydv2wcccj6n2xmz1dwcdqn38ldsmb"))))
415 (build-system gnu-build-system)
416 (arguments
417 `(#:make-flags
418 (list "CC=gcc"
419 (string-append "PREFIX=" (assoc-ref %outputs "out")))
420 #:test-target "test"
421 #:phases
422 (modify-phases %standard-phases
423 (delete 'configure))))
424 (native-inputs
425 `(("libtool" ,libtool)
426 ("perl" ,perl)))
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)))
436
437 (define-public cool-retro-term
438 (let ((commit "e48719fa44e5307df71dbd0fad234f8a6a53f863")
439 (revision "1"))
440 (package
441 (name "cool-retro-term")
442 (version (string-append "1.0.0-" revision "." (string-take commit 7)))
443 (source (origin
444 (method git-fetch)
445 (file-name (string-append name "-" version "-checkout"))
446 (uri (git-reference
447 (url (string-append "https://github.com/Swordfish90/" name))
448 (commit commit)
449 (recursive? #t)))
450 (sha256
451 (base32 "1sgqbirninkvgwchr35zgn5vzqvsmrf3cp7lqady1xgrawb8lsz3"))
452 (patches
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)))
458 (snippet
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 ".*"))
464 "")))
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
470 "1985-atari-st" ; ?
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)
480 (inputs
481 `(("qtbase" ,qtbase)
482 ("qtdeclarative" ,qtdeclarative)
483 ("qtgraphicaleffects" ,qtgraphicaleffects)
484 ("qtquickcontrols" ,qtquickcontrols)))
485 (arguments
486 `(#:phases
487 (modify-phases %standard-phases
488 (replace 'configure
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"))
515 (qml "/qml"))
516 (wrap-program (string-append out "/bin/cool-retro-term")
517 `("QML2_IMPORT_PATH" ":" prefix
518 (,(string-append out qml)
519 ,(string-append
520 (assoc-ref inputs "qtdeclarative") qml)
521 ,(string-append
522 (assoc-ref inputs "qtgraphicaleffects") qml)
523 ,(string-append
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")
531 (description
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")
536 (license (list
537 license:gpl2+ ; qmltermwidget
538 license:gpl3+ ; cool-retro-term
539 ;; Fonts
540 license:silofl1.1
541 license:x11
542 license:bsd-3)))))