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