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