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