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