projects/guix·blob ruby-team · refs

2007 lines · 83.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015-2021, 2023-2026 Efraim Flashner <[email protected]>
3;;; Copyright © 2016 Mckinley Olsen <[email protected]>
4;;; Copyright © 2016, 2017, 2019 Alex Griffin <[email protected]>
5;;; Copyright © 2016 David Craven <[email protected]>
6;;; Copyright © 2016-2017, 2019-2020, 2025 Ludovic Courtès <[email protected]>
7;;; Copyright © 2016, 2017 José Miguel Sánchez García <[email protected]>
8;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <[email protected]>
9;;; Copyright © 2017 Kei Kebreau <[email protected]>
10;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <[email protected]>
11;;; Copyright © 2017 Petter <[email protected]>
12;;; Copyright © 2018 Hartmut Goebel <[email protected]>
13;;; Copyright © 2018 Arun Isaac <[email protected]>
14;;; Copyright © 2018 Gabriel Hondet <[email protected]>
15;;; Copyright © 2019 Rutger Helling <[email protected]>
16;;; Copyright © 2018, 2019, 2021 Eric Bavier <[email protected]>
17;;; Copyright © 2019 Julien Lepiller <[email protected]>
18;;; Copyright © 2019, 2021 Pierre Langlois <[email protected]>
19;;; Copyright © 2019, 2020 Brett Gilio <[email protected]>
20;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
21;;; Copyright © 2020 Valentin Ignatev <[email protected]>
22;;; Copyright © 2020 Michael Rohleder <[email protected]>
23;;; Copyright © 2020, 2021 Marius Bakke <[email protected]>
24;;; Copyright © 2020, 2021 Nicolas Goaziou <[email protected]>
25;;; Copyright © 2020 Leo Famulari <[email protected]>
26;;; Copyright © 2020 luhux <[email protected]>
27;;; Copyright © 2021 Ekaitz Zarraga <[email protected]>
28;;; Copyright © 2021, 2022, 2024 Raphaël Mélotte <[email protected]>
29;;; Copyright © 2021 ikasero <[email protected]>
30;;; Copyright © 2021 Brice Waegeneire <[email protected]>
31;;; Copyright © 2021 Solene Rapenne <[email protected]>
32;;; Copyright © 2021 Petr Hodina <[email protected]>
33;;; Copyright © 2022 Felipe Balbi <[email protected]>
34;;; Copyright © 2022 ( <[email protected]>
35;;; Copyright © 2022, 2023 jgart <[email protected]>
36;;; Copyright © 2023 Aaron Covrig <[email protected]>
37;;; Copyright © 2023 Foundation Devices, Inc. <[email protected]>
38;;; Copyright © 2023, 2024 Zheng Junjie <[email protected]>
39;;; Copyright © 2023 Jaeme Sifat <[email protected]>
40;;; Copyright © 2024 Suhail <[email protected]>
41;;; Copyright © 2024 Clément Lassieur <[email protected]>
42;;; Copyright © 2024-2026 Ashish SHUKLA <[email protected]>
43;;; Copyright © 2024 Ashvith Shetty <[email protected]>
44;;; Copyright © 2024, 2025-2026 Artyom V. Poptsov <[email protected]>
45;;; Copyright © 2025 Roman Scherer <[email protected]>
46;;; Copyright © 2025 Liam Hupfer <[email protected]>
47;;; Copyright © 2026 Janneke Nieuwenhuizen <[email protected]>
48;;; Copyright © 2026 Nemin <[email protected]>
49;;;
50;;; This file is part of GNU Guix.
51;;;
52;;; GNU Guix is free software; you can redistribute it and/or modify it
53;;; under the terms of the GNU General Public License as published by
54;;; the Free Software Foundation; either version 3 of the License, or (at
55;;; your option) any later version.
56;;;
57;;; GNU Guix is distributed in the hope that it will be useful, but
58;;; WITHOUT ANY WARRANTY; without even the implied warranty of
59;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60;;; GNU General Public License for more details.
61;;;
62;;; You should have received a copy of the GNU General Public License
63;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
64
65(define-module (gnu packages terminals)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix build-system cargo)
68 #:use-module (guix build-system cmake)
69 #:use-module (guix build-system copy)
70 #:use-module (guix build-system gnu)
71 #:use-module (guix build-system glib-or-gtk)
72 #:use-module (guix build-system go)
73 #:use-module (guix build-system meson)
74 #:use-module (guix build-system pyproject)
75 #:use-module (guix download)
76 #:use-module (guix git-download)
77 #:use-module (guix gexp)
78 #:use-module (guix packages)
79 #:use-module (guix utils)
80 #:use-module (gnu packages)
81 #:use-module (gnu packages assembly)
82 #:use-module (gnu packages autotools)
83 #:use-module (gnu packages base)
84 #:use-module (gnu packages bash)
85 #:use-module (gnu packages check)
86 #:use-module (gnu packages compression)
87 #:use-module (gnu packages crypto)
88 #:use-module (gnu packages curl)
89 #:use-module (gnu packages dlang)
90 #:use-module (gnu packages digest)
91 #:use-module (gnu packages docbook)
92 #:use-module (gnu packages elf)
93 #:use-module (gnu packages fcitx5)
94 #:use-module (gnu packages fonts)
95 #:use-module (gnu packages fontutils)
96 #:use-module (gnu packages freedesktop)
97 #:use-module (gnu packages fribidi)
98 #:use-module (gnu packages gettext)
99 #:use-module (gnu packages ghostscript)
100 #:use-module (gnu packages gl)
101 #:use-module (gnu packages glib)
102 #:use-module (gnu packages gnome)
103 #:use-module (gnu packages golang)
104 #:use-module (gnu packages golang-build)
105 #:use-module (gnu packages golang-crypto)
106 #:use-module (gnu packages golang-compression)
107 #:use-module (gnu packages golang-maths)
108 #:use-module (gnu packages golang-xyz)
109 #:use-module (gnu packages golang-check)
110 #:use-module (gnu packages gtk)
111 #:use-module (gnu packages imagemagick)
112 #:use-module (gnu packages image)
113 #:use-module (gnu packages libcanberra)
114 #:use-module (gnu packages libevent)
115 #:use-module (gnu packages libunwind)
116 #:use-module (gnu packages linux)
117 #:use-module (gnu packages lua)
118 #:use-module (gnu packages man)
119 #:use-module (gnu packages ncurses)
120 #:use-module (gnu packages pcre)
121 #:use-module (gnu packages perl)
122 #:use-module (gnu packages perl-check)
123 #:use-module (gnu packages pkg-config)
124 #:use-module (gnu packages popt)
125 #:use-module (gnu packages protobuf)
126 #:use-module (gnu packages python)
127 #:use-module (gnu packages python-build)
128 #:use-module (gnu packages python-check)
129 #:use-module (gnu packages python-xyz)
130 #:use-module (gnu packages qt)
131 #:use-module (gnu packages rsync)
132 #:use-module (gnu packages serialization)
133 #:use-module (gnu packages sphinx)
134 #:use-module (gnu packages sqlite)
135 #:use-module (gnu packages shells)
136 #:use-module (gnu packages ssh)
137 #:use-module (gnu packages textutils)
138 #:use-module (gnu packages tls)
139 #:use-module (gnu packages version-control)
140 #:use-module (gnu packages vulkan)
141 #:use-module (gnu packages xdisorg)
142 #:use-module (gnu packages xml)
143 #:use-module (gnu packages xorg)
144 #:use-module (srfi srfi-26))
145
146(define-public libptytty
147 (package
148 (name "libptytty")
149 (version "2.0")
150 (source
151 (origin
152 (method git-fetch)
153 (uri (git-reference
154 (url "https://github.com/yusiwen/libptytty")
155 (commit "b9694ea18e0dbd78213f55233a430325c13ad63e")))
156 (file-name (git-file-name name version))
157 (sha256
158 (base32 "1g8by1m6ya4r47p137mw4ddml40js0zh6mdb9n6ib49ayngv8ak3"))))
159 (build-system cmake-build-system)
160 (arguments
161 `(#:tests? #f)) ; no test suite
162 (home-page "https://github.com/yusiwen/libptytty")
163 (synopsis
164 "Portable, secure PTY/TTY and @file{utmp}/@file{wtmp}/@file{lastlog} handling")
165 (description
166 "Libptytty is a small C/C++ library to manage pseudo-ttys in a uniform way,
167created out of frustration over the many differences of PTY/TTY handling in
168different operating systems.
169
170In addition to mere PTY/TTY management, it supports updating the session
171database at @file{utmp}, and @file{wtmp}/@file{lastlog} for login shells.
172
173It also supports @code{fork}ing after start-up and dropping privileges in the
174calling process. This reduces the potential attack surface: if the calling
175process were to be compromised by the user starting the program, there would be
176less to gain, as only the helper process is running with privileges (e.g.,
177@code{setuid}/@code{setgid}).")
178 (license license:gpl2+)))
179
180(define-public tilda
181 (package
182 (name "tilda")
183 (version "2.0.0")
184 (source
185 (origin
186 (method git-fetch)
187 (uri (git-reference
188 (url "https://github.com/lanoxx/tilda")
189 (commit (string-append "tilda-" version))))
190 (file-name (git-file-name name version))
191 (sha256
192 (base32 "1ad5jlyg9izm2rid115dv70af6j5i96p91i685c0h9vlrn5sviqs"))))
193 (build-system glib-or-gtk-build-system)
194 (arguments
195 `(#:phases (modify-phases %standard-phases
196 (add-after 'unpack 'make-po-writable
197 (lambda _
198 (for-each make-file-writable
199 (find-files "po" ".")) #t)))))
200 (native-inputs (list autoconf-2.71 automake gettext-minimal pkg-config))
201 (inputs (list libconfuse vte/gtk+-3))
202 (synopsis "GTK+-based drop-down terminal")
203 (description
204 "Tilda is a terminal emulator similar to normal terminals like
205gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
206from the edge of a screen when a certain configurable hotkey is pressed. This
207is similar to the built-in consoles in some applications. Tilda is highly
208configurable through a graphical wizard.")
209 (home-page "https://github.com/lanoxx/tilda")
210 (license license:gpl2+)))
211
212(define-public termite
213 (package
214 (name "termite")
215 (version "16.9")
216 (source
217 (origin
218 (method url-fetch)
219 ;; XXX: The release includes a modified version of VTE.
220 (uri (string-append
221 "https://github.com/aperezdc/termite/releases/download/v"
222 version "/termite-" version ".tar.xz"))
223 (sha256
224 (base32
225 "1mlb8pl1wknhajz06x8qz2zc2497bg4sy9isra6sdjnz601nlj4m"))))
226 (build-system meson-build-system)
227 (arguments
228 (list #:configure-flags
229 #~(list "-Dvte:_systemd=false")
230 #:phases
231 #~(modify-phases %standard-phases
232 (add-after 'unpack 'patch-xdg-open
233 (lambda _
234 (substitute* "termite.cc"
235 (("xdg-open") (which "xdg-open")))))
236 (replace 'install
237 (lambda _
238 (invoke "meson" "install" "--skip-subprojects" "vte"))))))
239 (inputs
240 (list gnutls gtk+ lz4 pcre2 xdg-utils))
241 (native-inputs
242 (list (list glib "bin") pkg-config))
243 (home-page "https://github.com/aperezdc/termite/")
244 (synopsis "Keyboard-centric, VTE-based terminal")
245 (description "Termite is a minimal terminal emulator, with a slightly
246modified version of VTE exposing the necessary functions for keyboard text
247selection and URL hints. It was designed for use with tiling window
248managers.")
249 (license license:lgpl2.0+)))
250
251(define-public asciinema
252 (package
253 (name "asciinema")
254 (version "3.2.0")
255 (source
256 (origin
257 (method url-fetch)
258 (uri (crate-uri "asciinema" version))
259 (file-name (string-append name "-" version ".tar.gz"))
260 (sha256
261 (base32 "1p99rnhp62n50jmlmxlvs8w56si0lvcy505fb1mgxhn1a66i5rqw"))))
262 (build-system cargo-build-system)
263 (arguments
264 (list
265 #:imported-modules (append %copy-build-system-modules
266 %cargo-build-system-modules)
267 #:modules '((guix build cargo-build-system)
268 ((guix build copy-build-system) #:prefix copy:)
269 (guix build utils))
270 #:install-source? #f
271 #:phases
272 #~(modify-phases %standard-phases
273 (add-after 'unpack 'set-asset-out-dir
274 (lambda _
275 (setenv "ASCIINEMA_GEN_DIR" "target/assets")))
276 (add-after 'install 'install-more
277 (lambda args
278 (apply (assoc-ref copy:%standard-phases 'install)
279 #:install-plan
280 '(("target/assets/man" "share/man/man1"
281 #:include-regexp ("\\.1$"))
282 ("target/assets/completion/asciinema.bash"
283 "share/bash-completion/completions/asciinema")
284 ("target/assets/completion/asciinema.elv"
285 "share/elvish/lib/asciinema")
286 ("target/assets/completion/asciinema.fish"
287 "share/fish/vendor_completions.d/")
288 ("target/assets/completion/_asciinema"
289 "share/zsh/site-functions/"))
290 args))))))
291 (native-inputs (list python-minimal)) ;needed for tests
292 (inputs (cargo-inputs 'asciinema))
293 (home-page "https://asciinema.org")
294 (synopsis "Terminal session recorder")
295 (description
296 "Use asciinema to record and share your terminal sessions, the right way.
297Forget screen recording apps and blurry video. Enjoy a lightweight, purely
298text-based approach to terminal recording.")
299 (license license:gpl3)))
300
301(define-public asciinema-agg
302 (package
303 (name "asciinema-agg")
304 (home-page "https://github.com/asciinema/agg")
305 (version "1.7.0")
306 (source
307 (origin
308 (method git-fetch)
309 (uri (git-reference
310 (url home-page)
311 (commit (string-append "v" version))))
312 (file-name (git-file-name name version))
313 (sha256
314 (base32 "04vbj7mmn8cdgrh1563ghadfanpw4ga1jbm2i7jnp6m69qyafiz9"))))
315 (build-system cargo-build-system)
316 (arguments (list #:install-source? #f))
317 (inputs (cargo-inputs 'asciinema-agg))
318 (synopsis "Asciinema gif generator")
319 (description
320 "Agg is a command-line tool for generating animated GIF files from
321asciinema-created terminal session recordings.")
322 (license license:gpl3)))
323
324(define-public libtsm
325 (package
326 (name "libtsm")
327 (version "4.6.0")
328 (source
329 (origin
330 (method git-fetch)
331 (uri (git-reference
332 (url "https://github.com/kmscon/libtsm")
333 (commit (string-append "v" version))))
334 (sha256
335 (base32
336 "0lrmdaqlaq97slwi4n99m4lr3b71vzq0xck8i3kbnzdw92v69ph8"))
337 (file-name (git-file-name name version))
338 (modules '((guix build utils)))
339 (snippet
340 #~(delete-file-recursively "external/xkbcommon"))))
341 (build-system meson-build-system)
342 (native-inputs
343 (list check
344 libxkbcommon
345 pkg-config))
346 (home-page "https://github.com/kmscon/libtsm")
347 (synopsis "Terminal Emulator State Machine library")
348 (description
349 "TSM is a state machine for @acronym{DEC, Digital Equipment Corporation}
350VT100-VT520 compatible terminal emulators. It tries to support all common
351standards while keeping compatibility to existing emulators like xterm,
352gnome-terminal, konsole, among others.")
353 ;; Hash table implementation is lgpl2.1+ licensed.
354 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a MIT-style
355 ;; license.
356 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
357 ;; under the bsd 2 license.
358 (license
359 (list license:bsd-2
360 license:expat
361 license:lgpl2.1+))))
362
363(define-public kmscon
364 (package
365 (name "kmscon")
366 (version "10.0.1")
367 (source
368 (origin
369 (method git-fetch)
370 (uri (git-reference
371 (url "https://github.com/kmscon/kmscon")
372 (commit (string-append "v" version))))
373 (file-name (git-file-name name version))
374 (sha256
375 (base32
376 "162nxqrlsvsdf6pypqdd3s54ac3c6vfnchfk8dmmy4nzlj5acm5y"))))
377 (build-system meson-build-system)
378 (native-inputs
379 (list check
380 pkg-config
381 libxslt
382 docbook-xsl))
383 (inputs
384 (list elogind
385 eudev
386 libdrm
387 libtsm
388 libxkbcommon
389 ;; MESA is useful for accelerated video output via OpenGLESv2, but,
390 ;; being a big dependency, we would rather avoid it in the
391 ;; installation image.
392 ;; mesa
393 pango))
394 (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
395 (synopsis "Linux KMS-based terminal emulator")
396 (description
397 "Kmscon is a terminal emulator based on Linux's @acronym{KMS, kernel mode
398setting}. It can replace the in-kernel @acronym{VT, virtual terminal}
399implementation with a user-space console. Compared to the Linux console,
400kmscon provides enhanced features including XKB-compatible internationalized
401keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
402multi-seat support, a replacement for @command{mingetty}, and more.")
403 ;; Hash table implementation is lgpl2.1+ licensed.
404 ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
405 ;; derived from ISC.
406 ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
407 ;; under the bsd 2 license.
408 ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
409 ;; under the terms of the GNU GPL.
410 (license (list license:expat
411 license:lgpl2.1+
412 license:bsd-2
413 license:gpl2+))
414 (supported-systems (filter (cut string-suffix? "-linux" <>)
415 %supported-systems))))
416
417;;; INFO: kmscon-8 is a dependency of Guix System installer. When upgrading,
418;;; remember to test it; you can fire a VM by following the procedure below:
419;;;
420;;; 1. Manually change `(gnu system install)' module so that in procedure
421;;; `%installation-services' the key `guix-for-system' refers to `guix'
422;;; instead of `(current-guix)'.
423;;; With this temporary change, you will need neither to rebuild guix
424;;; nor to have commit rights.
425;;;
426;;; 2. Execute `./pre-inst-env guix system vm gnu/system/install.scm' in the
427;;; development environment.
428;;;
429(define-public kmscon-8
430 (let ((commit "db868619fbb785f184f38c729cd4842012ef4478")
431 (revision "2"))
432 (package
433 (inherit kmscon)
434 (name "kmscon")
435 (version (git-version "8" revision commit))
436 (source
437 (origin
438 (method git-fetch)
439 (uri (git-reference
440 (url "https://github.com/kmscon/kmscon")
441 (commit commit)))
442 (sha256
443 (base32
444 "0rj3icrfm584pq3916div0chd9h3gxwd1qgw7inf5x508yvgrgxl"))
445 (file-name (git-file-name name version))
446 (patches
447 ;; INFO: This Guix-specific patch is useful for making keyboard
448 ;; selection in Guix System installer work as intended.
449 ;; TODO: port it to 9.x series.
450 (search-patches "kmscon-8-runtime-keymap-switch.patch"))))
451 (build-system gnu-build-system)
452 (arguments
453 (list
454 #:phases
455 #~(modify-phases %standard-phases
456 (add-before 'configure 'remove-systemd
457 ;; Use elogind instead of systemd.
458 (lambda _
459 (substitute* "configure"
460 (("libsystemd-daemon libsystemd-login")
461 "libelogind"))
462 (substitute* "src/uterm_systemd.c"
463 (("#include <systemd/sd-login.h>")
464 "#include <elogind/sd-login.h>")
465 ;; We don't have this header.
466 (("#include <systemd/sd-daemon\\.h>")
467 "")
468 ;; Replace the call to 'sd_booted' by the truth value.
469 (("sd_booted\\(\\)")
470 "1")))))))
471 (native-inputs
472 (list autoconf
473 automake
474 libtool
475 pkg-config
476 ;; to generate the man page
477 docbook-xsl
478 libxslt)))))
479
480(define-public libtermkey
481 (package
482 (name "libtermkey")
483 (version "0.22")
484 (source (origin
485 (method url-fetch)
486 (uri (string-append "http://www.leonerd.org.uk/code/libtermkey/"
487 "libtermkey-" version ".tar.gz"))
488 (sha256
489 (base32 "002606rrxh5f6l6jrikl0dyxsknscdamq10av21xm0xa98ybsib9"))))
490 (build-system gnu-build-system)
491 (arguments
492 `(#:make-flags (list
493 (string-append "CC=" ,(cc-for-target))
494 (string-append "PREFIX=" (assoc-ref %outputs "out")))
495 #:phases
496 (modify-phases %standard-phases
497 (delete 'configure) ; no configure script
498 (add-before 'check 'patch-failing-test
499 ;; XXX This undoes an upstream change in version 0.22 which ‘ensures
500 ;; that the hooked function can invent TI strings for new terminal
501 ;; types’. That fails in the build environment. Why?
502 (lambda _
503 (substitute* "t/40ti-override.c"
504 (("vt750") "vt100")))))
505 #:test-target "test"))
506 (inputs (list ncurses))
507 (native-inputs (list libtool perl-test-harness pkg-config))
508 (synopsis "Keyboard entry processing library for terminal-based programs")
509 (description
510 "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
511combining, and so on, with a simple interface.")
512 (home-page "https://www.leonerd.org.uk/code/libtermkey")
513 (license license:expat)))
514
515(define-public mlterm
516 (package
517 (name "mlterm")
518 (version "3.9.4")
519 (source
520 (origin
521 (method url-fetch)
522 (uri (string-append "mirror://sourceforge/mlterm/01release/mlterm-"
523 version "/mlterm-" version ".tar.gz"))
524 (sha256
525 (base32 "0plvbplcz9603ckcxcrssg6zz0p0l35ga7f53hhw2fs4yg2f878p"))))
526 (build-system gnu-build-system)
527 (arguments
528 `(#:tests? #f ; no tests
529 #:configure-flags
530 (list "--disable-static"
531 "--enable-optimize-redrawing"
532 "--with-imagelib=gdk-pixbuf")))
533 (native-inputs (list gettext-minimal pkg-config))
534 (inputs
535 (list cairo
536 fontconfig
537 freetype
538 fribidi
539 gdk-pixbuf
540 gtk+
541 libx11
542 libxext
543 libxft))
544 (home-page "https://mlterm.sourceforge.net/")
545 (synopsis "Multi-Lingual TERMinal emulator")
546 (description
547 "mlterm is a multi-lingual terminal emulator. It supports various complex
548character sets and encodings from around the world. It can display double-width
549(e.g. East Asian) glyphs, combining characters used for, e.g., Thai and
550Vietnamese, and bi-directional scripts like Arabic and Hebrew.")
551 (license license:bsd-3)))
552
553(define-public mtm
554 (package
555 (name "mtm")
556 (version "1.2.1")
557 (source
558 (origin
559 (uri (git-reference
560 (url "https://github.com/deadpixi/mtm")
561 (commit version)))
562 (method git-fetch)
563 (sha256
564 (base32 "0gibrvah059z37jvn1qs4b6kvd4ivk2mfihmcpgx1vz6yg70zghv"))
565 (file-name (git-file-name name version))))
566 (build-system gnu-build-system)
567 (arguments
568 `(#:tests? #f ; no tests
569 #:make-flags
570 (list (string-append "CC=" ,(cc-for-target))
571 (string-append "DESTDIR=" (assoc-ref %outputs "out")))
572 #:phases
573 (modify-phases %standard-phases
574 (delete 'configure) ;no configure script
575 (add-before 'build 'fix-headers
576 (lambda _
577 (substitute* "config.def.h"
578 (("ncursesw/curses.h") "curses.h"))))
579 (replace 'install
580 (lambda* (#:key inputs outputs #:allow-other-keys)
581 (let* ((out (assoc-ref outputs "out")))
582 ;; install binary
583 (mkdir-p (string-append out "bin/"))
584 (install-file "mtm" (string-append out "/bin"))
585 ;; install manpage
586 (mkdir-p (string-append out "share/man/man1"))
587 (install-file "mtm.1" (string-append out "/share/man/man1"))
588 ;; install terminfo
589 (mkdir-p (string-append out "share/terminfo"))
590 (invoke (string-append (assoc-ref inputs "ncurses") "/bin/tic")
591 "-x" "-s" "-o"
592 (string-append
593 out "/share/terminfo")
594 "mtm.ti")))))))
595 (inputs
596 (list ncurses))
597 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
598 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
599 (native-search-paths
600 (list (search-path-specification
601 (variable "TERMINFO_DIRS")
602 (files '("share/terminfo")))))
603 (home-page "https://github.com/deadpixi/mtm")
604 (synopsis "Micro Terminal Multiplexer")
605 (description
606 "This package provides multiplexer for the terminal focused on simplicity,
607compatibility, size and stability.")
608 (license (list license:gpl3+
609 license:bsd-3)))) ;vtparser.c
610
611(define-public picocom
612 (package
613 (name "picocom")
614 (version "3.1")
615 (source (origin
616 (method git-fetch)
617 (uri (git-reference
618 (url "https://github.com/npat-efault/picocom")
619 (commit version)))
620 (file-name (git-file-name name version))
621 (sha256
622 (base32
623 "1vvjydqf0ax47nvdyyl67jafw5b3sfsav00xid6qpgia1gs2r72n"))))
624 (build-system gnu-build-system)
625 (arguments
626 `(#:make-flags (list (string-append "CC=" ,(cc-for-target)))
627 #:tests? #f ; no tests
628 #:phases
629 (modify-phases %standard-phases
630 (delete 'configure) ; no configure script
631 (replace 'install
632 ;; The Makefile lacks an ‘install’ target.
633 (lambda* (#:key outputs #:allow-other-keys)
634 (let* ((out (assoc-ref outputs "out"))
635 (bin (string-append out "/bin"))
636 (man (string-append out "/share/man/man1")))
637 (install-file "picocom" bin)
638 (install-file "picocom.1" man)))))))
639 (home-page "https://github.com/npat-efault/picocom")
640 (synopsis "Minimal dumb-terminal emulator")
641 (description
642 "Picocom is a minimal dumb-terminal emulation program. It was designed to
643serve as a simple and manual modem configuration, testing, and debugging tool.
644It also serves well as a low-tech serial communications program to allow access
645to all types of devices that provide serial consoles.")
646 (license license:gpl2+)))
647
648(define-public beep
649 (let ((commit "1cba97210748ac9f478c0f93334a1eb31eb002d7")
650 (revision "0"))
651 (package
652 (name "beep")
653 (version (git-version "1.4.12" revision commit))
654 (source
655 (origin
656 (method git-fetch)
657 (uri (git-reference
658 ;; The original beep 1.3 at <http://www.johnath.com/beep> has been
659 ;; unmaintained for some time, and vulnerable to at least two CVEs:
660 ;; https://github.com/johnath/beep/issues/11#issuecomment-454056858
661 ;; Use this maintained fork instead.
662 (url "https://github.com/spkr-beep/beep")
663 (commit commit)))
664 (file-name (git-file-name name version))
665 (sha256
666 (base32 "1di7j1n7svn6hyvs3fac0n1wnc3wiyxk47jyafwla0zifnwf0xwy"))))
667 (build-system gnu-build-system)
668 (arguments
669 (list
670 #:make-flags
671 #~(list (string-append "CC=" #$(cc-for-target))
672 (string-append "prefix=" #$output))
673 #:phases
674 #~(modify-phases %standard-phases
675 (delete 'configure) ;no configure script
676 (add-before 'check 'patch-tests
677 (lambda* (#:key inputs #:allow-other-keys)
678 (substitute* "GNUmakefile"
679 (("/bin/bash")
680 (search-input-file inputs "bin/bash"))
681 ;; XXX In the build environment, $(PWD) is the *parent* directory
682 ;; /tmp/guix-build-beep-x.y.drv-0! A pure guix shell works fine.
683 (("\\$\\(PWD\\)" pwd)
684 (string-append pwd "/source")))
685 (substitute* (find-files "tests" "\\.expected")
686 ;; The build environment lacks /dev/{console,tty*}.
687 ;; In fact, even nckx's regular Guix System lacks ttyS1…
688 ((": Permission denied")
689 ": No such file or directory"))))
690 (add-before 'install 'install-rules
691 (lambda _
692 (let ((rules.d (string-append #$output "/etc/udev/rules.d")))
693 (mkdir-p rules.d)
694 (with-output-to-file
695 (string-append rules.d "/70-pcspkr-beep.rules")
696 (lambda _
697 (display
698 (string-join (list "ACTION==\"add\""
699 "SUBSYSTEM==\"input\""
700 "ATTRS{name}==\"PC Speaker\""
701 "ENV{DEVNAME}!=\"\""
702 "TAG+=\"uaccess\"")
703 ", "))))))))))
704 (synopsis "Linux command-line utility to control the PC speaker")
705 (description
706 "beep allows the user to control the PC speaker with precision,
707allowing different sounds to indicate different events. While it can be run
708quite happily on the command line, its intended place of residence is within
709scripts, notifying the user when something interesting occurs. Of course, it
710has no notion of what's interesting, but it's very good at that notifying
711part.")
712 (home-page "https://github.com/spkr-beep/beep")
713 (license license:gpl2+))))
714
715(define-public unibilium
716 (package
717 (name "unibilium")
718 (version "2.0.0")
719 (source
720 (origin
721 (method git-fetch)
722 (uri (git-reference
723 (url "https://github.com/mauke/unibilium")
724 (commit (string-append "v" version))))
725 (file-name (git-file-name name version))
726 (sha256
727 (base32
728 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
729 (build-system gnu-build-system)
730 (arguments
731 `(#:make-flags
732 (list "CC=gcc"
733 (string-append "PREFIX=" (assoc-ref %outputs "out")))
734 #:test-target "test"
735 ;; FIXME: tests require "prove"
736 #:tests? #f
737 #:phases
738 (modify-phases %standard-phases
739 (delete 'configure))))
740 (native-inputs
741 (list libtool perl))
742 (home-page "https://github.com/mauke/unibilium")
743 (synopsis "Terminfo parsing library")
744 (description "Unibilium is a basic C terminfo library. It doesn't depend
745on curses or any other library. It also doesn't use global variables, so it
746should be thread-safe.")
747 (license license:lgpl3+)))
748
749(define-public libvterm
750 (package
751 (name "libvterm")
752 (version "0.3.3")
753 (source
754 (origin
755 (method url-fetch)
756 (uri (string-append
757 "https://launchpad.net/libvterm/trunk/v"
758 (version-major+minor version)
759 "/+download/libvterm-" version ".tar.gz"))
760 (sha256
761 (base32 "1q16fbznm54p24hqvw8c9v3347apk86ybsxyghsbsa11vm1ny589"))))
762 (build-system gnu-build-system)
763 (arguments
764 (list #:make-flags
765 #~(list
766 ;; FIXME: cross build fails.
767 ;; ld: src/.libs/encoding.o: error adding symbols: file in wrong format
768 ;; collect2: error: ld returned 1 exit status
769 (string-append "CC=" #$(cc-for-target))
770 (string-append "PREFIX=" #$output))
771 #:test-target "test"
772 #:phases
773 #~(modify-phases %standard-phases
774 (delete 'configure))))
775 (native-inputs
776 (list libtool perl))
777 (home-page "https://www.leonerd.org.uk/code/libvterm/")
778 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
779 (description "Libvterm is an abstract C99 library which implements a VT220
780or xterm-like terminal emulator. It doesn't use any particular graphics
781toolkit or output system, instead it invokes callback function pointers that
782its embedding program should provide it to draw on its behalf. It avoids
783calling @code{malloc} during normal running state, allowing it to be used in
784embedded kernel situations.")
785 (license license:expat)))
786
787(define-public cool-retro-term
788 (package
789 (name "cool-retro-term")
790 (version "1.2.0")
791 (source (origin
792 (method git-fetch)
793 (file-name (string-append name "-" version "-checkout"))
794 (uri (git-reference
795 (url (string-append "https://github.com/Swordfish90/" name))
796 (commit version)
797 (recursive? #t)))
798 (sha256
799 (base32 "02mj70gcpx9fvrhsy6iqwp399dya9iyakx940b6ws952d23xn337"))
800 (modules '((guix build utils)
801 (srfi srfi-1)
802 (srfi srfi-26)
803 (ice-9 rdelim)
804 (ice-9 regex)))
805 (patches (search-patches "cool-retro-term-wctype.patch"))
806 (snippet
807 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
808 "1977-apple2" ; Non-Free
809 "1977-commodore-pet" ; Non-Free
810 "1979-atari-400-800" ; Non-Free
811 ;"1981-ibm-pc ; CC-SA 4.0
812 "1982-commodore64")) ; Non-Free
813 ;"1985-ibm-pc-vga" ; CC-SA 4.0
814 ;"modern-fixedsys-excelsior" ; Redistributable
815 ;"modern-hermit" ; SIL
816 ;"modern-inconsolata"; SIL
817 ;"modern-pro-font-win-tweaked" ; X11
818 ;"modern-proggy-tiny"; X11
819 ;"modern-terminus" ; SIL
820 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
821 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
822 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
823 (names
824 ;; Gather font names from all Fonts*.qml files.
825 ;; These will be used to remove items from the
826 ;; default profiles.
827 (fold
828 (lambda (font-file names)
829 (call-with-input-file font-file
830 (lambda (port)
831 (let loop ((name #f) (names names))
832 (let ((line (read-line port)))
833 (cond
834 ((eof-object? line) (pk 'names names))
835 ((regexp-exec name-rx line)
836 => (lambda (m)
837 (loop (match:substring m 1) names)))
838 ((regexp-exec source-rx line)
839 => (lambda (m)
840 (let ((font (match:substring m 1)))
841 (if (member font fonts)
842 (loop #f (lset-adjoin string=?
843 names name))
844 (loop #f names)))))
845 (else (loop name names))))))))
846 '() (find-files "app/qml" "Font.*\\.qml"))))
847 ;; Remove the font files themselves
848 (for-each (lambda (font)
849 (delete-file-recursively
850 (string-append "app/qml/fonts/" font)))
851 fonts)
852 ;; Remove mention of those fonts in the source
853 (substitute* "app/qml/resources.qrc"
854 (((string-append " *<file>fonts/("
855 (string-join fonts "|")
856 ").*"))
857 ""))
858 (for-each
859 (lambda (file)
860 (let ((start-rx (make-regexp " *ListElement *\\{"))
861 (end-rx (make-regexp " *\\}")))
862 (with-atomic-file-replacement file
863 (lambda (in out)
864 (let loop ((line-buffer '())
865 (hold? #f)
866 (discard? #f))
867 (let ((line (read-line in 'concat)))
868 (cond
869 ((eof-object? line) #t) ;done
870 ((regexp-exec start-rx line)
871 (loop (cons line line-buffer) #t #f))
872 ((or (regexp-exec source-rx line)
873 (regexp-exec fontname-rx line))
874 => (lambda (m)
875 (let ((font-or-name (match:substring m 1)))
876 (if (or (member font-or-name fonts)
877 (member font-or-name names))
878 (loop '() #f #t)
879 (loop (cons line line-buffer)
880 hold? #f)))))
881 ((regexp-exec end-rx line)
882 (unless discard?
883 (for-each (cut display <> out)
884 (reverse line-buffer))
885 (display line out))
886 (loop '() #f #f))
887 (hold? (loop (cons line line-buffer)
888 hold? discard?))
889 (discard? (loop line-buffer #f #t))
890 (else (display line out)
891 (loop '() #f #f)))))))))
892 '("app/qml/FontPixels.qml"
893 "app/qml/FontScanlines.qml"
894 "app/qml/Fonts.qml"
895 "app/qml/ApplicationSettings.qml"))
896 ;; Final substitution for default scanline and pixel fonts
897 (substitute* "app/qml/ApplicationSettings.qml"
898 (("COMMODORE_PET") "PROGGY_TINY"))))))
899 (build-system gnu-build-system)
900 (inputs
901 (list qtbase-5 qtdeclarative-5 qtgraphicaleffects
902 qtquickcontrols-5 qtquickcontrols2-5 bash-minimal))
903 (arguments
904 `(#:phases
905 (modify-phases %standard-phases
906 (replace 'configure
907 (lambda* (#:key outputs #:allow-other-keys)
908 (let ((out (assoc-ref outputs "out")))
909 (substitute* '("qmltermwidget/qmltermwidget.pro")
910 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
911 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
912 (substitute* '("cool-retro-term.pro" "app/app.pro")
913 (("/usr") out))
914 (invoke "qmake"))))
915 (add-after 'install 'wrap-executable
916 (lambda* (#:key inputs outputs #:allow-other-keys)
917 (let ((out (assoc-ref outputs "out"))
918 (qml "/lib/qt5/qml"))
919 (wrap-program (string-append out "/bin/cool-retro-term")
920 `("QML2_IMPORT_PATH" ":" prefix
921 (,(string-append out qml)
922 ,@(map (lambda (i)
923 (string-append (assoc-ref inputs i) qml))
924 '("qtdeclarative"
925 "qtgraphicaleffects"
926 "qtquickcontrols"
927 "qtquickcontrols2"))))))))
928 (add-after 'install 'add-alternate-name
929 (lambda* (#:key outputs #:allow-other-keys)
930 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
931 (symlink (string-append bin "/cool-retro-term")
932 (string-append bin "/crt")))))
933 (add-after 'install 'install-man
934 (lambda* (#:key outputs #:allow-other-keys)
935 (let ((mandir (string-append (assoc-ref outputs "out")
936 "/share/man/man1")))
937 (install-file "packaging/debian/cool-retro-term.1" mandir)))))))
938 (synopsis "Terminal emulator")
939 (description
940 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
941feel of the old cathode ray tube (CRT) screens. It has been designed to be
942eye-candy, customizable, and reasonably lightweight.")
943 (home-page "https://github.com/Swordfish90/cool-retro-term")
944 (license (list
945 license:gpl2+ ; qmltermwidget
946 license:gpl3+ ; cool-retro-term
947 ;; Fonts
948 license:silofl1.1
949 license:x11
950 license:bsd-3))))
951
952(define-public foot
953 (package
954 (name "foot")
955 (version "1.27.0")
956 (home-page "https://codeberg.org/dnkl/foot")
957 (source
958 (origin
959 (method git-fetch)
960 (uri (git-reference
961 (url home-page)
962 (commit version)))
963 (file-name (git-file-name name version))
964 (sha256
965 (base32 "0r9aqhy1v1s0na617ay1lsgmf9shgdlf3a1x7573ia2c5bhkiccd"))))
966 (build-system meson-build-system)
967 (arguments
968 (list
969 ;; Using a "release" build is recommended both for performance, and
970 ;; also to address a GCC 10 issue when doing PGO builds.
971 #:build-type "release"
972 ;; Enable LTO as recommended by INSTALL.md.
973 ;; when cross-compilation, enable lto will fail.
974 #:configure-flags (if (%current-target-system)
975 #~'()
976 #~'("-Db_lto=true"))))
977 (native-inputs (append
978 (if (%current-target-system)
979 (list wayland pkg-config-for-build)
980 '())
981 (list ncurses ;for 'tic'
982 pkg-config scdoc wayland-protocols)))
983 (native-search-paths
984 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
985 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
986 (list (search-path-specification
987 (variable "TERMINFO_DIRS")
988 (files '("share/terminfo")))))
989 (inputs (list fcft libxkbcommon wayland wayland-protocols))
990 (synopsis "Wayland-native terminal emulator")
991 (description
992 "@command{foot} is a terminal emulator for systems using the Wayland
993display server. It is designed to be fast, lightweight, and independent of
994desktop environments. It can be used as a standalone terminal and also has
995a server/client mode.")
996 (license license:expat)))
997
998(define-public havoc
999 (package
1000 (name "havoc")
1001 (version "0.7.0")
1002 (source (origin
1003 (method git-fetch)
1004 (uri (git-reference
1005 (url "https://github.com/ii8/havoc")
1006 (commit version)))
1007 (file-name (git-file-name name version))
1008 (sha256
1009 (base32
1010 "1c53dddq33b1vij5aa4rkzypgrxcp3hbgh15zb6lgbii12n0fz8y"))))
1011 (build-system gnu-build-system)
1012 (arguments
1013 (list
1014 #:tests? #f ; no check target
1015 #:make-flags #~(list (string-append "PREFIX=" #$output))
1016 #:phases
1017 #~(modify-phases %standard-phases
1018 (delete 'configure) ; no configure script
1019 (add-before 'build 'set-CC
1020 (lambda _
1021 (setenv "CC" #$(cc-for-target)))))))
1022 (native-inputs
1023 (list pkg-config wayland-protocols))
1024 (inputs
1025 (list libxkbcommon wayland))
1026 (home-page "https://github.com/ii8/havoc")
1027 (synopsis "Minimal terminal emulator for Wayland")
1028 (description
1029 "Havoc is a minimal terminal emulator for Wayland.")
1030 (license license:expat)))
1031
1032(define-public sakura
1033 (package
1034 (name "sakura")
1035 (version "3.8.9")
1036 (source (origin
1037 (method url-fetch)
1038 (uri (string-append "https://launchpad.net/sakura/trunk/"
1039 version "/+download/sakura-" version
1040 ".tar.bz2"))
1041 (sha256
1042 (base32
1043 "09qa1crlml3ib3bc03dg73j950bn0brqm3y7fb8h4a6nbndird2k"))))
1044 (build-system cmake-build-system)
1045 (arguments
1046 '(#:tests? #f)) ; no check phase
1047 (native-inputs
1048 (list gettext-minimal perl ; for pod2man
1049 pkg-config))
1050 (inputs
1051 (list libxft vte/gtk+-3))
1052 (home-page "https://launchpad.net/sakura")
1053 (synopsis "Simple but powerful libvte-based terminal emulator")
1054 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
1055It's a terminal emulator with few dependencies, so you don't need a full GNOME
1056desktop installed to have a decent terminal emulator.")
1057 (license license:gpl2)))
1058
1059(define-public xiate
1060 (let ((commit "ae3cf30b345c64f097a747ac848e23ef5bae8b57")
1061 (revision "0"))
1062 (package
1063 (name "xiate")
1064 (version (git-version "22.12" revision commit))
1065 (source (origin
1066 (method git-fetch)
1067 (file-name (git-file-name name version))
1068 (uri (git-reference
1069 (url "https://www.uninformativ.de/git/xiate.git")
1070 (commit commit)))
1071 (sha256
1072 (base32
1073 "0bc205b1gs1jvp1a2cr814l32hmlm0sgv1drfw7ykbavslfpmg2d"))))
1074 (build-system gnu-build-system)
1075 (arguments
1076 (list #:tests? #f ;no tests
1077 #:make-flags #~(list (string-append "CC="
1078 #$(cc-for-target))
1079 (string-append "prefix="
1080 #$output))
1081 #:phases #~(modify-phases %standard-phases
1082 (delete 'configure))))
1083 (inputs (list gtk+ glib vte/gtk+-3))
1084 (native-inputs (list pkg-config))
1085 (synopsis "Minimalist terminal emulator based on GTK+")
1086 (description
1087 "Xiate is a terminal emulator which tries to keep a balance
1088between features and simplicity. This is achieved by using VTE as a powerful
1089backend, while UI, configuration, and code try to remain much more
1090minimalistic.")
1091 (home-page "https://www.uninformativ.de/git/xiate/file/README.html")
1092 (license license:expat))))
1093
1094(define-public fzf
1095 (package
1096 (name "fzf")
1097 (version "0.74.2")
1098 (source
1099 (origin
1100 (method git-fetch)
1101 (uri (git-reference
1102 (url "https://github.com/junegunn/fzf")
1103 (commit (string-append "v" version))))
1104 (file-name (git-file-name name version))
1105 (sha256
1106 (base32 "0cv9h6g2l1hs3rwbmi5z0lm9vnl4z3cl7xl5zbh9dwn3wqwm1xvg"))))
1107 (build-system go-build-system)
1108 (arguments
1109 (list
1110 #:install-source? #f
1111 #:import-path "github.com/junegunn/fzf"
1112 #:phases
1113 #~(modify-phases %standard-phases
1114 (add-after 'install 'copy-binaries
1115 (lambda* (#:key import-path #:allow-other-keys)
1116 (with-directory-excursion (string-append "src/" import-path)
1117 (install-file "bin/fzf-tmux" (string-append #$output "/bin")))))
1118 (add-after 'copy-binaries 'wrap-programs
1119 (lambda _
1120 (let* ((bin (string-append #$output "/bin"))
1121 (findutils #$(this-package-input "findutils"))
1122 (ncurses #$(this-package-input "ncurses")))
1123 (wrap-program (string-append bin "/fzf")
1124 `("PATH" ":" prefix (,(string-append findutils "/bin"))))
1125 (wrap-program (string-append bin "/fzf-tmux")
1126 `("PATH" ":" prefix (,(string-append ncurses "/bin")))))))
1127 (add-after 'install 'install-completions
1128 (lambda* (#:key import-path #:allow-other-keys)
1129 (let* ((bashrc-functions
1130 (string-append #$output "/etc/bashrc.d"))
1131 (fish-functions
1132 (string-append #$output "/share/fish/vendor_functions.d"))
1133 (zsh-completion
1134 (string-append #$output "/share/zsh/site-functions")))
1135 (with-directory-excursion (string-append "src/" import-path)
1136 (mkdir-p bashrc-functions)
1137 (copy-file "shell/completion.bash"
1138 (string-append bashrc-functions "/fzf-completion.bash"))
1139 (copy-file "shell/key-bindings.bash"
1140 (string-append bashrc-functions "/fzf-bindings.bash"))
1141 (mkdir-p fish-functions)
1142 (copy-file "shell/key-bindings.fish"
1143 (string-append fish-functions "/fzf_key_bindings.fish"))
1144 (mkdir-p zsh-completion)
1145 (copy-file "shell/completion.zsh"
1146 (string-append zsh-completion "/_fzf")))))))))
1147 (native-inputs
1148 (list go-github-com-charlievieth-fastwalk
1149 go-github-com-gdamore-tcell-v2
1150 go-github-com-junegunn-go-shellwords
1151 go-github-com-mattn-go-isatty
1152 go-github-com-rivo-uniseg
1153 go-golang-org-x-sys
1154 go-golang-org-x-term))
1155 (inputs
1156 (list bash-minimal
1157 findutils
1158 ncurses))
1159 (home-page "https://junegunn.github.io/fzf/")
1160 (synopsis "Command-line fuzzy-finder")
1161 (description "This package provides an interactive command-line filter
1162usable with any list--including files, command history, processes and more.")
1163 (license license:expat)))
1164
1165(define-public python-pyfzf
1166 (package
1167 (name "python-pyfzf")
1168 (version "0.3.1")
1169 (source
1170 (origin
1171 (method url-fetch)
1172 (uri (pypi-uri "pyfzf" version))
1173 (sha256
1174 (base32 "1lkbnhjf92063gg9snxskcx4n2yj7mck2qgrh8q9rjpyrws2x46x"))))
1175 (build-system pyproject-build-system)
1176 (arguments
1177 (list #:tests? #f)) ;no tests
1178 (native-inputs
1179 (list python-setuptools))
1180 (inputs
1181 (list fzf))
1182 (home-page "https://github.com/nk412/pyfzf")
1183 (synopsis "Python wrapper for junegunn's fuzzyfinder (fzf)")
1184 (description "This package provides a thin wrapper for @code{fzf}.")
1185 (license license:expat)))
1186
1187(define-public tmate
1188 (package
1189 (name "tmate")
1190 ;; XXX: The project looks like abandoned, where 2.4.0 was released in 2019
1191 ;; and the latest commit on master's HEAD is from 2022, see:
1192 ;; <https://github.com/tmate-io/tmate/issues/306>.
1193 (properties '((commit . "ac919516f4f1b10ec928e20b3a5034d18f609d68")
1194 (revision . "0")))
1195 (version (git-version "2.4.0"
1196 (assoc-ref properties 'revision)
1197 (assoc-ref properties 'commit)))
1198 (source
1199 (origin
1200 (method git-fetch)
1201 (uri (git-reference
1202 (url "https://github.com/tmate-io/tmate")
1203 (commit (assoc-ref properties 'commit))))
1204 (file-name (git-file-name name version))
1205 (sha256
1206 (base32 "1gwmwiq0fc0bl4calnzp53hp3wyr66qvsagz37jchwhcc1za1pmp"))))
1207 (build-system gnu-build-system)
1208 (arguments
1209 (list
1210 #:phases
1211 #~(modify-phases %standard-phases
1212 (add-after 'unpack 'fix-msgpack-version
1213 (lambda _
1214 (substitute* "configure.ac"
1215 (("msgpack >= 1.1.0")
1216 "msgpack-c >= 1.1.0")))))))
1217 (inputs (list libevent libssh msgpack-c ncurses))
1218 (native-inputs (list autoconf automake pkg-config))
1219 (home-page "https://tmate.io/")
1220 (synopsis "Terminal sharing application")
1221 (description
1222 "tmate is a terminal sharing application that allows you to share your
1223terminal with other users over the Internet. tmate is a fork of tmux.")
1224 (license license:isc)))
1225
1226(define-public kitty
1227 (package
1228 (name "kitty")
1229 (version "0.48.2")
1230 (source
1231 (origin
1232 (method git-fetch)
1233 (uri (git-reference
1234 (url "https://github.com/kovidgoyal/kitty")
1235 (commit (string-append "v" version))))
1236 (file-name (git-file-name name version))
1237 (sha256
1238 (base32 "05861h7xyksphsbnkff8jphpk7xrjpsmcqxhklzwd6yckcz1bn58"))
1239 (modules '((guix build utils)))
1240 (snippet
1241 #~(begin
1242 ;; Fails to read /etc/machine-id in the build container.
1243 (delete-file "tools/utils/machine_id/api_test.go")
1244 (substitute* "docs/conf.py"
1245 (("(from kitty.constants import str_version)" imp)
1246 (string-append "sys.path.append(\"..\")\n" imp)))
1247 ;; Depends on <https://github.com/pradyunsg/furo> which
1248 ;; is not packaged yet and depends on some missing Node.js packages
1249 (substitute* "docs/conf.py"
1250 (("^html_theme = .*$") "html_theme = 'alabaster'\n"))
1251 (substitute* "docs/Makefile"
1252 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
1253 "SPHINXBUILD = sphinx-build\n"))))))
1254 (build-system go-build-system)
1255 (outputs '("out" "terminfo" "shell-integration" "kitten"))
1256 (arguments
1257 (list
1258 #:go go-1.26
1259 #:import-path "github.com/kovidgoyal/kitty/tools/cmd"
1260 #:unpack-path "github.com/kovidgoyal/kitty"
1261 #:embed-files #~(list ".*\\.xml" ".*\\.json" ".*\\.txt" ".*\\.css" ".*\\.html" ".*\\.icc")
1262 #:phases
1263 #~(modify-phases %standard-phases
1264 (delete 'build)
1265
1266 (add-after 'unpack 'setup-fonts
1267 (lambda* (#:key inputs #:allow-other-keys)
1268 (let ((fonts (string-append
1269 (assoc-ref inputs "font-nerd-symbols")
1270 "/share/fonts/truetype")))
1271 ;; FontConfig expects a home
1272 (setenv "HOME" "/tmp")
1273 (mkdir-p "fonts")
1274 (copy-recursively fonts "fonts"))))
1275
1276 (add-after 'fix-embed-files 'build-kitty
1277 (lambda* (#:key inputs #:allow-other-keys)
1278 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1279 (for-each make-file-writable (find-files "kitty"))
1280 (apply invoke "python3" "setup.py" "linux-package"
1281 "--update-check-interval=0"
1282 "--shell-integration=enabled no-rc"
1283 (map (lambda (pair)
1284 (string-append "--" (car pair) "="
1285 (search-input-file inputs (cdr pair))))
1286 '(("egl-library" . "/lib/libEGL.so.1")
1287 ("startup-notification-library" . "/lib/libstartup-notification-1.so")
1288 ("canberra-library" . "/lib/libcanberra.so")
1289 ("fontconfig-library" . "/lib/libfontconfig.so"))))
1290 (invoke "python3" "setup.py" "build-launcher"))))
1291
1292 (add-after 'build-kitty 'run-python-tests
1293 (lambda* (#:key tests? #:allow-other-keys)
1294 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1295 (when tests?
1296 (setenv "HOME" (getcwd))
1297 (mkdir-p "test-home")
1298 (setenv "XDG_CONFIG_HOME" (string-append (getcwd) "/test-home"))
1299 (setenv "TMPDIR" (string-append (getcwd) "/test-tmp"))
1300 (mkdir-p (getenv "TMPDIR"))
1301 ;; Remove tests requiring display server and dbus access
1302 ;; or otherwise fail due to build container restrictions.
1303 (for-each (lambda (f)
1304 (let ((path (string-append "kitty_tests/" f ".py")))
1305 (when (file-exists? path) (delete-file path))))
1306 '("check_build" "child" "glfw" "multicell"
1307 "tui" "shell_integration" "ssh" "options"
1308 "atexit" "shm" "file_transmission" "completion"))
1309 (invoke "python3" "test.py")))))
1310
1311 (replace 'install
1312 (lambda _
1313 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1314 (let ((out #$output)
1315 (terminfo #$output:terminfo)
1316 (shell-int #$output:shell-integration)
1317 (kitten #$output:kitten))
1318 (copy-recursively "linux-package/bin" (string-append out "/bin"))
1319 (copy-recursively "linux-package/share" (string-append out "/share"))
1320 (copy-recursively "linux-package/lib" (string-append out "/lib"))
1321 (mkdir-p (string-append kitten "/bin"))
1322 ;; symlinking instead of renaming since kitty expects the kitten
1323 ;; to be alongside of it
1324 (symlink (string-append out "/bin/kitten")
1325 (string-append kitten "/bin/kitten"))
1326 (mkdir-p (string-append terminfo "/share"))
1327 (rename-file (string-append out "/share/terminfo")
1328 (string-append terminfo "/share/terminfo"))
1329 (copy-recursively "shell-integration" shell-int))))))))
1330 (native-inputs
1331 (list bash-minimal
1332 dbus
1333 fish
1334 font-nerd-symbols
1335 go-github-com-alecthomas-chroma-v2
1336 go-github-com-altree-bigfloat
1337 go-github-com-bmatcuk-doublestar-v4
1338 go-github-com-dlclark-regexp2
1339 ;; go-github-com-ebitengine-purego ;only for Darwin
1340 go-github-com-emmansun-base64
1341 go-github-com-google-go-cmp
1342 go-github-com-google-uuid
1343 go-github-com-hako-durafmt
1344 go-github-com-klauspost-compress
1345 go-github-com-kovidgoyal-dbus
1346 go-github-com-kovidgoyal-go-parallel
1347 go-github-com-kovidgoyal-go-shm
1348 go-github-com-kovidgoyal-imaging
1349 go-github-com-nwaples-rardecode-v2
1350 go-github-com-seancfoley-ipaddress-go
1351 go-github-com-shirou-gopsutil-v4
1352 go-github-com-sgtdi-fswatcher
1353 go-github-com-ulikunitz-xz
1354 go-github-com-zeebo-xxh3
1355 go-golang-org-x-exp
1356 go-golang-org-x-image
1357 go-golang-org-x-sys
1358 go-golang-org-x-text
1359 go-howett-net-plist
1360 pkg-config
1361 python-pillow
1362 python-sphinx
1363 python-sphinx-copybutton
1364 python-sphinx-inline-tabs
1365 python-sphinxext-opengraph
1366 wayland-protocols
1367 zsh))
1368 (inputs
1369 (list cairo
1370 fontconfig
1371 harfbuzz
1372 lcms
1373 libcanberra
1374 libpng
1375 librsync
1376 libx11
1377 libxcursor
1378 libxext
1379 libxi
1380 libxinerama
1381 libxkbcommon
1382 libxrandr
1383 mesa
1384 ncurses
1385 openssl
1386 python-wrapper
1387 simde
1388 startup-notification
1389 wayland
1390 xxhash
1391 zlib))
1392 (home-page "https://sw.kovidgoyal.net/kitty/")
1393 (synopsis "Fast, feature-rich, GPU-based terminal emulator")
1394 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1395@itemize
1396@item Offloads rendering to the GPU for lower system load and buttery smooth
1397scrolling. Uses threaded rendering to minimize input latency.
1398@item Supports all modern terminal features: graphics (images), unicode,
1399true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1400paste and several new terminal protocol extensions.
1401@item Supports tiling multiple terminal windows side by side in different
1402layouts without needing to use an extra program like tmux.
1403@item Can be controlled from scripts or the shell prompt, even over SSH.
1404@item Has a framework for Kittens, small terminal programs that can be used to
1405extend kitty's functionality. For example, they are used for Unicode input,
1406hints, and side-by-side diff.
1407@item Supports startup sessions which allow you to specify the window/tab
1408layout, working directories and programs to run on startup.
1409@item Allows you to open the scrollback buffer in a separate window using
1410arbitrary programs of your choice. This is useful for browsing the history
1411comfortably in a pager or editor.
1412@end itemize")
1413 (properties '((cpe-vendor . "kovidgoyal"))) ;to distinguish from 9bis
1414 (license license:gpl3+)))
1415
1416(define-public eternalterminal
1417 (package
1418 (name "eternalterminal")
1419 (version "6.2.11")
1420 (source
1421 (origin
1422 (method git-fetch)
1423 (uri (git-reference
1424 (url "https://github.com/MisterTea/EternalTerminal")
1425 (commit (string-append "et-v" version))))
1426 (file-name (git-file-name name version))
1427 (sha256
1428 (base32 "1ik4kdw574l087yxck2clzwjmdacar8my3k2ih8dbn5m0djq4ybp"))))
1429 (build-system cmake-build-system)
1430 (arguments
1431 '(#:configure-flags '("-DBUILD_TEST=ON" "-DDISABLE_VCPKG=1")))
1432 (inputs (list libsodium protobuf openssl zlib curl))
1433 (home-page "https://mistertea.github.io/EternalTerminal/")
1434 (synopsis "Remote shell that reconnects without interrupting the session")
1435 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1436automatically reconnects without interrupting the session. ET uses SSH to
1437initialize a secure connection. Unlike SSH sessions, which must be killed and
1438reconnected after a network outage an ET session will survive network outages
1439and IP roaming. ET provides the same core functionality as @command{mosh},
1440while also supporting native scrolling and @command{tmux} control mode
1441(@code{tmux -CC}).")
1442 (license license:asl2.0)))
1443
1444(define-public tilix
1445 (package
1446 (name "tilix")
1447 (version "1.9.6")
1448 (source
1449 (origin
1450 (method git-fetch)
1451 (uri (git-reference
1452 (url "https://github.com/gnunn1/tilix")
1453 (commit version)))
1454 (file-name (git-file-name name version))
1455 (sha256
1456 (base32 "1vq0igfq1hj017ivfkd03zbb620qhvcjn9vd56c5dr4r1j7jiz98"))))
1457 (build-system meson-build-system)
1458 (arguments
1459 (list
1460 #:glib-or-gtk? #t
1461 #:phases
1462 #~(modify-phases %standard-phases
1463 (add-after 'unpack 'set-env-variables
1464 (lambda _
1465 (setenv "CC"
1466 #$(cc-for-target))))
1467 (add-after 'unpack 'skip-gtk-update-icon-cache
1468 (lambda _
1469 (substitute* "meson_post_install.py"
1470 (("gtk-update-icon-cache") (which "true"))
1471 (("update-desktop-database") (which "true")))))
1472 (add-after 'install 'remove-d-include-references
1473 #$(remove-d-include-references-phase
1474 (this-package-native-input "ldc"))))))
1475 (inputs (list dbus
1476 dconf
1477 gettext-minimal
1478 gsettings-desktop-schemas
1479 gtkd
1480 gtk+
1481 libsecret
1482 libunwind
1483 vte/gtk+-3))
1484 (native-inputs (list appstream
1485 desktop-file-utils
1486 `(,glib "bin")
1487 `(,gtk+ "bin")
1488 ldc
1489 pkg-config))
1490 (home-page "https://gnunn1.github.io/tilix-web/")
1491 (synopsis "Tiling terminal emulator")
1492 (description
1493 "Tilix is a tiling terminal emulator following the
1494Gnome Human Interface Guidelines. Its features include:
1495@enumerate
1496@item Layout terminals in any fashion by splitting them horizontally or
1497vertically.
1498@item Terminals can be re-arranged using drag and drop both within and between
1499windows.
1500@item Terminals can be detached into a new window via drag and drop.
1501@item Input can be synchronized between terminals so commands typed in one
1502terminal are replicated to the others.
1503@item Supports notifications when processes are completed out of view.
1504@end enumerate")
1505 (license license:mpl2.0)))
1506
1507(define-public tio
1508 (package
1509 (name "tio")
1510 (version "3.9")
1511 (source
1512 (origin
1513 (method git-fetch)
1514 (uri (git-reference
1515 (url "https://github.com/tio/tio")
1516 (commit (string-append "v" version))))
1517 (file-name (git-file-name name version))
1518 (sha256
1519 (base32 "12g2857gp3g2m5g0zjh0dw752lybcnn6gfs7awrsh603b7iqavzp"))))
1520 (build-system meson-build-system)
1521 (native-inputs (list pkg-config))
1522 (inputs (list glib lua))
1523 (arguments
1524 (list
1525 #:configure-flags
1526 #~(list "-Dbashcompletiondir=share/bash-completion/completions")))
1527 (home-page "https://tio.github.io/")
1528 (synopsis "Simple TTY terminal I/O application")
1529 (description "tio is a simple TTY terminal application which features a
1530straightforward commandline interface to easily connect to TTY devices for
1531basic input/output.")
1532 (license license:gpl2+)))
1533
1534(define-public alacritty
1535 (package
1536 (name "alacritty")
1537 (version "0.17.0")
1538 (source
1539 (origin
1540 ;; XXX: The crate at "crates.io" contains only the alacritty subproject
1541 ;; of alacritty and thus has limited contents. In particular,
1542 ;; it does not contain "extra" directory with completions, icon, etc.
1543 (method git-fetch)
1544 (uri (git-reference
1545 (url "https://github.com/alacritty/alacritty")
1546 (commit (string-append "v" version))))
1547 (file-name (git-file-name name version))
1548 (sha256
1549 (base32 "1aw5v127f0jr3jq5cclsbvbvf82g6s195dh1vjlcwjpbc0gl56w9"))))
1550 (build-system cargo-build-system)
1551 (arguments
1552 (list
1553 #:imported-modules (append %copy-build-system-modules
1554 %cargo-build-system-modules)
1555 #:modules '((guix build cargo-build-system)
1556 ((guix build copy-build-system) #:prefix copy:)
1557 (guix build utils))
1558 #:install-source? #f
1559 #:cargo-install-paths ''("alacritty")
1560 #:cargo-test-flags
1561 ''("--"
1562 ;; Changes in clap regularly break this test.
1563 "--skip=cli::tests::completions")
1564 #:phases
1565 #~(modify-phases %standard-phases
1566 (add-after 'unpack 'patch-xdg-open
1567 (lambda* (#:key inputs #:allow-other-keys)
1568 (substitute* "alacritty/src/config/ui_config.rs"
1569 (("xdg-open") (search-input-file inputs "/bin/xdg-open")))))
1570 (add-after 'configure 'add-absolute-library-references
1571 (lambda* (#:key inputs vendor-dir #:allow-other-keys)
1572 ;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
1573 ;; Failed to initialize any backend! Wayland status: NoWaylandLib
1574 ;; XXX We patch transitive dependencies that aren't even direct
1575 ;; inputs to this package, because of the way Guix's Rust build
1576 ;; system currently works. <http://issues.guix.gnu.org/46399>
1577 ;; might fix this and allow patching them directly.
1578 (define shared-library-regex
1579 ;; Using regex decreases the time it takes to run the
1580 ;; substitution over 12000 files by about 40%.
1581 (string-join
1582 (list "libEGL\\.so" ; rust-glutin
1583 "libGL\\.so" ; rust-x11-dl, rust-glutin
1584 "libX[[:alpha:]]*\\.so" ; rust-x11-dl
1585 ; rust-wayland-sys, rust-wayland-backend
1586 "libwayland-[[:alpha:]]*\\.so"
1587 ;; rust-xkbcommon-dl
1588 "libxkbcommon\\.so"
1589 "libxkbcommon-x11\\.so")
1590 "|"))
1591 (substitute* (find-files vendor-dir "\\.rs$")
1592 ((shared-library-regex all)
1593 (search-input-file inputs (string-append "lib/" all))))))
1594 (add-after 'install 'install-more
1595 (lambda* (#:key native-inputs inputs #:allow-other-keys
1596 #:rest args)
1597 (let ((tic (search-input-file
1598 (or native-inputs inputs) "/bin/tic"))
1599 (terminfo (string-append #$output "/share/terminfo")))
1600 (define (create-manpage manpage)
1601 (with-input-from-file manpage
1602 (lambda _
1603 (with-output-to-file (string-drop-right manpage 4)
1604 (lambda _ (invoke "scdoc"))))))
1605 (with-directory-excursion "extra/man"
1606 (for-each create-manpage
1607 (find-files "." "^alacritty.*\\.[[:digit:]]\\.scd$")))
1608 (apply (assoc-ref copy:%standard-phases 'install)
1609 #:install-plan
1610 '(("extra/man" "share/man/man1" #:include-regexp ("\\.1$"))
1611 ("extra/man" "share/man/man5" #:include-regexp ("\\.5$"))
1612 ("extra/man" "share/man/man7" #:include-regexp ("\\.7$"))
1613 ("extra/linux/Alacritty.desktop" "share/applications/")
1614 ("extra/linux/org.alacritty.Alacritty.appdata.xml"
1615 "share/metainfo/")
1616 ("extra/logo/alacritty-term.svg"
1617 "share/icons/hicolor/scalable/apps/Alacritty.svg")
1618 ;; completions
1619 ("extra/completions/alacritty.bash"
1620 "share/bash-completion/completions/alacritty")
1621 ("extra/completions/_alacritty"
1622 "share/zsh/site-functions/")
1623 ("extra/completions/alacritty.fish"
1624 "share/fish/vendor_completions.d/"))
1625 args)
1626 ;; Install terminfo.
1627 (mkdir-p terminfo)
1628 ;; We don't compile alacritty-common entry because
1629 ;; it's being used only for inheritance.
1630 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1631 "-o" terminfo
1632 "extra/alacritty.info")))))))
1633 (native-inputs
1634 (list ncurses
1635 pkg-config
1636 python
1637 scdoc))
1638 (inputs
1639 (cons* expat
1640 fontconfig
1641 freetype
1642 libx11
1643 libxcb
1644 libxcursor
1645 libxext
1646 libxft
1647 libxi
1648 libxinerama
1649 libxkbcommon
1650 libxmu
1651 libxpresent
1652 libxrandr
1653 libxscrnsaver
1654 libxt
1655 libxtst
1656 libxxf86vm
1657 mesa
1658 xdg-utils
1659 wayland
1660 (cargo-inputs 'alacritty)))
1661 (native-search-paths
1662 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1663 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1664 (list (search-path-specification
1665 (variable "TERMINFO_DIRS")
1666 (files '("share/terminfo")))))
1667 (home-page "https://alacritty.org/")
1668 (synopsis "GPU-accelerated terminal emulator")
1669 (description
1670 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1671simplicity and performance. With such a strong focus on performance, included
1672features are carefully considered and you can always expect Alacritty to be
1673blazingly fast. By making sane choices for defaults, Alacritty requires no
1674additional setup. However, it does allow configuration of many aspects of the
1675terminal. Note that you need support for OpenGL 3.2 or higher.")
1676 (license license:asl2.0)))
1677
1678(define-public bootterm
1679 (package
1680 (name "bootterm")
1681 (version "0.5")
1682 (source (origin
1683 (method git-fetch)
1684 (uri (git-reference
1685 (url "https://github.com/wtarreau/bootterm")
1686 (commit (string-append "v" version))))
1687 (file-name (git-file-name name version))
1688 (sha256
1689 (base32
1690 "1xag6agcqkq2p7gp20qxjb95ah7p6lia65jmm5v51rqxfzclx2h1"))))
1691 (build-system gnu-build-system)
1692 (arguments
1693 (list #:tests? #f ; no test suite
1694 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
1695 (string-append "PREFIX=" #$output))
1696 #:phases
1697 #~(modify-phases %standard-phases
1698 ;; No ./configure script
1699 (delete 'configure)
1700 (add-after 'install 'install-doc
1701 (lambda* (#:key outputs #:allow-other-keys)
1702 (let ((doc (format #f "~a/share/doc/~a-~a"
1703 #$output #$name #$version)))
1704 (install-file "README.md" doc)))))))
1705 (home-page "https://github.com/wtarreau/bootterm")
1706 (synopsis "Serial terminal")
1707 (description "Bootterm is a terminal designed to ease connection to
1708ephemeral serial ports. It features automatic port detection, port enumeration,
1709support for non-standard baud rates, the ability to wait for ports to appear,
1710and the ability to read and write via stdin and stdout.")
1711 (license license:expat)))
1712
1713(define-public roxterm
1714 (package
1715 (name "roxterm")
1716 (version "3.17.2")
1717 (source (origin
1718 (method git-fetch)
1719 (uri (git-reference
1720 (url "https://github.com/realh/roxterm")
1721 (commit version)))
1722 (file-name (git-file-name name version))
1723 (sha256
1724 (base32
1725 "1lr8fd40qwjghmlkfqa8b9c64mlxxfws7diia0rdk88v0cvb3ia0"))))
1726 (build-system cmake-build-system)
1727 (arguments
1728 `(#:tests? #f)) ; No tests
1729 (native-inputs
1730 (list docbook-xsl
1731 docbook-xml
1732 (list glib "bin")
1733 gettext-minimal
1734 libxml2
1735 libxslt
1736 pkg-config))
1737 (inputs
1738 (list dbus dbus-glib gtk+ pcre vte/gtk+-3))
1739 (synopsis "Terminal emulator")
1740 (description "This package provides a terminal emulator with hyperlink
1741support. It's based on VTE and aimed at power users.")
1742 (home-page "https://realh.github.io/roxterm/en/index.html")
1743 ;; src/gresources.c is under LGPL 2.1+
1744 (license (list license:gpl2+ license:lgpl2.1+))))
1745
1746(define-public fbterm
1747 (package
1748 (name "fbterm")
1749 (version "1.7")
1750 (source
1751 (origin
1752 (method git-fetch)
1753 (uri (git-reference (url "https://salsa.debian.org/debian/fbterm.git")
1754 (commit (string-append "upstream/" version))))
1755 (file-name (git-file-name name version))
1756 (sha256
1757 (base32
1758 "1nl9z169a59akgb8b5j2pw5fp3bbkmv553rryffkfz45d1cxskvq"))))
1759 (build-system gnu-build-system)
1760 (arguments
1761 (list #:make-flags #~(list (string-append "prefix=" #$output)
1762 "HOME=/tmp"
1763
1764 ;; Silence "narrow conversion" errors.
1765 "CXXFLAGS=-Wno-narrowing -O2 -g")))
1766 (inputs (list freetype fontconfig ncurses gpm))
1767 (native-inputs (list pkg-config))
1768 (home-page "https://salsa.debian.org/debian/fbterm")
1769 (synopsis "Fast and lightweight framebuffer-based terminal emulator for Linux")
1770 (description "FbTerm is a fast terminal emulator for Linux with frame
1771buffer device or VESA video card. Features include:
1772
1773@itemize
1774@item mostly as fast as terminal of Linux kernel while accelerated scrolling
1775is enabled;
1776@item select font with fontconfig and draw text with freetype2, same as
1777Qt/Gtk+ based GUI apps;
1778@item dynamically create/destroy up to 10 windows initially running default
1779shell;
1780@item record scrollback history for every window;
1781@item auto-detect current locale and convert text encoding, support double
1782width scripts like Chinese, Japanese etc;
1783@item switch between configurable additional text encodings with hot keys on
1784the fly;
1785@item copy/paste selected text between windows with mouse when gpm server is
1786running;
1787@item change the orientation of screen display, a.k.a. screen rotation;
1788@item lightweight input method framework with client-server architecture;
1789@item background image for eye candy.
1790@end itemize")
1791 (license license:gpl2+)))
1792
1793;; See https://github.com/wezterm/wezterm/blob/main/README-DISTRO-MAINTAINER.md
1794(define-public wezterm
1795 (let ((commit "05343b387085842b434d267f91b6b0ec157e4331")
1796 ;; git -c "core.abbrev=8" show -s "--format=%cd" "--date=format:%Y%m%d.%H%M%S"
1797 (date "20260117.154428"))
1798 (package
1799 (name "wezterm")
1800 (version (string-append date "." (substring commit 0 8)))
1801 (source
1802 (origin
1803 (method git-fetch)
1804 (file-name (git-file-name name version))
1805 (uri (git-reference
1806 (url "https://github.com/wezterm/wezterm")
1807 (commit commit)))
1808 (sha256
1809 (base32 "1pkng8dvjc917j4i8sly8cz91nx1yh2k83i78rcs43gdxs79gjds"))
1810 (modules
1811 '((ice-9 match)
1812 (guix build utils)))
1813 (snippet
1814 '(begin
1815 ;; Remove bundled dependencies.
1816 (for-each
1817 delete-file-recursively
1818 '("assets/fonts"
1819 "assets/macos"
1820 "assets/windows"
1821 "deps/cairo/cairo"
1822 "deps/cairo/pixman"))
1823 ;; Link static libraries for dependencies under ./deps.
1824 (for-each
1825 (match-lambda
1826 ((name dependencies)
1827 (with-directory-excursion (in-vicinity "deps" name)
1828 (make-file-writable "build.rs")
1829 (with-output-to-file "build.rs"
1830 (lambda ()
1831 (format #t "\
1832// Modified by Guix.
1833fn main() {
1834~{\
1835 println!(\"cargo:rustc-link-lib=~a\");
1836~}\
1837}~%"
1838 dependencies))))))
1839 '(("cairo" ("cairo" "pixman-1"))
1840 ("fontconfig" ("fontconfig"))
1841 ("freetype" ("freetype" "png" "z"))
1842 ("harfbuzz" ("harfbuzz"))))
1843 ;; Don't try to vendor lua.
1844 (substitute* "config/Cargo.toml"
1845 (("\"vendored\", ") ""))))))
1846 (build-system cargo-build-system)
1847 (arguments
1848 (list
1849 #:install-source? #f
1850 #:features
1851 ''("distro-defaults")
1852 #:cargo-test-flags
1853 ''("--"
1854 ;; Test data differs, probably due to unbundling of fonts.
1855 ;; https://codeberg.org/guix/guix/pulls/6020#issuecomment-10364990
1856 "--skip=shapecache::test::ligatures_jetbrains")
1857 #:modules
1858 '((srfi srfi-26)
1859 (ice-9 match)
1860 (guix build cargo-build-system)
1861 (guix build utils))
1862 #:phases
1863 #~(modify-phases %standard-phases
1864 (add-after 'unpack 'use-guix-vendored-dependencies
1865 (lambda _
1866 ;; Override dependencies declared with git repos / revisions.
1867 (substitute* "Cargo.toml"
1868 ;; finl-unicode
1869 ((", git.*default-features")
1870 ", default-features")
1871 ;; xcb-imdkit-rs.
1872 ((", git.*, rev.*}")
1873 ;; use-system-lib ensures the package won't try pulling in
1874 ;; additional dependencies and instead relies on the inputs
1875 ;; we passed in.
1876 ", features=[\"use-system-lib\"]}"))))
1877 (add-after 'unpack 'prepare-build-environment
1878 (lambda _
1879 (with-output-to-file ".tag"
1880 (lambda ()
1881 (display #$(package-version this-package))))
1882 ;; These libraries will be used at runtime. Add into RUNPATH.
1883 (setenv "RUSTFLAGS"
1884 (string-join
1885 '("-C" "link-arg=-lEGL"
1886 "-C" "link-arg=-lvulkan")
1887 " "))))
1888 (add-after 'unpack 'fix-font-load-path
1889 (lambda* (#:key inputs #:allow-other-keys)
1890 (substitute* "wezterm-font/src/parser.rs"
1891 (("../../assets/fonts/(.*\\.ttf)" _ font)
1892 (search-input-file
1893 inputs (in-vicinity "share/fonts/truetype" font))))))
1894 (replace 'install
1895 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1896 ;; Binaries
1897 (with-directory-excursion "target/release"
1898 (for-each (cut install-file <> (in-vicinity #$output "bin"))
1899 '("wezterm" "wezterm-gui"
1900 "wezterm-mux-server"
1901 "strip-ansi-escapes")))
1902
1903 ;; Terminfo
1904 (with-directory-excursion "termwiz/data"
1905 (let ((terminfo (in-vicinity #$output "share/terminfo"))
1906 (tic (search-input-file
1907 (or native-inputs inputs) "bin/tic")))
1908 (mkdir-p terminfo)
1909 (for-each (cut invoke tic "-x" "-o" terminfo <>)
1910 '("wezterm.terminfo"
1911 ;; Wezterm by default identifies itself as
1912 ;; xterm-256color, which this terminfo provides
1913 ;; despite the "-italic" part.
1914 "xterm-256color-italic.terminfo"))))
1915
1916 ;; Completions
1917 (with-directory-excursion "assets/shell-completion"
1918 (for-each
1919 (match-lambda
1920 ((shell . target)
1921 (let ((path (in-vicinity #$output target)))
1922 (mkdir-p (dirname path))
1923 (copy-file shell path))))
1924 '(("bash" . "share/bash-completion/completions/wezterm")
1925 ("fish" . "share/fish/vendor_completions.d/wezterm.fish")
1926 ("zsh" . "share/zsh/site-functions/_wezterm"))))
1927
1928 ;; Integrations
1929 (with-directory-excursion "assets/shell-integration"
1930 (let ((profile-d (in-vicinity #$output "etc/profile.d")))
1931 (mkdir-p profile-d)
1932 (install-file "wezterm.sh" profile-d)))
1933
1934 ;; Icon
1935 (with-directory-excursion "assets/icon"
1936 (let ((icons (in-vicinity
1937 #$output "share/icons/hicolor/scalable/apps")))
1938 (mkdir-p icons)
1939 (copy-file
1940 "wezterm-icon.svg"
1941 (in-vicinity icons "org.wezfurlong.wezterm.svg"))))
1942
1943 ;; Desktop file
1944 (install-file "assets/wezterm.desktop"
1945 (in-vicinity #$output "share/applications"))
1946 (install-file "assets/wezterm.appdata.xml"
1947 (in-vicinity #$output "share/metainfo"))
1948
1949 ;; Nautilus extension
1950 (install-file
1951 "assets/wezterm-nautilus.py"
1952 (in-vicinity #$output "share/nautilus-python/extensions"))
1953
1954 ;; Helper script
1955 (install-file "assets/open-wezterm-here"
1956 (in-vicinity #$output "bin")))))))
1957 (native-inputs (list ncurses pkg-config))
1958 (inputs
1959 (cons* font-google-noto-emoji
1960 font-google-roboto
1961 font-jetbrains-mono
1962 font-nerd-symbols
1963 libgit2
1964 libssh
1965 libssh2
1966 libx11
1967 libxcb
1968 libxkbcommon
1969 lua-5.4
1970 mesa
1971 openssl
1972 sqlite
1973 vulkan-loader
1974 wayland
1975 xcb-imdkit
1976 xcb-util
1977 xcb-util-image
1978 `(,zstd "lib")
1979 ;; Replacements for deps/ libraries.
1980 cairo
1981 fontconfig
1982 freetype
1983 harfbuzz
1984 libpng
1985 pixman
1986 zlib
1987 (cargo-inputs 'wezterm)))
1988 (native-search-paths
1989 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1990 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1991 (list (search-path-specification
1992 (variable "TERMINFO_DIRS")
1993 (files '("share/terminfo")))))
1994 (home-page "https://wezterm.org/")
1995 (synopsis "Cross-platform terminal emulator and multiplexer")
1996 (description
1997 "WezTerm is a GPU-accelerated terminal emulator and multiplexer that
1998features:
1999
2000@itemize
2001@item Multiplex terminal panes, tabs and windows on local and remote hosts, with
2002native mouse and scrollback.
2003@item Ligatures, color emoji and font fallback, with true color and dynamic
2004color schemes.
2005@item Hyperlinks.
2006@end itemize")
2007 (license license:expat))))