gnu: rtl-433: Update to 20.11.
[jackhill/guix/guix.git] / gnu / packages / terminals.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
3 ;;; Copyright © 2016 Mckinley Olsen <mck.olsen@gmail.com>
4 ;;; Copyright © 2016, 2017, 2019 Alex Griffin <a@ajgrf.com>
5 ;;; Copyright © 2016 David Craven <david@craven.ch>
6 ;;; Copyright © 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
8 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
10 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
12 ;;; Copyright © 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
13 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
14 ;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
15 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2018, 2019 Eric Bavier <bavier@member.fsf.org>
17 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
18 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
19 ;;; Copyright © 2019, 2020 Brett Gilio <brettg@gnu.org>
20 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
21 ;;; Copyright © 2020 Valentin Ignatev <valentignatev@gmail.com>
22 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
23 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
24 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
25 ;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
26 ;;;
27 ;;; This file is part of GNU Guix.
28 ;;;
29 ;;; GNU Guix is free software; you can redistribute it and/or modify it
30 ;;; under the terms of the GNU General Public License as published by
31 ;;; the Free Software Foundation; either version 3 of the License, or (at
32 ;;; your option) any later version.
33 ;;;
34 ;;; GNU Guix is distributed in the hope that it will be useful, but
35 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 ;;; GNU General Public License for more details.
38 ;;;
39 ;;; You should have received a copy of the GNU General Public License
40 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42 (define-module (gnu packages terminals)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix build-system cargo)
45 #:use-module (guix build-system cmake)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system glib-or-gtk)
48 #:use-module (guix build-system go)
49 #:use-module (guix build-system meson)
50 #:use-module (guix build-system python)
51 #:use-module (guix download)
52 #:use-module (guix git-download)
53 #:use-module (guix packages)
54 #:use-module (guix utils)
55 #:use-module (gnu packages)
56 #:use-module (gnu packages autotools)
57 #:use-module (gnu packages build-tools) ;for meson-0.55
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages cmake)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages crates-io)
62 #:use-module (gnu packages crates-graphics)
63 #:use-module (gnu packages crypto)
64 #:use-module (gnu packages docbook)
65 #:use-module (gnu packages fontutils)
66 #:use-module (gnu packages freedesktop)
67 #:use-module (gnu packages gcc)
68 #:use-module (gnu packages gettext)
69 #:use-module (gnu packages ghostscript)
70 #:use-module (gnu packages gl)
71 #:use-module (gnu packages glib)
72 #:use-module (gnu packages gnome)
73 #:use-module (gnu packages golang)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages image)
76 #:use-module (gnu packages libcanberra)
77 #:use-module (gnu packages libevent)
78 #:use-module (gnu packages linux)
79 #:use-module (gnu packages man)
80 #:use-module (gnu packages ncurses)
81 #:use-module (gnu packages perl)
82 #:use-module (gnu packages perl-check)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages popt)
85 #:use-module (gnu packages protobuf)
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages python-web)
88 #:use-module (gnu packages python-xyz)
89 #:use-module (gnu packages qt)
90 #:use-module (gnu packages serialization)
91 #:use-module (gnu packages sphinx)
92 #:use-module (gnu packages ssh)
93 #:use-module (gnu packages textutils)
94 #:use-module (gnu packages xdisorg)
95 #:use-module (gnu packages xml)
96 #:use-module (gnu packages xorg)
97 #:use-module (srfi srfi-26))
98
99 (define-public tilda
100 (package
101 (name "tilda")
102 (version "1.5.4")
103 (source (origin
104 (method git-fetch)
105 (uri (git-reference
106 (url "https://github.com/lanoxx/tilda")
107 (commit (string-append "tilda-" version))))
108 (file-name (git-file-name name version))
109 (sha256
110 (base32
111 "0q2i9ny8sh7zjzgvkx8vcvk593wcvchjc4xq4nrlqdd377r7cg5q"))))
112 (build-system glib-or-gtk-build-system)
113 (arguments
114 `(#:phases
115 (modify-phases %standard-phases
116 (add-after 'unpack 'make-po-writable
117 (lambda _
118 (for-each make-file-writable (find-files "po" "."))
119 #t)))))
120 (native-inputs
121 `(("autoconf" ,autoconf)
122 ("automake" ,automake)
123 ("gettext" ,gettext-minimal)
124 ("pkg-config" ,pkg-config)))
125 (inputs
126 `(("libconfuse" ,libconfuse)
127 ("vte" ,vte)))
128 (synopsis "GTK+-based drop-down terminal")
129 (description "Tilda is a terminal emulator similar to normal terminals like
130 gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
131 from the edge of a screen when a certain configurable hotkey is pressed. This
132 is similar to the built-in consoles in some applications. Tilda is highly
133 configurable through a graphical wizard.")
134 (home-page "https://github.com/lanoxx/tilda")
135 (license license:gpl2+)))
136
137 (define-public termite
138 (package
139 (name "termite")
140 (version "15")
141 (source
142 (origin
143 (method git-fetch)
144 (uri (git-reference
145 (url (string-append "https://github.com/thestinger/"
146 name ".git"))
147 (commit (string-append "v" version))
148 (recursive? #t)))
149 (file-name (string-append name "-" version "-checkout"))
150 (sha256
151 (base32
152 "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k"))))
153 (build-system gnu-build-system)
154 (arguments
155 `(#:phases
156 (modify-phases %standard-phases
157 (add-after 'unpack 'patch-xdg-open
158 (lambda _
159 (substitute* "termite.cc"
160 (("xdg-open") (which "xdg-open")))
161 #t))
162 (delete 'configure))
163 #:tests? #f
164 ;; This sets the destination when installing the necessary terminal
165 ;; capability data, which are not provided by 'ncurses'. See
166 ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
167 #:make-flags (list "PREFIX="
168 (string-append "VERSION=v" (version))
169 (string-append "DESTDIR="
170 (assoc-ref %outputs "out")))))
171 (inputs
172 `(("vte" ,vte-ng)
173 ("gtk+" ,gtk+)
174 ("xdg-utils" ,xdg-utils)
175 ("ncurses" ,ncurses)))
176 (native-inputs
177 `(("pkg-config" ,pkg-config)))
178
179 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
180 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
181 (native-search-paths
182 (list (search-path-specification
183 (variable "TERMINFO_DIRS")
184 (files '("share/terminfo")))))
185 (home-page "https://github.com/thestinger/termite/")
186 (synopsis "Keyboard-centric, VTE-based terminal")
187 (description "Termite is a minimal terminal emulator designed for use with
188 tiling window managers. It is a modal application, similar to Vim, with an
189 insert mode and command mode where keybindings have different functions.")
190
191 ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
192 (license license:lgpl2.0+)))
193
194 (define-public asciinema
195 (package
196 (name "asciinema")
197 (version "2.0.2")
198 (source
199 (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://github.com/asciinema/asciinema")
203 (commit (string-append "v" version))))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32
207 "1a2pysxnp6icyd08mgf66xr6f6j0irnfxdpf3fmzcz31ix7l9kc4"))))
208 (build-system python-build-system)
209 (arguments
210 `(#:phases
211 (modify-phases %standard-phases
212 (add-before 'build 'patch-exec-paths
213 (lambda* (#:key inputs #:allow-other-keys)
214 (let ((ncurses (assoc-ref inputs "ncurses")))
215 (substitute* "asciinema/term.py"
216 (("'tput'")
217 (string-append "'" ncurses "/bin/tput'"))))
218 #t))
219 (replace 'check
220 (lambda _ (invoke "nosetests" "-v"))))))
221 (inputs `(("ncurses" ,ncurses)))
222 (native-inputs
223 ;; For tests.
224 `(("python-nose" ,python-nose)))
225 (home-page "https://asciinema.org")
226 (synopsis "Terminal session recorder")
227 (description
228 "Use asciinema to record and share your terminal sessions, the right way.
229 Forget screen recording apps and blurry video. Enjoy a lightweight, purely
230 text-based approach to terminal recording.")
231 (license license:gpl3)))
232
233 (define-public libtsm
234 (let ((commit "f70e37982f382b03c6939dac3d5f814450bda253")
235 (revision "1"))
236 (package
237 (name "libtsm")
238 (version (git-version "0.0.0" revision commit))
239 (source
240 (origin
241 (method git-fetch)
242 ;; The freedesktop repository is no longer maintained.
243 (uri (git-reference
244 (url (string-append "https://github.com/Aetf/" name))
245 (commit commit)))
246 (file-name (git-file-name name version))
247 (sha256
248 (base32 "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx"))
249 (modules '((guix build utils)))
250 (snippet
251 '(begin
252 ;; Remove a bundled copy of libxkbcommon's xkbcommon-keysyms.h.
253 (delete-file-recursively "external/xkbcommon")
254 #t))))
255 (build-system cmake-build-system)
256 (arguments
257 `(#:configure-flags '("-DBUILD_TESTING=ON")))
258 (native-inputs
259 `(("check" ,check)
260 ("libxkbcommon" ,libxkbcommon) ; for xkbcommon-keysyms.h
261 ("pkg-config" ,pkg-config)))
262 (synopsis "Xterm state machine library")
263 (description "TSM is a state machine for DEC VT100-VT520 compatible
264 terminal emulators. It tries to support all common standards while keeping
265 compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
266 (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
267 ;; Hash table implementation is lgpl2.1+ licensed.
268 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
269 ;; derived from ISC.
270 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
271 ;; under the bsd 2 license.
272 (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2)))))
273
274 (define-public kmscon
275 (let ((commit "01dd0a231e2125a40ceba5f59fd945ff29bf2cdc")
276 (revision "1"))
277 (package
278 (name "kmscon")
279 (version (git-version "0.0.0" revision commit))
280 (source (origin
281 (method git-fetch)
282 ;; The freedesktop repository is no longer maintained.
283 (uri (git-reference
284 (url (string-append "https://github.com/Aetf/" name))
285 (commit commit)))
286 (sha256
287 (base32
288 "0q62kjsvy2iwy8adfiygx2bfwlh83rphgxbis95ycspqidg9py87"))
289 (patches
290 (search-patches "kmscon-runtime-keymap-switch.patch"))
291 (modules '((guix build utils)))
292 (file-name (git-file-name name version))))
293 (build-system gnu-build-system)
294 (arguments
295 `(;; The closure of MESA is huge so we'd rather avoid it.
296 #:disallowed-references (,mesa)
297
298 #:phases (modify-phases %standard-phases
299 ;; Use elogind instead of systemd.
300 (add-before 'configure 'remove-systemd
301 (lambda _
302 (substitute* "configure"
303 (("libsystemd-daemon libsystemd-login")
304 "libelogind"))
305 (substitute* "src/uterm_systemd.c"
306 (("#include <systemd/sd-login.h>")
307 "#include <elogind/sd-login.h>")
308 ;; We don't have this header.
309 (("#include <systemd/sd-daemon\\.h>")
310 "")
311 ;; Replace the call to 'sd_booted' by the truth value.
312 (("sd_booted\\(\\)")
313 "1")))))))
314 (native-inputs
315 `(("pkg-config" ,pkg-config)
316 ("autoconf" ,autoconf)
317 ("automake" ,automake)
318 ("libtool" ,libtool)
319 ("libxslt" ,libxslt) ;to build the man page
320 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
321 ("docbook-xsl" ,docbook-xsl)))
322 (inputs
323 `(("libdrm" ,libdrm)
324 ("libtsm" ,libtsm)
325 ("libxkbcommon" ,libxkbcommon)
326 ("logind" ,elogind)
327 ;; MESA can be used for accelerated video output via OpenGLESv2, but
328 ;; it's a bit dependency that we'd rather avoid in the installation
329 ;; image.
330 ;; ("mesa" ,mesa)
331 ("pango" ,pango)
332 ("udev" ,eudev)))
333 (synopsis "Linux KMS-based terminal emulator")
334 (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
335 mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
336 implementation with a user-space console. Compared to the Linux console,
337 kmscon provides enhanced features including XKB-compatible internationalized
338 keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
339 multi-seat support, a replacement for @command{mingetty}, and more.")
340 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
341 ;; Hash table implementation is lgpl2.1+ licensed.
342 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
343 ;; derived from ISC.
344 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
345 ;; under the bsd 2 license.
346 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
347 ;; under the terms of the GNU GPL.
348 (license (list license:expat license:lgpl2.1+ license:bsd-2
349 license:gpl2+))
350 (supported-systems (filter (cut string-suffix? "-linux" <>)
351 %supported-systems)))))
352
353 (define-public libtermkey
354 (package
355 (name "libtermkey")
356 (version "0.22")
357 (source (origin
358 (method url-fetch)
359 (uri (string-append "http://www.leonerd.org.uk/code/libtermkey/"
360 "libtermkey-" version ".tar.gz"))
361 (sha256
362 (base32 "002606rrxh5f6l6jrikl0dyxsknscdamq10av21xm0xa98ybsib9"))))
363 (build-system gnu-build-system)
364 (arguments
365 `(#:make-flags (list
366 (string-append "CC=" ,(cc-for-target))
367 (string-append "PREFIX=" (assoc-ref %outputs "out")))
368 #:phases
369 (modify-phases %standard-phases
370 (delete 'configure) ; no configure script
371 (add-before 'check 'patch-failing-test
372 ;; XXX This undoes an upstream change in version 0.22 which ‘ensures
373 ;; that the hooked function can invent TI strings for new terminal
374 ;; types’. That fails in the build environment. Why?
375 (lambda _
376 (substitute* "t/40ti-override.c"
377 (("vt750") "vt100")))))
378 #:test-target "test"))
379 (inputs `(("ncurses" ,ncurses)))
380 (native-inputs `(("libtool" ,libtool)
381 ("perl-test-harness" ,perl-test-harness)
382 ("pkg-config" ,pkg-config)))
383 (synopsis "Keyboard entry processing library for terminal-based programs")
384 (description
385 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
386 combining, and so on, with a simple interface.")
387 (home-page "http://www.leonerd.org.uk/code/libtermkey")
388 (license license:expat)))
389
390 (define-public picocom
391 (package
392 (name "picocom")
393 (version "3.1")
394 (source (origin
395 (method git-fetch)
396 (uri (git-reference
397 (url "https://github.com/npat-efault/picocom")
398 (commit version)))
399 (file-name (git-file-name name version))
400 (sha256
401 (base32
402 "1vvjydqf0ax47nvdyyl67jafw5b3sfsav00xid6qpgia1gs2r72n"))))
403 (build-system gnu-build-system)
404 (arguments
405 `(#:make-flags '("CC=gcc")
406 #:tests? #f ; no tests
407 #:phases
408 (modify-phases %standard-phases
409 (delete 'configure) ; no configure script
410 (replace 'install
411 ;; The Makefile lacks an ‘install’ target.
412 (lambda* (#:key outputs #:allow-other-keys)
413 (let* ((out (assoc-ref outputs "out"))
414 (bin (string-append out "/bin"))
415 (man (string-append out "/share/man/man1")))
416 (install-file "picocom" bin)
417 (install-file "picocom.1" man)))))))
418 (home-page "https://github.com/npat-efault/picocom")
419 (synopsis "Minimal dumb-terminal emulator")
420 (description
421 "Picocom is a minimal dumb-terminal emulation program. It was designed to
422 serve as a simple and manual modem configuration, testing, and debugging tool.
423 It also serves well as a low-tech serial communications program to allow access
424 to all types of devices that provide serial consoles.")
425 (license license:gpl2+)))
426
427 (define-public beep
428 (package
429 (name "beep")
430 (version "1.4.9")
431 (source
432 (origin
433 (method git-fetch)
434 (uri (git-reference
435 ;; The original beep 1.3 at <http://www.johnath.com/beep> has been
436 ;; unmaintained for some time, and vulnerable to at least two CVEs:
437 ;; https://github.com/johnath/beep/issues/11#issuecomment-454056858
438 ;; Use this maintained fork instead.
439 (url "https://github.com/spkr-beep/beep")
440 (commit (string-append "v" version))))
441 (file-name (git-file-name name version))
442 (sha256
443 (base32 "0jmvqk6g5n0wzj9znw42njxq3mzw1769f4db99b83927hf4aidi4"))))
444 (build-system gnu-build-system)
445 (arguments
446 `(#:tests? #f ; no tests
447 #:make-flags
448 (list (string-append "prefix=" (assoc-ref %outputs "out"))
449 (string-append "pkgdocdir=$(docdir)/" ,name "-" ,version))
450 #:phases
451 (modify-phases %standard-phases
452 (delete 'configure)))) ; no configure script
453 (synopsis "Linux command-line utility to control the PC speaker")
454 (description "beep allows the user to control the PC speaker with precision,
455 allowing different sounds to indicate different events. While it can be run
456 quite happily on the command line, its intended place of residence is within
457 scripts, notifying the user when something interesting occurs. Of course, it
458 has no notion of what's interesting, but it's very good at that notifying part.")
459 (home-page "https://github.com/spkr-beep/beep")
460 (license license:gpl2+)))
461
462 (define-public unibilium
463 (package
464 (name "unibilium")
465 (version "2.0.0")
466 (source
467 (origin
468 (method git-fetch)
469 (uri (git-reference
470 (url "https://github.com/mauke/unibilium")
471 (commit (string-append "v" version))))
472 (file-name (git-file-name name version))
473 (sha256
474 (base32
475 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
476 (build-system gnu-build-system)
477 (arguments
478 `(#:make-flags
479 (list "CC=gcc"
480 (string-append "PREFIX=" (assoc-ref %outputs "out")))
481 #:test-target "test"
482 ;; FIXME: tests require "prove"
483 #:tests? #f
484 #:phases
485 (modify-phases %standard-phases
486 (delete 'configure))))
487 (native-inputs
488 `(("libtool" ,libtool)
489 ("perl" ,perl)))
490 (home-page "https://github.com/mauke/unibilium")
491 (synopsis "Terminfo parsing library")
492 (description "Unibilium is a basic C terminfo library. It doesn't depend
493 on curses or any other library. It also doesn't use global variables, so it
494 should be thread-safe.")
495 (license license:lgpl3+)))
496
497 (define-public libvterm
498 (package
499 (name "libvterm")
500 (version "0.1.4")
501 (source
502 (origin
503 (method url-fetch)
504 (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
505 "libvterm-" version ".tar.gz"))
506 (sha256
507 (base32
508 "1pfkhbbihd2kvaza707vl2nvk7bxaawmb37wf9v6d72mjng38w5w"))))
509 (build-system gnu-build-system)
510 (arguments
511 `(#:make-flags
512 (list "CC=gcc"
513 (string-append "PREFIX=" (assoc-ref %outputs "out")))
514 #:test-target "test"
515 #:phases
516 (modify-phases %standard-phases
517 (delete 'configure))))
518 (native-inputs
519 `(("libtool" ,libtool)
520 ("perl" ,perl)))
521 (home-page "http://www.leonerd.org.uk/code/libvterm/")
522 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
523 (description "Libvterm is an abstract C99 library which implements a VT220
524 or xterm-like terminal emulator. It doesn't use any particular graphics
525 toolkit or output system, instead it invokes callback function pointers that
526 its embedding program should provide it to draw on its behalf. It avoids
527 calling @code{malloc} during normal running state, allowing it to be used in
528 embedded kernel situations.")
529 (license license:expat)))
530
531 (define-public cool-retro-term
532 (let ((commit "1.1.1")
533 (revision "0")) ;not used currently
534 (package
535 (name "cool-retro-term")
536 (version "1.1.1")
537 (source (origin
538 (method git-fetch)
539 (file-name (string-append name "-" version "-checkout"))
540 (uri (git-reference
541 (url (string-append "https://github.com/Swordfish90/" name))
542 (commit commit)
543 (recursive? #t)))
544 (sha256
545 (base32 "0wb6anchxa5jpn9c73kr4byrf2xlj8x8qzc5x7ny6saj7kbbvp75"))
546 (modules '((guix build utils)
547 (srfi srfi-1)
548 (srfi srfi-26)
549 (ice-9 rdelim)
550 (ice-9 regex)))
551 (snippet
552 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
553 "1977-apple2" ; Non-Free
554 "1977-commodore-pet" ; Non-Free
555 "1979-atari-400-800" ; Non-Free
556 ;"1981-ibm-pc ; CC-SA 4.0
557 "1982-commodore64")) ; Non-Free
558 ;"1985-ibm-pc-vga" ; CC-SA 4.0
559 ;"modern-fixedsys-excelsior" ; Redistributable
560 ;"modern-hermit" ; SIL
561 ;"modern-inconsolata"; SIL
562 ;"modern-pro-font-win-tweaked" ; X11
563 ;"modern-proggy-tiny"; X11
564 ;"modern-terminus" ; SIL
565 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
566 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
567 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
568 (names
569 ;; Gather font names from all Fonts*.qml files.
570 ;; These will be used to remove items from the
571 ;; default profiles.
572 (fold
573 (lambda (font-file names)
574 (call-with-input-file font-file
575 (lambda (port)
576 (let loop ((name #f) (names names))
577 (let ((line (read-line port)))
578 (cond
579 ((eof-object? line) (pk 'names names))
580 ((regexp-exec name-rx line)
581 => (lambda (m)
582 (loop (match:substring m 1) names)))
583 ((regexp-exec source-rx line)
584 => (lambda (m)
585 (let ((font (match:substring m 1)))
586 (if (member font fonts)
587 (loop #f (lset-adjoin string=?
588 names name))
589 (loop #f names)))))
590 (else (loop name names))))))))
591 '() (find-files "app/qml" "Font.*\\.qml"))))
592 ;; Remove the font files themselves
593 (for-each (lambda (font)
594 (delete-file-recursively
595 (string-append "app/qml/fonts/" font)))
596 fonts)
597 ;; Remove mention of those fonts in the source
598 (substitute* "app/qml/resources.qrc"
599 (((string-append " *<file>fonts/("
600 (string-join fonts "|")
601 ").*"))
602 ""))
603 (for-each
604 (lambda (file)
605 (let ((start-rx (make-regexp " *ListElement\\{"))
606 (end-rx (make-regexp " *\\}")))
607 (with-atomic-file-replacement file
608 (lambda (in out)
609 (let loop ((line-buffer '())
610 (hold? #f)
611 (discard? #f))
612 (let ((line (read-line in 'concat)))
613 (cond
614 ((eof-object? line) #t) ;done
615 ((regexp-exec start-rx line)
616 (loop (cons line line-buffer) #t #f))
617 ((or (regexp-exec source-rx line)
618 (regexp-exec fontname-rx line))
619 => (lambda (m)
620 (let ((font-or-name (match:substring m 1)))
621 (if (or (member font-or-name fonts)
622 (member font-or-name names))
623 (loop '() #f #t)
624 (loop (cons line line-buffer)
625 hold? #f)))))
626 ((regexp-exec end-rx line)
627 (unless discard?
628 (for-each (cut display <> out)
629 (reverse line-buffer))
630 (display line out))
631 (loop '() #f #f))
632 (hold? (loop (cons line line-buffer)
633 hold? discard?))
634 (discard? (loop line-buffer #f #t))
635 (else (display line out)
636 (loop '() #f #f)))))))))
637 '("app/qml/FontPixels.qml"
638 "app/qml/FontScanlines.qml"
639 "app/qml/Fonts.qml"
640 "app/qml/ApplicationSettings.qml"))
641 ;; Final substitution for default scanline and pixel fonts
642 (substitute* "app/qml/ApplicationSettings.qml"
643 (("COMMODORE_PET") "PROGGY_TINY"))
644 #t))))
645 (build-system gnu-build-system)
646 (inputs
647 `(("qtbase" ,qtbase)
648 ("qtdeclarative" ,qtdeclarative)
649 ("qtgraphicaleffects" ,qtgraphicaleffects)
650 ("qtquickcontrols" ,qtquickcontrols)))
651 (arguments
652 `(#:phases
653 (modify-phases %standard-phases
654 (replace 'configure
655 (lambda* (#:key outputs #:allow-other-keys)
656 (let ((out (assoc-ref outputs "out")))
657 (substitute* '("qmltermwidget/qmltermwidget.pro")
658 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
659 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
660 (substitute* '("cool-retro-term.pro" "app/app.pro")
661 (("/usr") out))
662 (invoke "qmake"))))
663 (add-after 'install 'wrap-executable
664 (lambda* (#:key inputs outputs #:allow-other-keys)
665 (let ((out (assoc-ref outputs "out"))
666 (qml "/lib/qt5/qml"))
667 (wrap-program (string-append out "/bin/cool-retro-term")
668 `("QML2_IMPORT_PATH" ":" prefix
669 (,(string-append out qml)
670 ,@(map (lambda (i)
671 (string-append (assoc-ref inputs i) qml))
672 '("qtdeclarative"
673 "qtgraphicaleffects"
674 "qtquickcontrols")))))
675 #t)))
676 (add-after 'install 'add-alternate-name
677 (lambda* (#:key outputs #:allow-other-keys)
678 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
679 (symlink (string-append bin "/cool-retro-term")
680 (string-append bin "/crt"))
681 #t)))
682 (add-after 'install 'install-man
683 (lambda* (#:key outputs #:allow-other-keys)
684 (let ((mandir (string-append (assoc-ref outputs "out")
685 "/share/man/man1")))
686 (install-file "packaging/debian/cool-retro-term.1" mandir)
687 #t))))))
688 (synopsis "Terminal emulator")
689 (description
690 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
691 feel of the old cathode ray tube (CRT) screens. It has been designed to be
692 eye-candy, customizable, and reasonably lightweight.")
693 (home-page "https://github.com/Swordfish90/cool-retro-term")
694 (license (list
695 license:gpl2+ ; qmltermwidget
696 license:gpl3+ ; cool-retro-term
697 ;; Fonts
698 license:silofl1.1
699 license:x11
700 license:bsd-3)))))
701
702 (define-public foot
703 (package
704 (name "foot")
705 (version "1.5.4")
706 (home-page "https://codeberg.org/dnkl/foot")
707 (source (origin
708 (method git-fetch)
709 (uri (git-reference (url home-page) (commit version)))
710 (file-name (git-file-name name version))
711 (sha256
712 (base32
713 "0y6xfsldz5lwy6kp5dy9s27pnii7n5zj754wglvz9d9fp5lkl6id"))))
714 (build-system meson-build-system)
715 (arguments
716 `(#:meson ,meson-0.55
717 ;; Using a "release" build is recommended both for performance, and
718 ;; also to address a GCC 10 issue when doing PGO builds.
719 #:build-type "release"
720 ;; Enable LTO as recommended by INSTALL.md.
721 #:configure-flags '("-Db_lto=true")))
722 (native-inputs
723 `(;; Foot makes use of modern C features and needs a newer compiler.
724 ;; Remove when the default compiler is > GCC 7.
725 ("gcc" ,gcc-10)
726 ("ncurses" ,ncurses) ;for 'tic'
727 ("pkg-config" ,pkg-config)
728 ("scdoc" ,scdoc)
729 ("wayland-protocols" ,wayland-protocols)))
730 (inputs
731 `(("fcft" ,fcft)
732 ("libxkbcommon" ,libxkbcommon)
733 ("wayland" ,wayland)))
734 (synopsis "Wayland-native terminal emulator")
735 (description
736 "@command{foot} is a terminal emulator for systems using the Wayland
737 display server. It is designed to be fast, lightweight, and independent of
738 desktop environments. It can be used as a standalone terminal and also has
739 a server/client mode.")
740 (license license:expat)))
741
742 (define-public sakura
743 (package
744 (name "sakura")
745 (version "3.7.1")
746 (source (origin
747 (method url-fetch)
748 (uri (string-append "https://launchpad.net/sakura/trunk/"
749 version "/+download/sakura-" version
750 ".tar.bz2"))
751 (sha256
752 (base32
753 "12wjmckf03qbnm8cb7qma0980anzajn3l92rj2yr8hhafl74x6kj"))))
754 (build-system cmake-build-system)
755 (arguments
756 '(#:tests? #f)) ; no check phase
757 (native-inputs
758 `(("gettext" ,gettext-minimal)
759 ("perl" ,perl) ; for pod2man
760 ("pkg-config" ,pkg-config)))
761 (inputs
762 `(("libxft" ,libxft)
763 ("vte" ,vte)))
764 (home-page "https://launchpad.net/sakura")
765 (synopsis "A simple but powerful libvte-based terminal emulator")
766 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
767 It's a terminal emulator with few dependencies, so you don't need a full GNOME
768 desktop installed to have a decent terminal emulator.")
769 (license license:gpl2)))
770
771 (define-public go-github.com-nsf-termbox-go
772 (let ((commit "288510b9734e30e7966ec2f22b87c5f8e67345e3")
773 (revision "1"))
774 (package
775 (name "go-github.com-nsf-termbox-go")
776 (version (git-version "0.0.0" revision commit))
777 (source (origin
778 (method git-fetch)
779 (uri (git-reference
780 (url "https://github.com/nsf/termbox-go")
781 (commit commit)))
782 (file-name (git-file-name name version))
783 (sha256
784 (base32
785 "0hdyisfaf8yb55h3p03p4sbq19546mp9fy28f2kn659mycmhxqk4"))))
786 (build-system go-build-system)
787 (arguments
788 '(#:import-path "github.com/nsf/termbox-go"))
789 (propagated-inputs
790 `(("go-github.com-mattn-go-runewidth"
791 ,go-github.com-mattn-go-runewidth)))
792 (synopsis "@code{termbox} provides a minimal API for text-based user
793 interfaces")
794 (description
795 "Termbox is a library that provides a minimalistic API which allows the
796 programmer to write text-based user interfaces.")
797 (home-page "https://github.com/nsf/termbox-go")
798 (license license:expat))))
799
800 (define-public go-github-com-junegunn-fzf
801 (package
802 (name "go-github-com-junegunn-fzf")
803 (version "0.22.0")
804 (source
805 (origin
806 (method git-fetch)
807 (uri (git-reference
808 (url "https://github.com/junegunn/fzf")
809 (commit version)))
810 (file-name (git-file-name name version))
811 (sha256
812 (base32
813 "0n0cy5q2r3dm1a3ivlzrv9c5d11awxlqim5b9x8zc85dlr73n35l"))))
814 (build-system go-build-system)
815 (arguments
816 `(#:import-path "github.com/junegunn/fzf"))
817 (inputs
818 `(("go-github.com-mattn-go-runewidth" ,go-github.com-mattn-go-runewidth)
819 ("go-github-com-mattn-go-shellwords" ,go-github-com-mattn-go-shellwords)
820 ("go-github-com-mattn-go-isatty" ,go-github-com-mattn-go-isatty)
821 ("go-github-com-gdamore-tcell" ,go-github-com-gdamore-tcell)
822 ("go-github-com-saracen-walker" ,go-github-com-saracen-walker)
823 ("go-golang.org-x-sync-errgroup" ,go-golang.org-x-sync-errgroup)
824 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)))
825 (home-page "https://github.com/junegunn/fzf")
826 (synopsis "Command-line fuzzy-finder")
827 (description "This package provides an interactive command-line filter
828 usable with any list--including files, command history, processes and more.")
829 (license license:expat)))
830
831 (define-public go-github.com-howeyc-gopass
832 (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
833 (revision "0"))
834 (package
835 (name "go-github.com-howeyc-gopass")
836 (version (git-version "0.0.0" revision commit))
837 (source (origin
838 (method git-fetch)
839 (uri (git-reference
840 (url "https://github.com/howeyc/gopass")
841 (commit commit)))
842 (file-name (git-file-name name version))
843 (sha256
844 (base32
845 "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
846 (build-system go-build-system)
847 (arguments
848 '(#:import-path "github.com/howeyc/gopass"))
849 (propagated-inputs
850 `(("go-golang-org-x-crypto"
851 ,go-golang-org-x-crypto)))
852 (synopsis "Retrieve password from a terminal or piped input in Go")
853 (description
854 "@code{gopass} is a Go package for retrieving a password from user
855 terminal or piped input.")
856 (home-page "https://github.com/howeyc/gopass")
857 (license license:isc))))
858
859 (define-public python-pyte
860 (package
861 (name "python-pyte")
862 (version "0.7.0")
863 (source
864 (origin
865 (method url-fetch)
866 (uri (pypi-uri "pyte" version))
867 (sha256
868 (base32
869 "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
870 (build-system python-build-system)
871 (arguments
872 '(#:phases
873 (modify-phases %standard-phases
874 (add-after 'unpack 'remove-failing-test
875 ;; TODO: Reenable when the `captured` files required by this test
876 ;; are included in the archive.
877 (lambda _
878 (delete-file "tests/test_input_output.py")
879 #t)))))
880 (propagated-inputs
881 `(("python-wcwidth" ,python-wcwidth)))
882 (native-inputs
883 `(("python-pytest-runner" ,python-pytest-runner)
884 ("python-pytest" ,python-pytest)))
885 (home-page "https://pyte.readthedocs.io/")
886 (synopsis "Simple VTXXX-compatible terminal emulator")
887 (description "@code{pyte} is an in-memory VTxxx-compatible terminal
888 emulator. @var{VTxxx} stands for a series of video terminals, developed by
889 DEC between 1970 and 1995. The first and probably most famous one was the
890 VT100 terminal, which is now a de-facto standard for all virtual terminal
891 emulators.
892
893 pyte is a fork of vt102, which was an incomplete pure Python implementation
894 of VT100 terminal.")
895 (license license:lgpl3+)))
896
897 (define-public python2-pyte
898 (package-with-python2 python-pyte))
899
900 (define-public python-blessings
901 (package
902 (name "python-blessings")
903 (version "1.7")
904 (source
905 (origin
906 (method url-fetch)
907 (uri (pypi-uri "blessings" version))
908 (sha256
909 (base32
910 "0z8mgkbmisxs10rz88qg46l1c9a8n08k8cy2iassal2zh16qbrcq"))))
911 (build-system python-build-system)
912 (arguments
913 ;; FIXME: Test suite is unable to detect TTY conditions.
914 `(#:tests? #f))
915 (native-inputs
916 `(("python-nose" ,python-nose)
917 ("python-six" ,python-six)))
918 (home-page "https://github.com/erikrose/blessings")
919 (synopsis "Python module to manage terminal color, styling, and
920 positioning")
921 (description "Blessings is a pythonic API to manipulate terminal color,
922 styling, and positioning. It provides similar features to curses but avoids
923 some of curses’s limitations: it does not require clearing the whole screen
924 for little changes, provides a scroll-back buffer after the program exits, and
925 avoids styling altogether when the output is redirected to something other
926 than a terminal.")
927 (license license:expat)))
928
929 (define-public python2-blessings
930 (package-with-python2 python-blessings))
931
932 (define-public python-curtsies
933 (package
934 (name "python-curtsies")
935 (version "0.3.4")
936 (source
937 (origin
938 (method url-fetch)
939 (uri (pypi-uri "curtsies" version))
940 (sha256
941 (base32
942 "019bpf5wmng4f6ic2ykg893ypfihpfvzi6dhblcagfwbincl79ac"))))
943 (build-system python-build-system)
944 (arguments
945 `(#:phases
946 (modify-phases %standard-phases
947 (replace 'check
948 (lambda _
949 (invoke "nosetests" "-v"))))))
950 (propagated-inputs
951 `(("python-blessings" ,python-blessings)
952 ("python-wcwidth" ,python-wcwidth)))
953 (native-inputs
954 `(("python-mock" ,python-mock)
955 ("python-pyte" ,python-pyte)
956 ("python-nose" ,python-nose)))
957 (home-page "https://github.com/bpython/curtsies")
958 (synopsis "Library for curses-like terminal interaction with colored
959 strings")
960 (description "Curtsies is a Python library for interacting with the
961 terminal. It features string-like objects which carry formatting information,
962 per-line fullscreen terminal rendering, and keyboard input event reporting.")
963 (license license:expat)))
964
965 (define-public tmate
966 (package
967 (name "tmate")
968 (version "2.4.0")
969 (source
970 (origin
971 (method git-fetch)
972 (uri (git-reference
973 (url "https://github.com/tmate-io/tmate")
974 (commit version)))
975 (file-name (git-file-name name version))
976 (sha256
977 (base32
978 "0x5c31yq7ansmiy20a0qf59wagba9v3pq97mlkxrqxn4n1gcc6vi"))))
979 (build-system gnu-build-system)
980 (inputs
981 `(("libevent" ,libevent)
982 ("libssh" ,libssh)
983 ("msgpack" ,msgpack)
984 ("ncurses" ,ncurses)))
985 (native-inputs
986 `(("autoconf" ,autoconf)
987 ("automake" ,automake)
988 ("pkg-config" ,pkg-config)))
989 (home-page "https://tmate.io/")
990 (synopsis "Terminal sharing application")
991 (description "tmate is a terminal sharing application that allows you to
992 share your terminal with other users over the Internet. tmate is a fork of
993 tmux.")
994 (license license:isc)))
995
996 (define-public kitty
997 (package
998 (name "kitty")
999 (version "0.19.3")
1000 (home-page "https://sw.kovidgoyal.net/kitty/")
1001 (source
1002 (origin
1003 (method git-fetch)
1004 (uri (git-reference
1005 (url "https://github.com/kovidgoyal/kitty")
1006 (commit (string-append "v" version))))
1007 (file-name (git-file-name name version))
1008 (sha256
1009 (base32 "0r49bybqy6c0n1lz6yc85py80wb40w757m60f5rszjf200wnyl6s"))
1010 (modules '((guix build utils)))
1011 (snippet
1012 '(begin
1013 ;; patch needed as sphinx-build is used as a python script
1014 ;; whereas the guix package uses a bash script launching the
1015 ;; python script
1016 (substitute* "docs/conf.py"
1017 (("(from kitty.constants import str_version)" kitty-imp)
1018 (string-append "sys.path.append(\"..\")\n" kitty-imp)))
1019 (substitute* "docs/Makefile"
1020 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
1021 "SPHINXBUILD = sphinx-build\n"))
1022 #t))))
1023 (build-system gnu-build-system)
1024 (native-inputs
1025 `(("libdbus" ,dbus)
1026 ("libgl1-mesa" ,mesa)
1027 ("libxcursor" ,libxcursor)
1028 ("libxi" ,libxi)
1029 ("libxinerama" ,libxinerama)
1030 ("libxkbcommon" ,libxkbcommon)
1031 ("libxrandr" ,libxrandr)
1032 ("ncurses" ,ncurses) ;; for tic command
1033 ("pkg-config" ,pkg-config)
1034 ("sphinx" ,python-sphinx)
1035 ("wayland-protocols" ,wayland-protocols)))
1036 (inputs
1037 `(("fontconfig" ,fontconfig)
1038 ("freetype" ,freetype)
1039 ("harfbuzz" ,harfbuzz)
1040 ("lcms" ,lcms)
1041 ("libcanberra" ,libcanberra)
1042 ("libpng" ,libpng)
1043 ("pygments" ,python-pygments)
1044 ("python" ,python-wrapper)
1045 ("wayland" ,wayland)
1046 ("zlib" ,zlib)))
1047 (arguments
1048 '(#:phases (modify-phases %standard-phases
1049 (delete 'configure) ;no configure script
1050 (replace 'build
1051 (lambda* (#:key inputs #:allow-other-keys)
1052 ;; The "kitty" sub-directory must be writable prior to
1053 ;; configuration (e.g., un-setting updates).
1054 (for-each make-file-writable (find-files "kitty"))
1055
1056 (invoke "python3" "setup.py" "linux-package"
1057 ;; Do not phone home.
1058 "--update-check-interval=0"
1059 ;; Wayland backend requires EGL, which isn't
1060 ;; found out-of-the-box for some reason.
1061 (string-append "--egl-library="
1062 (assoc-ref inputs "libgl1-mesa")
1063 "/lib/libEGL.so.1"))))
1064 (replace 'check
1065 (lambda _
1066 ;; Fix "cannot find kitty executable" error when running
1067 ;; tests.
1068 (setenv "PATH" (string-append "linux-package/bin:"
1069 (getenv "PATH")))
1070 (invoke "python3" "test.py")))
1071 (add-before 'install 'rm-pycache
1072 ;; created python cache __pycache__ are non deterministic
1073 (lambda _
1074 (let ((pycaches (find-files "linux-package/"
1075 "__pycache__"
1076 #:directories? #t)))
1077 (for-each delete-file-recursively pycaches)
1078 #t)))
1079 (replace 'install
1080 (lambda _
1081 (let* ((out (assoc-ref %outputs "out"))
1082 (obin (string-append out "/bin"))
1083 (olib (string-append out "/lib"))
1084 (oshare (string-append out "/share")))
1085 (copy-recursively "linux-package/bin" obin)
1086 (copy-recursively "linux-package/share" oshare)
1087 (copy-recursively "linux-package/lib" olib)
1088 #t))))))
1089 (synopsis "Fast, featureful, GPU based terminal emulator")
1090 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1091 @itemize
1092 @item Offloads rendering to the GPU for lower system load and buttery smooth
1093 scrolling. Uses threaded rendering to minimize input latency.
1094 @item Supports all modern terminal features: graphics (images), unicode,
1095 true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1096 paste and several new terminal protocol extensions.
1097 @item Supports tiling multiple terminal windows side by side in different
1098 layouts without needing to use an extra program like tmux.
1099 @item Can be controlled from scripts or the shell prompt, even over SSH.
1100 @item Has a framework for Kittens, small terminal programs that can be used to
1101 extend kitty's functionality. For example, they are used for Unicode input,
1102 hints, and side-by-side diff.
1103 @item Supports startup sessions which allow you to specify the window/tab
1104 layout, working directories and programs to run on startup.
1105 @item Allows you to open the scrollback buffer in a separate window using
1106 arbitrary programs of your choice. This is useful for browsing the history
1107 comfortably in a pager or editor.
1108 @end itemize")
1109 (license license:gpl3+)))
1110
1111 (define-public eternalterminal
1112 (package
1113 (name "eternalterminal")
1114 (version "6.0.13")
1115 (source
1116 (origin
1117 (method git-fetch)
1118 (uri (git-reference
1119 (url "https://github.com/MisterTea/EternalTerminal")
1120 (commit (string-append "et-v" version))))
1121 (file-name (git-file-name name version))
1122 (sha256
1123 (base32 "0sb1hypg2276y8c2a5vivrkcxp70swddvhnd9h273if3kv6j879r"))))
1124 (build-system cmake-build-system)
1125 (arguments
1126 '(#:configure-flags '("-DBUILD_TEST=ON")
1127 #:phases
1128 (modify-phases %standard-phases
1129 (add-after 'unpack 'insert-googletests
1130 (lambda* (#:key inputs #:allow-other-keys)
1131 (let ((tests (assoc-ref inputs "googletest")))
1132 (copy-recursively tests "external/googletest"))
1133 #t)))))
1134 (inputs
1135 `(("gflags" ,gflags)
1136 ("libsodium" ,libsodium)
1137 ("protobuf" ,protobuf)))
1138 (native-inputs
1139 `(("googletest" ,(package-source googletest))))
1140 (home-page "https://mistertea.github.io/EternalTerminal/")
1141 (synopsis "Remote shell that reconnects without interrupting the session")
1142 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1143 automatically reconnects without interrupting the session. ET uses SSH to
1144 initialize a secure connection. Unlike SSH sessions, which must be killed and
1145 reconnected after a network outage an ET session will survive network outages
1146 and IP roaming. ET provides the same core functionality as @command{mosh},
1147 while also supporting native scrolling and @command{tmux} control mode
1148 (@code{tmux -CC}).")
1149 (license license:asl2.0)))
1150
1151 (define-public et
1152 (deprecated-package "et" eternalterminal))
1153
1154 (define-public wterm
1155 (package
1156 (name "wterm")
1157 (version "0.7")
1158 (source
1159 (origin
1160 (method git-fetch)
1161 (uri (git-reference
1162 (url "https://github.com/majestrate/wterm")
1163 (commit "0ae42717c08a85a6509214e881422c7fbe7ecc45")))
1164 (sha256
1165 (base32
1166 "0g4lzmc1w6na81i6hny32xds4xfig4xzswzfijyi6p93a1226dv0"))
1167 (file-name (git-file-name name version))))
1168 (build-system gnu-build-system)
1169 (native-inputs
1170 `(("pkg-config" ,pkg-config)))
1171 (inputs
1172 `(("fontconfig" ,fontconfig)
1173 ("freetype" ,freetype)
1174 ("libdrm" ,libdrm)
1175 ("libxkbcommon" ,libxkbcommon)
1176 ("ncurses" ,ncurses)
1177 ("pixman" ,pixman)
1178 ("wayland" ,wayland)))
1179 (arguments
1180 '(#:tests? #f
1181
1182 ;; Without -j1 it fails to find file libwld.a.
1183 #:parallel-build? #f
1184
1185 #:make-flags (list "CC=gcc"
1186 (string-append "PREFIX=" %output)
1187 (string-append "TERMINFO="
1188 (assoc-ref %outputs "out")
1189 "/share/terminfo"))
1190 #:phases
1191 (modify-phases %standard-phases
1192 (delete 'configure)
1193 (add-after 'unpack 'terminfo-fix
1194 (lambda _
1195 (substitute* "Makefile"
1196 (("\ttic .*") "\tmkdir -p $(SHARE_PREFIX)/share/terminfo
1197 \ttic -o $(SHARE_PREFIX)/share/terminfo -s wterm.info\n"))
1198 #t)))))
1199 (native-search-paths
1200 (list (search-path-specification
1201 (variable "TERMINFO_DIRS")
1202 (files '("share/terminfo")))))
1203 (home-page "https://github.com/majestrate/wterm")
1204 (synopsis "Terminal emulator for Wayland")
1205 (description "wterm is a native Wayland terminal emulator based on
1206 an st fork using wld. st is a simple terminal emulator for X originally
1207 made by suckless.")
1208 (license license:x11)))
1209
1210 (define-public alacritty
1211 (package
1212 (name "alacritty")
1213 (version "0.4.1")
1214 (source
1215 (origin
1216 (method git-fetch)
1217 (uri (git-reference
1218 (url "https://github.com/jwilm/alacritty")
1219 (commit (string-append "v" version))))
1220 (file-name (git-file-name name version))
1221 (sha256
1222 (base32 "05jcg33ifngpzw2hdhgb614j87ihhhlqgar0kky183rywg0dxikg"))
1223 (modules '((guix build utils)))
1224 (snippet
1225 ;; Don't use a custom location for winit-0.20-alpha6.
1226 '(begin (substitute* "Cargo.toml"
1227 (("winit .*") ""))
1228 #t))))
1229 (build-system cargo-build-system)
1230 (arguments
1231 `(#:cargo-inputs
1232 (("rust-clap" ,rust-clap-2)
1233 ("rust-log" ,rust-log-0.4)
1234 ("rust-time" ,rust-time-0.1)
1235 ("rust-env-logger" ,rust-env-logger-0.7)
1236 ("rust-serde" ,rust-serde-1)
1237 ("rust-serde-yaml" ,rust-serde-yaml-0.8)
1238 ("rust-serde-json" ,rust-serde-json-1)
1239 ("rust-glutin" ,rust-glutin-0.22) ; adjust 'patch-glutin-libgl-path as needed
1240 ("rust-notify" ,rust-notify-4)
1241 ("rust-libc" ,rust-libc-0.2)
1242 ("rust-unicode-width" ,rust-unicode-width-0.1)
1243 ("rust-parking-lot" ,rust-parking-lot-0.9)
1244 ("rust-urlocator" ,rust-urlocator-0.1)
1245 ("rust-xdg" ,rust-xdg-2.2)
1246 ("rust-image" ,rust-image-0.22)
1247 ("rust-dirs" ,rust-dirs-2.0)
1248 ("rust-x11-dl" ,rust-x11-dl-2)
1249 ("rust-winapi" ,rust-winapi-0.3)
1250 ("rust-base64" ,rust-base64-0.11)
1251 ("rust-bigflags" ,rust-bitflags-1)
1252 ("rust-fnv" ,rust-fnv-1)
1253 ("rust-mio" ,rust-mio-0.6)
1254 ("rust-mio-extras" ,rust-mio-extras-2)
1255 ("rust-terminfo" ,rust-terminfo-0.6)
1256 ("rust-url" ,rust-url-2)
1257 ("rust-vte" ,rust-vte-0.3)
1258 ("rust-nix" ,rust-nix-0.15)
1259 ("rust-miow" ,rust-miow-0.3)
1260 ("rust-mio-anonymous-pipes" ,rust-mio-anonymous-pipes-0.1)
1261 ("rust-mio-named-pipes" ,rust-mio-named-pipes-0.1)
1262 ("rust-signal-hook" ,rust-signal-hook-0.1)
1263 ("rust-clipboard-win" ,rust-clipboard-win-2.1)
1264 ("rust-objc" ,rust-objc-0.2)
1265 ("rust-objc-id" ,rust-objc-id-0.1)
1266 ("rust-objc-foundation" ,rust-objc-foundation-0.1)
1267 ("rust-x11-clipboard" ,rust-x11-clipboard-0.4)
1268 ("rust-smithay-clipboard" ,rust-smithay-clipboard-0.3)
1269 ("rust-wayland-client" ,rust-wayland-client-0.23)
1270 ("rust-euclid" ,rust-euclid-0.20)
1271 ("rust-foreign-types" ,rust-foreign-types-0.5)
1272 ("rust-servo-fontconfig" ,rust-servo-fontconfig-0.4)
1273 ("rust-freetype-rs" ,rust-freetype-rs-0.23)
1274 ("rust-core-foundation" ,rust-core-foundation-0.6)
1275 ("rust-core-foundation-sys" ,rust-core-foundation-sys-0.6)
1276 ("rust-core-text" ,rust-core-text-13)
1277 ("rust-core-graphics" ,rust-core-graphics-0.17)
1278 ("rust-dwrote" ,rust-dwrote-0.9)
1279 ("rust-winpty-sys" ,rust-winpty-sys-0.4))
1280 #:cargo-development-inputs
1281 (("rust-rustc-tools-util" ,rust-rustc-tools-util-0.2)
1282 ("rust-gl-generator" ,rust-gl-generator-0.14)
1283 ("rust-andrew" ,rust-andrew-0.2)
1284 ("rust-smithay-client-toolkit" ,rust-smithay-client-toolkit-0.6)
1285 ("rust-embed-resource" ,rust-embed-resource-1.3)
1286 ("rust-http-req" ,rust-http-req-0.5)
1287 ("rust-zip" ,rust-zip-0.5)
1288 ("rust-tempfile" ,rust-tempfile-3)
1289 ("rust-named-pipe" ,rust-named-pipe-0.4)
1290 ("rust-winapi" ,rust-winapi-0.3))
1291 #:phases
1292 (modify-phases %standard-phases
1293 (add-after 'configure 'add-absolute-library-references
1294 (lambda* (#:key inputs cargo-inputs vendor-dir #:allow-other-keys)
1295 (let* ((glutin-name ,(package-name rust-glutin-0.22))
1296 (glutin-version ,(package-version rust-glutin-0.22))
1297 (glutin-api (string-append glutin-name "-" glutin-version
1298 ".tar.gz/src/api/"))
1299 (smithay-client-toolkit-name
1300 ,(package-name rust-smithay-client-toolkit-0.6))
1301 (smithay-client-toolkit-version
1302 ,(package-version rust-smithay-client-toolkit-0.6))
1303 (smithay-client-toolkit-src
1304 (string-append smithay-client-toolkit-name "-"
1305 smithay-client-toolkit-version ".tar.gz/src"))
1306 (wayland-sys-name ,(package-name rust-wayland-sys-0.23))
1307 (wayland-sys-version ,(package-version rust-wayland-sys-0.23))
1308 (wayland-sys-src (string-append wayland-sys-name "-"
1309 wayland-sys-version
1310 ".tar.gz/src"))
1311 (libxkbcommon (assoc-ref inputs "libxkbcommon"))
1312 (libwayland (assoc-ref inputs "wayland"))
1313 (mesa (assoc-ref inputs "mesa")))
1314 (substitute* (string-append vendor-dir "/" glutin-api "glx/mod.rs")
1315 (("libGL.so") (string-append mesa "/lib/libGL.so")))
1316 (substitute* (string-append vendor-dir "/" glutin-api "egl/mod.rs")
1317 (("libEGL.so") (string-append mesa "/lib/libEGL.so")))
1318 (substitute* (string-append vendor-dir "/"
1319 smithay-client-toolkit-src
1320 "/keyboard/ffi.rs")
1321 (("libxkbcommon\\.so")
1322 (string-append libxkbcommon "/lib/libxkbcommon.so")))
1323 (substitute* (string-append vendor-dir "/" wayland-sys-src
1324 "/server.rs")
1325 (("libwayland-server\\.so")
1326 (string-append libwayland "/lib/libwayland-server.so")))
1327 (substitute* (string-append vendor-dir "/" wayland-sys-src
1328 "/cursor.rs")
1329 (("libwayland-cursor\\.so")
1330 (string-append libwayland "/lib/libwayland-cursor.so")))
1331 (substitute* (string-append vendor-dir "/" wayland-sys-src
1332 "/egl.rs")
1333 (("libwayland-egl\\.so")
1334 (string-append libwayland "/lib/libwayland-egl.so")))
1335 (substitute* (string-append vendor-dir "/" wayland-sys-src
1336 "/client.rs")
1337 (("libwayland-client\\.so")
1338 (string-append libwayland "/lib/libwayland-client.so")))
1339 #t)))
1340 (add-after 'configure 'remove-alacritty-vendor
1341 (lambda* (#:key vendor-dir #:allow-other-keys)
1342 ;; We don't want Alacritty to be a dependency of itself
1343 ;; If we don't delete it from guix-vendor then build will fail
1344 ;; because Alacritty has a virtual workspace Cargo.toml.
1345 (delete-file-recursively
1346 (string-append vendor-dir "/alacritty-" ,version ".tar.xz"))
1347 #t))
1348 (replace 'install
1349 (lambda* (#:key inputs outputs #:allow-other-keys)
1350 (let* ((out (assoc-ref outputs "out"))
1351 (bin (string-append out "/bin"))
1352 (share (string-append out "/share"))
1353 (icons (string-append share "/icons/hicolor/scalable/apps"))
1354 (tic (string-append (assoc-ref inputs "ncurses") "/bin/tic"))
1355 (man (string-append share "/man/man1"))
1356 (alacritty-bin "target/release/alacritty"))
1357
1358 ;; Install the executable.
1359 (install-file alacritty-bin bin)
1360
1361 ;; Install man pages.
1362 (mkdir-p man)
1363 (copy-file "extra/alacritty.man"
1364 (string-append man "/alacritty.1"))
1365
1366 ;; Install desktop file.
1367 (install-file "extra/linux/alacritty.desktop"
1368 (string-append share "/applications"))
1369
1370 ;; Install icon
1371 (mkdir-p icons)
1372 (copy-file "extra/logo/alacritty-term.svg"
1373 (string-append icons "/Alacritty.svg"))
1374
1375 ;; Install terminfo.
1376 (mkdir-p (string-append share "/terminfo"))
1377 ;; We don't compile alacritty-common entry because
1378 ;; it's being used only for inheritance.
1379 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1380 "-o" (string-append share "/terminfo/")
1381 "extra/alacritty.info")
1382
1383 ;; Install completions.
1384 (install-file
1385 "extra/completions/alacritty.bash"
1386 (string-append out "/etc/bash_completion.d"))
1387 (install-file
1388 "extra/completions/_alacritty"
1389 (string-append share "/zsh/site-functions"))
1390 (install-file
1391 "extra/completions/alacritty.fish"
1392 (string-append share "/fish/vendor_completions.d"))
1393 #t))))))
1394 (inputs
1395 `(("expat" ,expat)
1396 ("fontconfig" ,fontconfig)
1397 ("freetype" ,freetype)
1398 ("libx11" ,libx11)
1399 ("libxcb" ,libxcb)
1400 ("libxcursor" ,libxcursor)
1401 ("libxi" ,libxi)
1402 ("libxkbcommon" ,libxkbcommon)
1403 ("libxrandr" ,libxrandr)
1404 ("libxxf86vm" ,libxxf86vm)
1405 ("wayland" ,wayland)
1406 ("mesa" ,mesa)))
1407 (native-inputs
1408 `(("cmake" ,cmake)
1409 ("ncurses" ,ncurses)
1410 ("pkg-config" ,pkg-config)
1411 ("python3" ,python)))
1412 (native-search-paths
1413 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1414 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1415 (list (search-path-specification
1416 (variable "TERMINFO_DIRS")
1417 (files '("share/terminfo")))))
1418 (home-page "https://github.com/alacritty/alacritty")
1419 (synopsis "GPU-accelerated terminal emulator")
1420 (description
1421 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1422 simplicity and performance. With such a strong focus on performance, included
1423 features are carefully considered and you can always expect Alacritty to be
1424 blazingly fast. By making sane choices for defaults, Alacritty requires no
1425 additional setup. However, it does allow configuration of many aspects of the
1426 terminal. Note that you need support for OpenGL 3.2 or higher.")
1427 (license license:asl2.0)))
1428
1429 (define-public bootterm
1430 (package
1431 (name "bootterm")
1432 (version "0.2")
1433 (source (origin
1434 (method git-fetch)
1435 (uri (git-reference
1436 (url "https://github.com/wtarreau/bootterm")
1437 (commit (string-append "v" version))))
1438 (file-name (git-file-name name version))
1439 (sha256
1440 (base32
1441 "08yb4kiid3028cqsx7wzyrzk46asphxlxlj1y141hi245wbql55n"))))
1442 (build-system gnu-build-system)
1443 (arguments
1444 `(#:tests? #f ; no test suite
1445 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1446 (string-append "PREFIX=" (assoc-ref %outputs "out")))
1447 #:phases
1448 (modify-phases %standard-phases
1449 ;; No ./configure script
1450 (delete 'configure)
1451 (add-after 'install 'install-doc
1452 (lambda* (#:key outputs #:allow-other-keys)
1453 (let* ((out (assoc-ref outputs "out"))
1454 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1455 (install-file "README.md" doc)
1456 #t))))))
1457 (home-page "https://github.com/wtarreau/bootterm")
1458 (synopsis "Serial terminal")
1459 (description "Bootterm is a terminal designed to ease connection to
1460 ephemeral serial ports. It features automatic port detection, port enumeration,
1461 support for non-standard baud rates, the ability to wait for ports to appear,
1462 and the ability to read and write via stdin and stdout.")
1463 (license license:expat)))