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