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