projects/guix·blob java-team · refs

2010 lines · 83.5 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 "/lib/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
713Add a @code{udev-rules-service} rule to your system configuration to use
714beep, e.g. @code{(udev-rules-service 'beep beep)}.")
715 (home-page "https://github.com/spkr-beep/beep")
716 (license license:gpl2+))))
717
718(define-public unibilium
719 (package
720 (name "unibilium")
721 (version "2.0.0")
722 (source
723 (origin
724 (method git-fetch)
725 (uri (git-reference
726 (url "https://github.com/mauke/unibilium")
727 (commit (string-append "v" version))))
728 (file-name (git-file-name name version))
729 (sha256
730 (base32
731 "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2"))))
732 (build-system gnu-build-system)
733 (arguments
734 `(#:make-flags
735 (list "CC=gcc"
736 (string-append "PREFIX=" (assoc-ref %outputs "out")))
737 #:test-target "test"
738 ;; FIXME: tests require "prove"
739 #:tests? #f
740 #:phases
741 (modify-phases %standard-phases
742 (delete 'configure))))
743 (native-inputs
744 (list libtool perl))
745 (home-page "https://github.com/mauke/unibilium")
746 (synopsis "Terminfo parsing library")
747 (description "Unibilium is a basic C terminfo library. It doesn't depend
748on curses or any other library. It also doesn't use global variables, so it
749should be thread-safe.")
750 (license license:lgpl3+)))
751
752(define-public libvterm
753 (package
754 (name "libvterm")
755 (version "0.3.3")
756 (source
757 (origin
758 (method url-fetch)
759 (uri (string-append
760 "https://launchpad.net/libvterm/trunk/v"
761 (version-major+minor version)
762 "/+download/libvterm-" version ".tar.gz"))
763 (sha256
764 (base32 "1q16fbznm54p24hqvw8c9v3347apk86ybsxyghsbsa11vm1ny589"))))
765 (build-system gnu-build-system)
766 (arguments
767 (list #:make-flags
768 #~(list
769 ;; FIXME: cross build fails.
770 ;; ld: src/.libs/encoding.o: error adding symbols: file in wrong format
771 ;; collect2: error: ld returned 1 exit status
772 (string-append "CC=" #$(cc-for-target))
773 (string-append "PREFIX=" #$output))
774 #:test-target "test"
775 #:phases
776 #~(modify-phases %standard-phases
777 (delete 'configure))))
778 (native-inputs
779 (list libtool perl))
780 (home-page "https://www.leonerd.org.uk/code/libvterm/")
781 (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
782 (description "Libvterm is an abstract C99 library which implements a VT220
783or xterm-like terminal emulator. It doesn't use any particular graphics
784toolkit or output system, instead it invokes callback function pointers that
785its embedding program should provide it to draw on its behalf. It avoids
786calling @code{malloc} during normal running state, allowing it to be used in
787embedded kernel situations.")
788 (license license:expat)))
789
790(define-public cool-retro-term
791 (package
792 (name "cool-retro-term")
793 (version "1.2.0")
794 (source (origin
795 (method git-fetch)
796 (file-name (string-append name "-" version "-checkout"))
797 (uri (git-reference
798 (url (string-append "https://github.com/Swordfish90/" name))
799 (commit version)
800 (recursive? #t)))
801 (sha256
802 (base32 "02mj70gcpx9fvrhsy6iqwp399dya9iyakx940b6ws952d23xn337"))
803 (modules '((guix build utils)
804 (srfi srfi-1)
805 (srfi srfi-26)
806 (ice-9 rdelim)
807 (ice-9 regex)))
808 (patches (search-patches "cool-retro-term-wctype.patch"))
809 (snippet
810 '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
811 "1977-apple2" ; Non-Free
812 "1977-commodore-pet" ; Non-Free
813 "1979-atari-400-800" ; Non-Free
814 ;"1981-ibm-pc ; CC-SA 4.0
815 "1982-commodore64")) ; Non-Free
816 ;"1985-ibm-pc-vga" ; CC-SA 4.0
817 ;"modern-fixedsys-excelsior" ; Redistributable
818 ;"modern-hermit" ; SIL
819 ;"modern-inconsolata"; SIL
820 ;"modern-pro-font-win-tweaked" ; X11
821 ;"modern-proggy-tiny"; X11
822 ;"modern-terminus" ; SIL
823 (name-rx (make-regexp " *name: *\"([^\"]*)\""))
824 (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
825 (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
826 (names
827 ;; Gather font names from all Fonts*.qml files.
828 ;; These will be used to remove items from the
829 ;; default profiles.
830 (fold
831 (lambda (font-file names)
832 (call-with-input-file font-file
833 (lambda (port)
834 (let loop ((name #f) (names names))
835 (let ((line (read-line port)))
836 (cond
837 ((eof-object? line) (pk 'names names))
838 ((regexp-exec name-rx line)
839 => (lambda (m)
840 (loop (match:substring m 1) names)))
841 ((regexp-exec source-rx line)
842 => (lambda (m)
843 (let ((font (match:substring m 1)))
844 (if (member font fonts)
845 (loop #f (lset-adjoin string=?
846 names name))
847 (loop #f names)))))
848 (else (loop name names))))))))
849 '() (find-files "app/qml" "Font.*\\.qml"))))
850 ;; Remove the font files themselves
851 (for-each (lambda (font)
852 (delete-file-recursively
853 (string-append "app/qml/fonts/" font)))
854 fonts)
855 ;; Remove mention of those fonts in the source
856 (substitute* "app/qml/resources.qrc"
857 (((string-append " *<file>fonts/("
858 (string-join fonts "|")
859 ").*"))
860 ""))
861 (for-each
862 (lambda (file)
863 (let ((start-rx (make-regexp " *ListElement *\\{"))
864 (end-rx (make-regexp " *\\}")))
865 (with-atomic-file-replacement file
866 (lambda (in out)
867 (let loop ((line-buffer '())
868 (hold? #f)
869 (discard? #f))
870 (let ((line (read-line in 'concat)))
871 (cond
872 ((eof-object? line) #t) ;done
873 ((regexp-exec start-rx line)
874 (loop (cons line line-buffer) #t #f))
875 ((or (regexp-exec source-rx line)
876 (regexp-exec fontname-rx line))
877 => (lambda (m)
878 (let ((font-or-name (match:substring m 1)))
879 (if (or (member font-or-name fonts)
880 (member font-or-name names))
881 (loop '() #f #t)
882 (loop (cons line line-buffer)
883 hold? #f)))))
884 ((regexp-exec end-rx line)
885 (unless discard?
886 (for-each (cut display <> out)
887 (reverse line-buffer))
888 (display line out))
889 (loop '() #f #f))
890 (hold? (loop (cons line line-buffer)
891 hold? discard?))
892 (discard? (loop line-buffer #f #t))
893 (else (display line out)
894 (loop '() #f #f)))))))))
895 '("app/qml/FontPixels.qml"
896 "app/qml/FontScanlines.qml"
897 "app/qml/Fonts.qml"
898 "app/qml/ApplicationSettings.qml"))
899 ;; Final substitution for default scanline and pixel fonts
900 (substitute* "app/qml/ApplicationSettings.qml"
901 (("COMMODORE_PET") "PROGGY_TINY"))))))
902 (build-system gnu-build-system)
903 (inputs
904 (list qtbase-5 qtdeclarative-5 qtgraphicaleffects
905 qtquickcontrols-5 qtquickcontrols2-5 bash-minimal))
906 (arguments
907 `(#:phases
908 (modify-phases %standard-phases
909 (replace 'configure
910 (lambda* (#:key outputs #:allow-other-keys)
911 (let ((out (assoc-ref outputs "out")))
912 (substitute* '("qmltermwidget/qmltermwidget.pro")
913 (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
914 (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
915 (substitute* '("cool-retro-term.pro" "app/app.pro")
916 (("/usr") out))
917 (invoke "qmake"))))
918 (add-after 'install 'wrap-executable
919 (lambda* (#:key inputs outputs #:allow-other-keys)
920 (let ((out (assoc-ref outputs "out"))
921 (qml "/lib/qt5/qml"))
922 (wrap-program (string-append out "/bin/cool-retro-term")
923 `("QML2_IMPORT_PATH" ":" prefix
924 (,(string-append out qml)
925 ,@(map (lambda (i)
926 (string-append (assoc-ref inputs i) qml))
927 '("qtdeclarative"
928 "qtgraphicaleffects"
929 "qtquickcontrols"
930 "qtquickcontrols2"))))))))
931 (add-after 'install 'add-alternate-name
932 (lambda* (#:key outputs #:allow-other-keys)
933 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
934 (symlink (string-append bin "/cool-retro-term")
935 (string-append bin "/crt")))))
936 (add-after 'install 'install-man
937 (lambda* (#:key outputs #:allow-other-keys)
938 (let ((mandir (string-append (assoc-ref outputs "out")
939 "/share/man/man1")))
940 (install-file "packaging/debian/cool-retro-term.1" mandir)))))))
941 (synopsis "Terminal emulator")
942 (description
943 "Cool-retro-term (crt) is a terminal emulator which mimics the look and
944feel of the old cathode ray tube (CRT) screens. It has been designed to be
945eye-candy, customizable, and reasonably lightweight.")
946 (home-page "https://github.com/Swordfish90/cool-retro-term")
947 (license (list
948 license:gpl2+ ; qmltermwidget
949 license:gpl3+ ; cool-retro-term
950 ;; Fonts
951 license:silofl1.1
952 license:x11
953 license:bsd-3))))
954
955(define-public foot
956 (package
957 (name "foot")
958 (version "1.28.0")
959 (home-page "https://codeberg.org/dnkl/foot")
960 (source
961 (origin
962 (method git-fetch)
963 (uri (git-reference
964 (url home-page)
965 (commit version)))
966 (file-name (git-file-name name version))
967 (sha256
968 (base32 "0vwqg07jvhqxd3f5zrnabs8p5c38qf9r92vbflzwz33rxd15p689"))))
969 (build-system meson-build-system)
970 (arguments
971 (list
972 ;; Using a "release" build is recommended both for performance, and
973 ;; also to address a GCC 10 issue when doing PGO builds.
974 #:build-type "release"
975 ;; Enable LTO as recommended by INSTALL.md.
976 ;; when cross-compilation, enable lto will fail.
977 #:configure-flags (if (%current-target-system)
978 #~'()
979 #~'("-Db_lto=true"))))
980 (native-inputs (append
981 (if (%current-target-system)
982 (list wayland pkg-config-for-build)
983 '())
984 (list ncurses ;for 'tic'
985 pkg-config scdoc wayland-protocols)))
986 (native-search-paths
987 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
988 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
989 (list (search-path-specification
990 (variable "TERMINFO_DIRS")
991 (files '("share/terminfo")))))
992 (inputs (list fcft libxkbcommon wayland wayland-protocols))
993 (synopsis "Wayland-native terminal emulator")
994 (description
995 "@command{foot} is a terminal emulator for systems using the Wayland
996display server. It is designed to be fast, lightweight, and independent of
997desktop environments. It can be used as a standalone terminal and also has
998a server/client mode.")
999 (license license:expat)))
1000
1001(define-public havoc
1002 (package
1003 (name "havoc")
1004 (version "0.7.0")
1005 (source (origin
1006 (method git-fetch)
1007 (uri (git-reference
1008 (url "https://github.com/ii8/havoc")
1009 (commit version)))
1010 (file-name (git-file-name name version))
1011 (sha256
1012 (base32
1013 "1c53dddq33b1vij5aa4rkzypgrxcp3hbgh15zb6lgbii12n0fz8y"))))
1014 (build-system gnu-build-system)
1015 (arguments
1016 (list
1017 #:tests? #f ; no check target
1018 #:make-flags #~(list (string-append "PREFIX=" #$output))
1019 #:phases
1020 #~(modify-phases %standard-phases
1021 (delete 'configure) ; no configure script
1022 (add-before 'build 'set-CC
1023 (lambda _
1024 (setenv "CC" #$(cc-for-target)))))))
1025 (native-inputs
1026 (list pkg-config wayland-protocols))
1027 (inputs
1028 (list libxkbcommon wayland))
1029 (home-page "https://github.com/ii8/havoc")
1030 (synopsis "Minimal terminal emulator for Wayland")
1031 (description
1032 "Havoc is a minimal terminal emulator for Wayland.")
1033 (license license:expat)))
1034
1035(define-public sakura
1036 (package
1037 (name "sakura")
1038 (version "3.8.9")
1039 (source (origin
1040 (method url-fetch)
1041 (uri (string-append "https://launchpad.net/sakura/trunk/"
1042 version "/+download/sakura-" version
1043 ".tar.bz2"))
1044 (sha256
1045 (base32
1046 "09qa1crlml3ib3bc03dg73j950bn0brqm3y7fb8h4a6nbndird2k"))))
1047 (build-system cmake-build-system)
1048 (arguments
1049 '(#:tests? #f)) ; no check phase
1050 (native-inputs
1051 (list gettext-minimal perl ; for pod2man
1052 pkg-config))
1053 (inputs
1054 (list libxft vte/gtk+-3))
1055 (home-page "https://launchpad.net/sakura")
1056 (synopsis "Simple but powerful libvte-based terminal emulator")
1057 (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
1058It's a terminal emulator with few dependencies, so you don't need a full GNOME
1059desktop installed to have a decent terminal emulator.")
1060 (license license:gpl2)))
1061
1062(define-public xiate
1063 (let ((commit "ae3cf30b345c64f097a747ac848e23ef5bae8b57")
1064 (revision "0"))
1065 (package
1066 (name "xiate")
1067 (version (git-version "22.12" revision commit))
1068 (source (origin
1069 (method git-fetch)
1070 (file-name (git-file-name name version))
1071 (uri (git-reference
1072 (url "https://www.uninformativ.de/git/xiate.git")
1073 (commit commit)))
1074 (sha256
1075 (base32
1076 "0bc205b1gs1jvp1a2cr814l32hmlm0sgv1drfw7ykbavslfpmg2d"))))
1077 (build-system gnu-build-system)
1078 (arguments
1079 (list #:tests? #f ;no tests
1080 #:make-flags #~(list (string-append "CC="
1081 #$(cc-for-target))
1082 (string-append "prefix="
1083 #$output))
1084 #:phases #~(modify-phases %standard-phases
1085 (delete 'configure))))
1086 (inputs (list gtk+ glib vte/gtk+-3))
1087 (native-inputs (list pkg-config))
1088 (synopsis "Minimalist terminal emulator based on GTK+")
1089 (description
1090 "Xiate is a terminal emulator which tries to keep a balance
1091between features and simplicity. This is achieved by using VTE as a powerful
1092backend, while UI, configuration, and code try to remain much more
1093minimalistic.")
1094 (home-page "https://www.uninformativ.de/git/xiate/file/README.html")
1095 (license license:expat))))
1096
1097(define-public fzf
1098 (package
1099 (name "fzf")
1100 (version "0.74.2")
1101 (source
1102 (origin
1103 (method git-fetch)
1104 (uri (git-reference
1105 (url "https://github.com/junegunn/fzf")
1106 (commit (string-append "v" version))))
1107 (file-name (git-file-name name version))
1108 (sha256
1109 (base32 "0cv9h6g2l1hs3rwbmi5z0lm9vnl4z3cl7xl5zbh9dwn3wqwm1xvg"))))
1110 (build-system go-build-system)
1111 (arguments
1112 (list
1113 #:install-source? #f
1114 #:import-path "github.com/junegunn/fzf"
1115 #:phases
1116 #~(modify-phases %standard-phases
1117 (add-after 'install 'copy-binaries
1118 (lambda* (#:key import-path #:allow-other-keys)
1119 (with-directory-excursion (string-append "src/" import-path)
1120 (install-file "bin/fzf-tmux" (string-append #$output "/bin")))))
1121 (add-after 'copy-binaries 'wrap-programs
1122 (lambda _
1123 (let* ((bin (string-append #$output "/bin"))
1124 (findutils #$(this-package-input "findutils"))
1125 (ncurses #$(this-package-input "ncurses")))
1126 (wrap-program (string-append bin "/fzf")
1127 `("PATH" ":" prefix (,(string-append findutils "/bin"))))
1128 (wrap-program (string-append bin "/fzf-tmux")
1129 `("PATH" ":" prefix (,(string-append ncurses "/bin")))))))
1130 (add-after 'install 'install-completions
1131 (lambda* (#:key import-path #:allow-other-keys)
1132 (let* ((bashrc-functions
1133 (string-append #$output "/etc/bashrc.d"))
1134 (fish-functions
1135 (string-append #$output "/share/fish/vendor_functions.d"))
1136 (zsh-completion
1137 (string-append #$output "/share/zsh/site-functions")))
1138 (with-directory-excursion (string-append "src/" import-path)
1139 (mkdir-p bashrc-functions)
1140 (copy-file "shell/completion.bash"
1141 (string-append bashrc-functions "/fzf-completion.bash"))
1142 (copy-file "shell/key-bindings.bash"
1143 (string-append bashrc-functions "/fzf-bindings.bash"))
1144 (mkdir-p fish-functions)
1145 (copy-file "shell/key-bindings.fish"
1146 (string-append fish-functions "/fzf_key_bindings.fish"))
1147 (mkdir-p zsh-completion)
1148 (copy-file "shell/completion.zsh"
1149 (string-append zsh-completion "/_fzf")))))))))
1150 (native-inputs
1151 (list go-github-com-charlievieth-fastwalk
1152 go-github-com-gdamore-tcell-v2
1153 go-github-com-junegunn-go-shellwords
1154 go-github-com-mattn-go-isatty
1155 go-github-com-rivo-uniseg
1156 go-golang-org-x-sys
1157 go-golang-org-x-term))
1158 (inputs
1159 (list bash-minimal
1160 findutils
1161 ncurses))
1162 (home-page "https://junegunn.github.io/fzf/")
1163 (synopsis "Command-line fuzzy-finder")
1164 (description "This package provides an interactive command-line filter
1165usable with any list--including files, command history, processes and more.")
1166 (license license:expat)))
1167
1168(define-public python-pyfzf
1169 (package
1170 (name "python-pyfzf")
1171 (version "0.3.1")
1172 (source
1173 (origin
1174 (method url-fetch)
1175 (uri (pypi-uri "pyfzf" version))
1176 (sha256
1177 (base32 "1lkbnhjf92063gg9snxskcx4n2yj7mck2qgrh8q9rjpyrws2x46x"))))
1178 (build-system pyproject-build-system)
1179 (arguments
1180 (list #:tests? #f)) ;no tests
1181 (native-inputs
1182 (list python-setuptools))
1183 (inputs
1184 (list fzf))
1185 (home-page "https://github.com/nk412/pyfzf")
1186 (synopsis "Python wrapper for junegunn's fuzzyfinder (fzf)")
1187 (description "This package provides a thin wrapper for @code{fzf}.")
1188 (license license:expat)))
1189
1190(define-public tmate
1191 (package
1192 (name "tmate")
1193 ;; XXX: The project looks like abandoned, where 2.4.0 was released in 2019
1194 ;; and the latest commit on master's HEAD is from 2022, see:
1195 ;; <https://github.com/tmate-io/tmate/issues/306>.
1196 (properties '((commit . "ac919516f4f1b10ec928e20b3a5034d18f609d68")
1197 (revision . "0")))
1198 (version (git-version "2.4.0"
1199 (assoc-ref properties 'revision)
1200 (assoc-ref properties 'commit)))
1201 (source
1202 (origin
1203 (method git-fetch)
1204 (uri (git-reference
1205 (url "https://github.com/tmate-io/tmate")
1206 (commit (assoc-ref properties 'commit))))
1207 (file-name (git-file-name name version))
1208 (sha256
1209 (base32 "1gwmwiq0fc0bl4calnzp53hp3wyr66qvsagz37jchwhcc1za1pmp"))))
1210 (build-system gnu-build-system)
1211 (arguments
1212 (list
1213 #:phases
1214 #~(modify-phases %standard-phases
1215 (add-after 'unpack 'fix-msgpack-version
1216 (lambda _
1217 (substitute* "configure.ac"
1218 (("msgpack >= 1.1.0")
1219 "msgpack-c >= 1.1.0")))))))
1220 (inputs (list libevent libssh msgpack-c ncurses))
1221 (native-inputs (list autoconf automake pkg-config))
1222 (home-page "https://tmate.io/")
1223 (synopsis "Terminal sharing application")
1224 (description
1225 "tmate is a terminal sharing application that allows you to share your
1226terminal with other users over the Internet. tmate is a fork of tmux.")
1227 (license license:isc)))
1228
1229(define-public kitty
1230 (package
1231 (name "kitty")
1232 (version "0.48.2")
1233 (source
1234 (origin
1235 (method git-fetch)
1236 (uri (git-reference
1237 (url "https://github.com/kovidgoyal/kitty")
1238 (commit (string-append "v" version))))
1239 (file-name (git-file-name name version))
1240 (sha256
1241 (base32 "05861h7xyksphsbnkff8jphpk7xrjpsmcqxhklzwd6yckcz1bn58"))
1242 (modules '((guix build utils)))
1243 (snippet
1244 #~(begin
1245 ;; Fails to read /etc/machine-id in the build container.
1246 (delete-file "tools/utils/machine_id/api_test.go")
1247 (substitute* "docs/conf.py"
1248 (("(from kitty.constants import str_version)" imp)
1249 (string-append "sys.path.append(\"..\")\n" imp)))
1250 ;; Depends on <https://github.com/pradyunsg/furo> which
1251 ;; is not packaged yet and depends on some missing Node.js packages
1252 (substitute* "docs/conf.py"
1253 (("^html_theme = .*$") "html_theme = 'alabaster'\n"))
1254 (substitute* "docs/Makefile"
1255 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
1256 "SPHINXBUILD = sphinx-build\n"))))))
1257 (build-system go-build-system)
1258 (outputs '("out" "terminfo" "shell-integration" "kitten"))
1259 (arguments
1260 (list
1261 #:go go-1.26
1262 #:import-path "github.com/kovidgoyal/kitty/tools/cmd"
1263 #:unpack-path "github.com/kovidgoyal/kitty"
1264 #:embed-files #~(list ".*\\.xml" ".*\\.json" ".*\\.txt" ".*\\.css" ".*\\.html" ".*\\.icc")
1265 #:phases
1266 #~(modify-phases %standard-phases
1267 (delete 'build)
1268
1269 (add-after 'unpack 'setup-fonts
1270 (lambda* (#:key inputs #:allow-other-keys)
1271 (let ((fonts (string-append
1272 (assoc-ref inputs "font-nerd-symbols")
1273 "/share/fonts/truetype")))
1274 ;; FontConfig expects a home
1275 (setenv "HOME" "/tmp")
1276 (mkdir-p "fonts")
1277 (copy-recursively fonts "fonts"))))
1278
1279 (add-after 'fix-embed-files 'build-kitty
1280 (lambda* (#:key inputs #:allow-other-keys)
1281 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1282 (for-each make-file-writable (find-files "kitty"))
1283 (apply invoke "python3" "setup.py" "linux-package"
1284 "--update-check-interval=0"
1285 "--shell-integration=enabled no-rc"
1286 (map (lambda (pair)
1287 (string-append "--" (car pair) "="
1288 (search-input-file inputs (cdr pair))))
1289 '(("egl-library" . "/lib/libEGL.so.1")
1290 ("startup-notification-library" . "/lib/libstartup-notification-1.so")
1291 ("canberra-library" . "/lib/libcanberra.so")
1292 ("fontconfig-library" . "/lib/libfontconfig.so"))))
1293 (invoke "python3" "setup.py" "build-launcher"))))
1294
1295 (add-after 'build-kitty 'run-python-tests
1296 (lambda* (#:key tests? #:allow-other-keys)
1297 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1298 (when tests?
1299 (setenv "HOME" (getcwd))
1300 (mkdir-p "test-home")
1301 (setenv "XDG_CONFIG_HOME" (string-append (getcwd) "/test-home"))
1302 (setenv "TMPDIR" (string-append (getcwd) "/test-tmp"))
1303 (mkdir-p (getenv "TMPDIR"))
1304 ;; Remove tests requiring display server and dbus access
1305 ;; or otherwise fail due to build container restrictions.
1306 (for-each (lambda (f)
1307 (let ((path (string-append "kitty_tests/" f ".py")))
1308 (when (file-exists? path) (delete-file path))))
1309 '("check_build" "child" "glfw" "multicell"
1310 "tui" "shell_integration" "ssh" "options"
1311 "atexit" "shm" "file_transmission" "completion"))
1312 (invoke "python3" "test.py")))))
1313
1314 (replace 'install
1315 (lambda _
1316 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1317 (let ((out #$output)
1318 (terminfo #$output:terminfo)
1319 (shell-int #$output:shell-integration)
1320 (kitten #$output:kitten))
1321 (copy-recursively "linux-package/bin" (string-append out "/bin"))
1322 (copy-recursively "linux-package/share" (string-append out "/share"))
1323 (copy-recursively "linux-package/lib" (string-append out "/lib"))
1324 (mkdir-p (string-append kitten "/bin"))
1325 ;; symlinking instead of renaming since kitty expects the kitten
1326 ;; to be alongside of it
1327 (symlink (string-append out "/bin/kitten")
1328 (string-append kitten "/bin/kitten"))
1329 (mkdir-p (string-append terminfo "/share"))
1330 (rename-file (string-append out "/share/terminfo")
1331 (string-append terminfo "/share/terminfo"))
1332 (copy-recursively "shell-integration" shell-int))))))))
1333 (native-inputs
1334 (list bash-minimal
1335 dbus
1336 fish
1337 font-nerd-symbols
1338 go-github-com-alecthomas-chroma-v2
1339 go-github-com-altree-bigfloat
1340 go-github-com-bmatcuk-doublestar-v4
1341 go-github-com-dlclark-regexp2
1342 ;; go-github-com-ebitengine-purego ;only for Darwin
1343 go-github-com-emmansun-base64
1344 go-github-com-google-go-cmp
1345 go-github-com-google-uuid
1346 go-github-com-hako-durafmt
1347 go-github-com-klauspost-compress
1348 go-github-com-kovidgoyal-dbus
1349 go-github-com-kovidgoyal-go-parallel
1350 go-github-com-kovidgoyal-go-shm
1351 go-github-com-kovidgoyal-imaging
1352 go-github-com-nwaples-rardecode-v2
1353 go-github-com-seancfoley-ipaddress-go
1354 go-github-com-shirou-gopsutil-v4
1355 go-github-com-sgtdi-fswatcher
1356 go-github-com-ulikunitz-xz
1357 go-github-com-zeebo-xxh3
1358 go-golang-org-x-exp
1359 go-golang-org-x-image
1360 go-golang-org-x-sys
1361 go-golang-org-x-text
1362 go-howett-net-plist
1363 pkg-config
1364 python-pillow
1365 python-sphinx
1366 python-sphinx-copybutton
1367 python-sphinx-inline-tabs
1368 python-sphinxext-opengraph
1369 wayland-protocols
1370 zsh))
1371 (inputs
1372 (list cairo
1373 fontconfig
1374 harfbuzz
1375 lcms
1376 libcanberra
1377 libpng
1378 librsync
1379 libx11
1380 libxcursor
1381 libxext
1382 libxi
1383 libxinerama
1384 libxkbcommon
1385 libxrandr
1386 mesa
1387 ncurses
1388 openssl
1389 python-wrapper
1390 simde
1391 startup-notification
1392 wayland
1393 xxhash
1394 zlib))
1395 (home-page "https://sw.kovidgoyal.net/kitty/")
1396 (synopsis "Fast, feature-rich, GPU-based terminal emulator")
1397 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1398@itemize
1399@item Offloads rendering to the GPU for lower system load and buttery smooth
1400scrolling. Uses threaded rendering to minimize input latency.
1401@item Supports all modern terminal features: graphics (images), unicode,
1402true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1403paste and several new terminal protocol extensions.
1404@item Supports tiling multiple terminal windows side by side in different
1405layouts without needing to use an extra program like tmux.
1406@item Can be controlled from scripts or the shell prompt, even over SSH.
1407@item Has a framework for Kittens, small terminal programs that can be used to
1408extend kitty's functionality. For example, they are used for Unicode input,
1409hints, and side-by-side diff.
1410@item Supports startup sessions which allow you to specify the window/tab
1411layout, working directories and programs to run on startup.
1412@item Allows you to open the scrollback buffer in a separate window using
1413arbitrary programs of your choice. This is useful for browsing the history
1414comfortably in a pager or editor.
1415@end itemize")
1416 (properties '((cpe-vendor . "kovidgoyal"))) ;to distinguish from 9bis
1417 (license license:gpl3+)))
1418
1419(define-public eternalterminal
1420 (package
1421 (name "eternalterminal")
1422 (version "6.2.11")
1423 (source
1424 (origin
1425 (method git-fetch)
1426 (uri (git-reference
1427 (url "https://github.com/MisterTea/EternalTerminal")
1428 (commit (string-append "et-v" version))))
1429 (file-name (git-file-name name version))
1430 (sha256
1431 (base32 "1ik4kdw574l087yxck2clzwjmdacar8my3k2ih8dbn5m0djq4ybp"))))
1432 (build-system cmake-build-system)
1433 (arguments
1434 '(#:configure-flags '("-DBUILD_TEST=ON" "-DDISABLE_VCPKG=1")))
1435 (inputs (list libsodium protobuf openssl zlib curl))
1436 (home-page "https://mistertea.github.io/EternalTerminal/")
1437 (synopsis "Remote shell that reconnects without interrupting the session")
1438 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1439automatically reconnects without interrupting the session. ET uses SSH to
1440initialize a secure connection. Unlike SSH sessions, which must be killed and
1441reconnected after a network outage an ET session will survive network outages
1442and IP roaming. ET provides the same core functionality as @command{mosh},
1443while also supporting native scrolling and @command{tmux} control mode
1444(@code{tmux -CC}).")
1445 (license license:asl2.0)))
1446
1447(define-public tilix
1448 (package
1449 (name "tilix")
1450 (version "1.9.6")
1451 (source
1452 (origin
1453 (method git-fetch)
1454 (uri (git-reference
1455 (url "https://github.com/gnunn1/tilix")
1456 (commit version)))
1457 (file-name (git-file-name name version))
1458 (sha256
1459 (base32 "1vq0igfq1hj017ivfkd03zbb620qhvcjn9vd56c5dr4r1j7jiz98"))))
1460 (build-system meson-build-system)
1461 (arguments
1462 (list
1463 #:glib-or-gtk? #t
1464 #:phases
1465 #~(modify-phases %standard-phases
1466 (add-after 'unpack 'set-env-variables
1467 (lambda _
1468 (setenv "CC"
1469 #$(cc-for-target))))
1470 (add-after 'unpack 'skip-gtk-update-icon-cache
1471 (lambda _
1472 (substitute* "meson_post_install.py"
1473 (("gtk-update-icon-cache") (which "true"))
1474 (("update-desktop-database") (which "true")))))
1475 (add-after 'install 'remove-d-include-references
1476 #$(remove-d-include-references-phase
1477 (this-package-native-input "ldc"))))))
1478 (inputs (list dbus
1479 dconf
1480 gettext-minimal
1481 gsettings-desktop-schemas
1482 gtkd
1483 gtk+
1484 libsecret
1485 libunwind
1486 vte/gtk+-3))
1487 (native-inputs (list appstream
1488 desktop-file-utils
1489 `(,glib "bin")
1490 `(,gtk+ "bin")
1491 ldc
1492 pkg-config))
1493 (home-page "https://gnunn1.github.io/tilix-web/")
1494 (synopsis "Tiling terminal emulator")
1495 (description
1496 "Tilix is a tiling terminal emulator following the
1497Gnome Human Interface Guidelines. Its features include:
1498@enumerate
1499@item Layout terminals in any fashion by splitting them horizontally or
1500vertically.
1501@item Terminals can be re-arranged using drag and drop both within and between
1502windows.
1503@item Terminals can be detached into a new window via drag and drop.
1504@item Input can be synchronized between terminals so commands typed in one
1505terminal are replicated to the others.
1506@item Supports notifications when processes are completed out of view.
1507@end enumerate")
1508 (license license:mpl2.0)))
1509
1510(define-public tio
1511 (package
1512 (name "tio")
1513 (version "3.9")
1514 (source
1515 (origin
1516 (method git-fetch)
1517 (uri (git-reference
1518 (url "https://github.com/tio/tio")
1519 (commit (string-append "v" version))))
1520 (file-name (git-file-name name version))
1521 (sha256
1522 (base32 "12g2857gp3g2m5g0zjh0dw752lybcnn6gfs7awrsh603b7iqavzp"))))
1523 (build-system meson-build-system)
1524 (native-inputs (list pkg-config))
1525 (inputs (list glib lua))
1526 (arguments
1527 (list
1528 #:configure-flags
1529 #~(list "-Dbashcompletiondir=share/bash-completion/completions")))
1530 (home-page "https://tio.github.io/")
1531 (synopsis "Simple TTY terminal I/O application")
1532 (description "tio is a simple TTY terminal application which features a
1533straightforward commandline interface to easily connect to TTY devices for
1534basic input/output.")
1535 (license license:gpl2+)))
1536
1537(define-public alacritty
1538 (package
1539 (name "alacritty")
1540 (version "0.17.0")
1541 (source
1542 (origin
1543 ;; XXX: The crate at "crates.io" contains only the alacritty subproject
1544 ;; of alacritty and thus has limited contents. In particular,
1545 ;; it does not contain "extra" directory with completions, icon, etc.
1546 (method git-fetch)
1547 (uri (git-reference
1548 (url "https://github.com/alacritty/alacritty")
1549 (commit (string-append "v" version))))
1550 (file-name (git-file-name name version))
1551 (sha256
1552 (base32 "1aw5v127f0jr3jq5cclsbvbvf82g6s195dh1vjlcwjpbc0gl56w9"))))
1553 (build-system cargo-build-system)
1554 (arguments
1555 (list
1556 #:imported-modules (append %copy-build-system-modules
1557 %cargo-build-system-modules)
1558 #:modules '((guix build cargo-build-system)
1559 ((guix build copy-build-system) #:prefix copy:)
1560 (guix build utils))
1561 #:install-source? #f
1562 #:cargo-install-paths ''("alacritty")
1563 #:cargo-test-flags
1564 ''("--"
1565 ;; Changes in clap regularly break this test.
1566 "--skip=cli::tests::completions")
1567 #:phases
1568 #~(modify-phases %standard-phases
1569 (add-after 'unpack 'patch-xdg-open
1570 (lambda* (#:key inputs #:allow-other-keys)
1571 (substitute* "alacritty/src/config/ui_config.rs"
1572 (("xdg-open") (search-input-file inputs "/bin/xdg-open")))))
1573 (add-after 'configure 'add-absolute-library-references
1574 (lambda* (#:key inputs vendor-dir #:allow-other-keys)
1575 ;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
1576 ;; Failed to initialize any backend! Wayland status: NoWaylandLib
1577 ;; XXX We patch transitive dependencies that aren't even direct
1578 ;; inputs to this package, because of the way Guix's Rust build
1579 ;; system currently works. <http://issues.guix.gnu.org/46399>
1580 ;; might fix this and allow patching them directly.
1581 (define shared-library-regex
1582 ;; Using regex decreases the time it takes to run the
1583 ;; substitution over 12000 files by about 40%.
1584 (string-join
1585 (list "libEGL\\.so" ; rust-glutin
1586 "libGL\\.so" ; rust-x11-dl, rust-glutin
1587 "libX[[:alpha:]]*\\.so" ; rust-x11-dl
1588 ; rust-wayland-sys, rust-wayland-backend
1589 "libwayland-[[:alpha:]]*\\.so"
1590 ;; rust-xkbcommon-dl
1591 "libxkbcommon\\.so"
1592 "libxkbcommon-x11\\.so")
1593 "|"))
1594 (substitute* (find-files vendor-dir "\\.rs$")
1595 ((shared-library-regex all)
1596 (search-input-file inputs (string-append "lib/" all))))))
1597 (add-after 'install 'install-more
1598 (lambda* (#:key native-inputs inputs #:allow-other-keys
1599 #:rest args)
1600 (let ((tic (search-input-file
1601 (or native-inputs inputs) "/bin/tic"))
1602 (terminfo (string-append #$output "/share/terminfo")))
1603 (define (create-manpage manpage)
1604 (with-input-from-file manpage
1605 (lambda _
1606 (with-output-to-file (string-drop-right manpage 4)
1607 (lambda _ (invoke "scdoc"))))))
1608 (with-directory-excursion "extra/man"
1609 (for-each create-manpage
1610 (find-files "." "^alacritty.*\\.[[:digit:]]\\.scd$")))
1611 (apply (assoc-ref copy:%standard-phases 'install)
1612 #:install-plan
1613 '(("extra/man" "share/man/man1" #:include-regexp ("\\.1$"))
1614 ("extra/man" "share/man/man5" #:include-regexp ("\\.5$"))
1615 ("extra/man" "share/man/man7" #:include-regexp ("\\.7$"))
1616 ("extra/linux/Alacritty.desktop" "share/applications/")
1617 ("extra/linux/org.alacritty.Alacritty.appdata.xml"
1618 "share/metainfo/")
1619 ("extra/logo/alacritty-term.svg"
1620 "share/icons/hicolor/scalable/apps/Alacritty.svg")
1621 ;; completions
1622 ("extra/completions/alacritty.bash"
1623 "share/bash-completion/completions/alacritty")
1624 ("extra/completions/_alacritty"
1625 "share/zsh/site-functions/")
1626 ("extra/completions/alacritty.fish"
1627 "share/fish/vendor_completions.d/"))
1628 args)
1629 ;; Install terminfo.
1630 (mkdir-p terminfo)
1631 ;; We don't compile alacritty-common entry because
1632 ;; it's being used only for inheritance.
1633 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1634 "-o" terminfo
1635 "extra/alacritty.info")))))))
1636 (native-inputs
1637 (list ncurses
1638 pkg-config
1639 python
1640 scdoc))
1641 (inputs
1642 (cons* expat
1643 fontconfig
1644 freetype
1645 libx11
1646 libxcb
1647 libxcursor
1648 libxext
1649 libxft
1650 libxi
1651 libxinerama
1652 libxkbcommon
1653 libxmu
1654 libxpresent
1655 libxrandr
1656 libxscrnsaver
1657 libxt
1658 libxtst
1659 libxxf86vm
1660 mesa
1661 xdg-utils
1662 wayland
1663 (cargo-inputs 'alacritty)))
1664 (native-search-paths
1665 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1666 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1667 (list (search-path-specification
1668 (variable "TERMINFO_DIRS")
1669 (files '("share/terminfo")))))
1670 (home-page "https://alacritty.org/")
1671 (synopsis "GPU-accelerated terminal emulator")
1672 (description
1673 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1674simplicity and performance. With such a strong focus on performance, included
1675features are carefully considered and you can always expect Alacritty to be
1676blazingly fast. By making sane choices for defaults, Alacritty requires no
1677additional setup. However, it does allow configuration of many aspects of the
1678terminal. Note that you need support for OpenGL 3.2 or higher.")
1679 (license license:asl2.0)))
1680
1681(define-public bootterm
1682 (package
1683 (name "bootterm")
1684 (version "0.5")
1685 (source (origin
1686 (method git-fetch)
1687 (uri (git-reference
1688 (url "https://github.com/wtarreau/bootterm")
1689 (commit (string-append "v" version))))
1690 (file-name (git-file-name name version))
1691 (sha256
1692 (base32
1693 "1xag6agcqkq2p7gp20qxjb95ah7p6lia65jmm5v51rqxfzclx2h1"))))
1694 (build-system gnu-build-system)
1695 (arguments
1696 (list #:tests? #f ; no test suite
1697 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
1698 (string-append "PREFIX=" #$output))
1699 #:phases
1700 #~(modify-phases %standard-phases
1701 ;; No ./configure script
1702 (delete 'configure)
1703 (add-after 'install 'install-doc
1704 (lambda* (#:key outputs #:allow-other-keys)
1705 (let ((doc (format #f "~a/share/doc/~a-~a"
1706 #$output #$name #$version)))
1707 (install-file "README.md" doc)))))))
1708 (home-page "https://github.com/wtarreau/bootterm")
1709 (synopsis "Serial terminal")
1710 (description "Bootterm is a terminal designed to ease connection to
1711ephemeral serial ports. It features automatic port detection, port enumeration,
1712support for non-standard baud rates, the ability to wait for ports to appear,
1713and the ability to read and write via stdin and stdout.")
1714 (license license:expat)))
1715
1716(define-public roxterm
1717 (package
1718 (name "roxterm")
1719 (version "3.17.2")
1720 (source (origin
1721 (method git-fetch)
1722 (uri (git-reference
1723 (url "https://github.com/realh/roxterm")
1724 (commit version)))
1725 (file-name (git-file-name name version))
1726 (sha256
1727 (base32
1728 "1lr8fd40qwjghmlkfqa8b9c64mlxxfws7diia0rdk88v0cvb3ia0"))))
1729 (build-system cmake-build-system)
1730 (arguments
1731 `(#:tests? #f)) ; No tests
1732 (native-inputs
1733 (list docbook-xsl
1734 docbook-xml
1735 (list glib "bin")
1736 gettext-minimal
1737 libxml2
1738 libxslt
1739 pkg-config))
1740 (inputs
1741 (list dbus dbus-glib gtk+ pcre vte/gtk+-3))
1742 (synopsis "Terminal emulator")
1743 (description "This package provides a terminal emulator with hyperlink
1744support. It's based on VTE and aimed at power users.")
1745 (home-page "https://realh.github.io/roxterm/en/index.html")
1746 ;; src/gresources.c is under LGPL 2.1+
1747 (license (list license:gpl2+ license:lgpl2.1+))))
1748
1749(define-public fbterm
1750 (package
1751 (name "fbterm")
1752 (version "1.7")
1753 (source
1754 (origin
1755 (method git-fetch)
1756 (uri (git-reference (url "https://salsa.debian.org/debian/fbterm.git")
1757 (commit (string-append "upstream/" version))))
1758 (file-name (git-file-name name version))
1759 (sha256
1760 (base32
1761 "1nl9z169a59akgb8b5j2pw5fp3bbkmv553rryffkfz45d1cxskvq"))))
1762 (build-system gnu-build-system)
1763 (arguments
1764 (list #:make-flags #~(list (string-append "prefix=" #$output)
1765 "HOME=/tmp"
1766
1767 ;; Silence "narrow conversion" errors.
1768 "CXXFLAGS=-Wno-narrowing -O2 -g")))
1769 (inputs (list freetype fontconfig ncurses gpm))
1770 (native-inputs (list pkg-config))
1771 (home-page "https://salsa.debian.org/debian/fbterm")
1772 (synopsis "Fast and lightweight framebuffer-based terminal emulator for Linux")
1773 (description "FbTerm is a fast terminal emulator for Linux with frame
1774buffer device or VESA video card. Features include:
1775
1776@itemize
1777@item mostly as fast as terminal of Linux kernel while accelerated scrolling
1778is enabled;
1779@item select font with fontconfig and draw text with freetype2, same as
1780Qt/Gtk+ based GUI apps;
1781@item dynamically create/destroy up to 10 windows initially running default
1782shell;
1783@item record scrollback history for every window;
1784@item auto-detect current locale and convert text encoding, support double
1785width scripts like Chinese, Japanese etc;
1786@item switch between configurable additional text encodings with hot keys on
1787the fly;
1788@item copy/paste selected text between windows with mouse when gpm server is
1789running;
1790@item change the orientation of screen display, a.k.a. screen rotation;
1791@item lightweight input method framework with client-server architecture;
1792@item background image for eye candy.
1793@end itemize")
1794 (license license:gpl2+)))
1795
1796;; See https://github.com/wezterm/wezterm/blob/main/README-DISTRO-MAINTAINER.md
1797(define-public wezterm
1798 (let ((commit "05343b387085842b434d267f91b6b0ec157e4331")
1799 ;; git -c "core.abbrev=8" show -s "--format=%cd" "--date=format:%Y%m%d.%H%M%S"
1800 (date "20260117.154428"))
1801 (package
1802 (name "wezterm")
1803 (version (string-append date "." (substring commit 0 8)))
1804 (source
1805 (origin
1806 (method git-fetch)
1807 (file-name (git-file-name name version))
1808 (uri (git-reference
1809 (url "https://github.com/wezterm/wezterm")
1810 (commit commit)))
1811 (sha256
1812 (base32 "1pkng8dvjc917j4i8sly8cz91nx1yh2k83i78rcs43gdxs79gjds"))
1813 (modules
1814 '((ice-9 match)
1815 (guix build utils)))
1816 (snippet
1817 '(begin
1818 ;; Remove bundled dependencies.
1819 (for-each
1820 delete-file-recursively
1821 '("assets/fonts"
1822 "assets/macos"
1823 "assets/windows"
1824 "deps/cairo/cairo"
1825 "deps/cairo/pixman"))
1826 ;; Link static libraries for dependencies under ./deps.
1827 (for-each
1828 (match-lambda
1829 ((name dependencies)
1830 (with-directory-excursion (in-vicinity "deps" name)
1831 (make-file-writable "build.rs")
1832 (with-output-to-file "build.rs"
1833 (lambda ()
1834 (format #t "\
1835// Modified by Guix.
1836fn main() {
1837~{\
1838 println!(\"cargo:rustc-link-lib=~a\");
1839~}\
1840}~%"
1841 dependencies))))))
1842 '(("cairo" ("cairo" "pixman-1"))
1843 ("fontconfig" ("fontconfig"))
1844 ("freetype" ("freetype" "png" "z"))
1845 ("harfbuzz" ("harfbuzz"))))
1846 ;; Don't try to vendor lua.
1847 (substitute* "config/Cargo.toml"
1848 (("\"vendored\", ") ""))))))
1849 (build-system cargo-build-system)
1850 (arguments
1851 (list
1852 #:install-source? #f
1853 #:features
1854 ''("distro-defaults")
1855 #:cargo-test-flags
1856 ''("--"
1857 ;; Test data differs, probably due to unbundling of fonts.
1858 ;; https://codeberg.org/guix/guix/pulls/6020#issuecomment-10364990
1859 "--skip=shapecache::test::ligatures_jetbrains")
1860 #:modules
1861 '((srfi srfi-26)
1862 (ice-9 match)
1863 (guix build cargo-build-system)
1864 (guix build utils))
1865 #:phases
1866 #~(modify-phases %standard-phases
1867 (add-after 'unpack 'use-guix-vendored-dependencies
1868 (lambda _
1869 ;; Override dependencies declared with git repos / revisions.
1870 (substitute* "Cargo.toml"
1871 ;; finl-unicode
1872 ((", git.*default-features")
1873 ", default-features")
1874 ;; xcb-imdkit-rs.
1875 ((", git.*, rev.*}")
1876 ;; use-system-lib ensures the package won't try pulling in
1877 ;; additional dependencies and instead relies on the inputs
1878 ;; we passed in.
1879 ", features=[\"use-system-lib\"]}"))))
1880 (add-after 'unpack 'prepare-build-environment
1881 (lambda _
1882 (with-output-to-file ".tag"
1883 (lambda ()
1884 (display #$(package-version this-package))))
1885 ;; These libraries will be used at runtime. Add into RUNPATH.
1886 (setenv "RUSTFLAGS"
1887 (string-join
1888 '("-C" "link-arg=-lEGL"
1889 "-C" "link-arg=-lvulkan")
1890 " "))))
1891 (add-after 'unpack 'fix-font-load-path
1892 (lambda* (#:key inputs #:allow-other-keys)
1893 (substitute* "wezterm-font/src/parser.rs"
1894 (("../../assets/fonts/(.*\\.ttf)" _ font)
1895 (search-input-file
1896 inputs (in-vicinity "share/fonts/truetype" font))))))
1897 (replace 'install
1898 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1899 ;; Binaries
1900 (with-directory-excursion "target/release"
1901 (for-each (cut install-file <> (in-vicinity #$output "bin"))
1902 '("wezterm" "wezterm-gui"
1903 "wezterm-mux-server"
1904 "strip-ansi-escapes")))
1905
1906 ;; Terminfo
1907 (with-directory-excursion "termwiz/data"
1908 (let ((terminfo (in-vicinity #$output "share/terminfo"))
1909 (tic (search-input-file
1910 (or native-inputs inputs) "bin/tic")))
1911 (mkdir-p terminfo)
1912 (for-each (cut invoke tic "-x" "-o" terminfo <>)
1913 '("wezterm.terminfo"
1914 ;; Wezterm by default identifies itself as
1915 ;; xterm-256color, which this terminfo provides
1916 ;; despite the "-italic" part.
1917 "xterm-256color-italic.terminfo"))))
1918
1919 ;; Completions
1920 (with-directory-excursion "assets/shell-completion"
1921 (for-each
1922 (match-lambda
1923 ((shell . target)
1924 (let ((path (in-vicinity #$output target)))
1925 (mkdir-p (dirname path))
1926 (copy-file shell path))))
1927 '(("bash" . "share/bash-completion/completions/wezterm")
1928 ("fish" . "share/fish/vendor_completions.d/wezterm.fish")
1929 ("zsh" . "share/zsh/site-functions/_wezterm"))))
1930
1931 ;; Integrations
1932 (with-directory-excursion "assets/shell-integration"
1933 (let ((profile-d (in-vicinity #$output "etc/profile.d")))
1934 (mkdir-p profile-d)
1935 (install-file "wezterm.sh" profile-d)))
1936
1937 ;; Icon
1938 (with-directory-excursion "assets/icon"
1939 (let ((icons (in-vicinity
1940 #$output "share/icons/hicolor/scalable/apps")))
1941 (mkdir-p icons)
1942 (copy-file
1943 "wezterm-icon.svg"
1944 (in-vicinity icons "org.wezfurlong.wezterm.svg"))))
1945
1946 ;; Desktop file
1947 (install-file "assets/wezterm.desktop"
1948 (in-vicinity #$output "share/applications"))
1949 (install-file "assets/wezterm.appdata.xml"
1950 (in-vicinity #$output "share/metainfo"))
1951
1952 ;; Nautilus extension
1953 (install-file
1954 "assets/wezterm-nautilus.py"
1955 (in-vicinity #$output "share/nautilus-python/extensions"))
1956
1957 ;; Helper script
1958 (install-file "assets/open-wezterm-here"
1959 (in-vicinity #$output "bin")))))))
1960 (native-inputs (list ncurses pkg-config))
1961 (inputs
1962 (cons* font-google-noto-emoji
1963 font-google-roboto
1964 font-jetbrains-mono
1965 font-nerd-symbols
1966 libgit2
1967 libssh
1968 libssh2
1969 libx11
1970 libxcb
1971 libxkbcommon
1972 lua-5.4
1973 mesa
1974 openssl
1975 sqlite
1976 vulkan-loader
1977 wayland
1978 xcb-imdkit
1979 xcb-util
1980 xcb-util-image
1981 `(,zstd "lib")
1982 ;; Replacements for deps/ libraries.
1983 cairo
1984 fontconfig
1985 freetype
1986 harfbuzz
1987 libpng
1988 pixman
1989 zlib
1990 (cargo-inputs 'wezterm)))
1991 (native-search-paths
1992 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1993 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1994 (list (search-path-specification
1995 (variable "TERMINFO_DIRS")
1996 (files '("share/terminfo")))))
1997 (home-page "https://wezterm.org/")
1998 (synopsis "Cross-platform terminal emulator and multiplexer")
1999 (description
2000 "WezTerm is a GPU-accelerated terminal emulator and multiplexer that
2001features:
2002
2003@itemize
2004@item Multiplex terminal panes, tabs and windows on local and remote hosts, with
2005native mouse and scrollback.
2006@item Ligatures, color emoji and font fallback, with true color and dynamic
2007color schemes.
2008@item Hyperlinks.
2009@end itemize")
2010 (license license:expat))))