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