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