projects/guix·blob python-team · refs

1971 lines · 82.0 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 kitty
1191 (package
1192 (name "kitty")
1193 (version "0.48.2")
1194 (source
1195 (origin
1196 (method git-fetch)
1197 (uri (git-reference
1198 (url "https://github.com/kovidgoyal/kitty")
1199 (commit (string-append "v" version))))
1200 (file-name (git-file-name name version))
1201 (sha256
1202 (base32 "05861h7xyksphsbnkff8jphpk7xrjpsmcqxhklzwd6yckcz1bn58"))
1203 (modules '((guix build utils)))
1204 (snippet
1205 #~(begin
1206 ;; Fails to read /etc/machine-id in the build container.
1207 (delete-file "tools/utils/machine_id/api_test.go")
1208 (substitute* "docs/conf.py"
1209 (("(from kitty.constants import str_version)" imp)
1210 (string-append "sys.path.append(\"..\")\n" imp)))
1211 ;; Depends on <https://github.com/pradyunsg/furo> which
1212 ;; is not packaged yet and depends on some missing Node.js packages
1213 (substitute* "docs/conf.py"
1214 (("^html_theme = .*$") "html_theme = 'alabaster'\n"))
1215 (substitute* "docs/Makefile"
1216 (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
1217 "SPHINXBUILD = sphinx-build\n"))))))
1218 (build-system go-build-system)
1219 (outputs '("out" "terminfo" "shell-integration" "kitten"))
1220 (arguments
1221 (list
1222 #:go go-1.26
1223 #:import-path "github.com/kovidgoyal/kitty/tools/cmd"
1224 #:unpack-path "github.com/kovidgoyal/kitty"
1225 #:embed-files #~(list ".*\\.xml" ".*\\.json" ".*\\.txt" ".*\\.css" ".*\\.html" ".*\\.icc")
1226 #:phases
1227 #~(modify-phases %standard-phases
1228 (delete 'build)
1229
1230 (add-after 'unpack 'setup-fonts
1231 (lambda* (#:key inputs #:allow-other-keys)
1232 (let ((fonts (string-append
1233 (assoc-ref inputs "font-nerd-symbols")
1234 "/share/fonts/truetype")))
1235 ;; FontConfig expects a home
1236 (setenv "HOME" "/tmp")
1237 (mkdir-p "fonts")
1238 (copy-recursively fonts "fonts"))))
1239
1240 (add-after 'fix-embed-files 'build-kitty
1241 (lambda* (#:key inputs #:allow-other-keys)
1242 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1243 (for-each make-file-writable (find-files "kitty"))
1244 (apply invoke "python3" "setup.py" "linux-package"
1245 "--update-check-interval=0"
1246 "--shell-integration=enabled no-rc"
1247 (map (lambda (pair)
1248 (string-append "--" (car pair) "="
1249 (search-input-file inputs (cdr pair))))
1250 '(("egl-library" . "/lib/libEGL.so.1")
1251 ("startup-notification-library" . "/lib/libstartup-notification-1.so")
1252 ("canberra-library" . "/lib/libcanberra.so")
1253 ("fontconfig-library" . "/lib/libfontconfig.so"))))
1254 (invoke "python3" "setup.py" "build-launcher"))))
1255
1256 (add-after 'build-kitty 'run-python-tests
1257 (lambda* (#:key tests? #:allow-other-keys)
1258 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1259 (when tests?
1260 (setenv "HOME" (getcwd))
1261 (mkdir-p "test-home")
1262 (setenv "XDG_CONFIG_HOME" (string-append (getcwd) "/test-home"))
1263 (setenv "TMPDIR" (string-append (getcwd) "/test-tmp"))
1264 (mkdir-p (getenv "TMPDIR"))
1265 ;; Remove tests requiring display server and dbus access
1266 ;; or otherwise fail due to build container restrictions.
1267 (for-each (lambda (f)
1268 (let ((path (string-append "kitty_tests/" f ".py")))
1269 (when (file-exists? path) (delete-file path))))
1270 '("check_build" "child" "glfw" "multicell"
1271 "tui" "shell_integration" "ssh" "options"
1272 "atexit" "shm" "file_transmission" "completion"))
1273 (invoke "python3" "test.py")))))
1274
1275 (replace 'install
1276 (lambda _
1277 (with-directory-excursion "src/github.com/kovidgoyal/kitty"
1278 (let ((out #$output)
1279 (terminfo #$output:terminfo)
1280 (shell-int #$output:shell-integration)
1281 (kitten #$output:kitten))
1282 (copy-recursively "linux-package/bin" (string-append out "/bin"))
1283 (copy-recursively "linux-package/share" (string-append out "/share"))
1284 (copy-recursively "linux-package/lib" (string-append out "/lib"))
1285 (mkdir-p (string-append kitten "/bin"))
1286 ;; symlinking instead of renaming since kitty expects the kitten
1287 ;; to be alongside of it
1288 (symlink (string-append out "/bin/kitten")
1289 (string-append kitten "/bin/kitten"))
1290 (mkdir-p (string-append terminfo "/share"))
1291 (rename-file (string-append out "/share/terminfo")
1292 (string-append terminfo "/share/terminfo"))
1293 (copy-recursively "shell-integration" shell-int))))))))
1294 (native-inputs
1295 (list bash-minimal
1296 dbus
1297 fish
1298 font-nerd-symbols
1299 go-github-com-alecthomas-chroma-v2
1300 go-github-com-altree-bigfloat
1301 go-github-com-bmatcuk-doublestar-v4
1302 go-github-com-dlclark-regexp2
1303 ;; go-github-com-ebitengine-purego ;only for Darwin
1304 go-github-com-emmansun-base64
1305 go-github-com-google-go-cmp
1306 go-github-com-google-uuid
1307 go-github-com-hako-durafmt
1308 go-github-com-klauspost-compress
1309 go-github-com-kovidgoyal-dbus
1310 go-github-com-kovidgoyal-go-parallel
1311 go-github-com-kovidgoyal-go-shm
1312 go-github-com-kovidgoyal-imaging
1313 go-github-com-nwaples-rardecode-v2
1314 go-github-com-seancfoley-ipaddress-go
1315 go-github-com-shirou-gopsutil-v4
1316 go-github-com-sgtdi-fswatcher
1317 go-github-com-ulikunitz-xz
1318 go-github-com-zeebo-xxh3
1319 go-golang-org-x-exp
1320 go-golang-org-x-image
1321 go-golang-org-x-sys
1322 go-golang-org-x-text
1323 go-howett-net-plist
1324 pkg-config
1325 python-pillow
1326 python-sphinx
1327 python-sphinx-copybutton
1328 python-sphinx-inline-tabs
1329 python-sphinxext-opengraph
1330 wayland-protocols
1331 zsh))
1332 (inputs
1333 (list cairo
1334 fontconfig
1335 harfbuzz
1336 lcms
1337 libcanberra
1338 libpng
1339 librsync
1340 libx11
1341 libxcursor
1342 libxext
1343 libxi
1344 libxinerama
1345 libxkbcommon
1346 libxrandr
1347 mesa
1348 ncurses
1349 openssl
1350 python-wrapper
1351 simde
1352 startup-notification
1353 wayland
1354 xxhash
1355 zlib))
1356 (home-page "https://sw.kovidgoyal.net/kitty/")
1357 (synopsis "Fast, feature-rich, GPU-based terminal emulator")
1358 (description "Kitty is a fast and featureful GPU-based terminal emulator:
1359@itemize
1360@item Offloads rendering to the GPU for lower system load and buttery smooth
1361scrolling. Uses threaded rendering to minimize input latency.
1362@item Supports all modern terminal features: graphics (images), unicode,
1363true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
1364paste and several new terminal protocol extensions.
1365@item Supports tiling multiple terminal windows side by side in different
1366layouts without needing to use an extra program like tmux.
1367@item Can be controlled from scripts or the shell prompt, even over SSH.
1368@item Has a framework for Kittens, small terminal programs that can be used to
1369extend kitty's functionality. For example, they are used for Unicode input,
1370hints, and side-by-side diff.
1371@item Supports startup sessions which allow you to specify the window/tab
1372layout, working directories and programs to run on startup.
1373@item Allows you to open the scrollback buffer in a separate window using
1374arbitrary programs of your choice. This is useful for browsing the history
1375comfortably in a pager or editor.
1376@end itemize")
1377 (properties '((cpe-vendor . "kovidgoyal"))) ;to distinguish from 9bis
1378 (license license:gpl3+)))
1379
1380(define-public eternalterminal
1381 (package
1382 (name "eternalterminal")
1383 (version "6.2.11")
1384 (source
1385 (origin
1386 (method git-fetch)
1387 (uri (git-reference
1388 (url "https://github.com/MisterTea/EternalTerminal")
1389 (commit (string-append "et-v" version))))
1390 (file-name (git-file-name name version))
1391 (sha256
1392 (base32 "1ik4kdw574l087yxck2clzwjmdacar8my3k2ih8dbn5m0djq4ybp"))))
1393 (build-system cmake-build-system)
1394 (arguments
1395 '(#:configure-flags '("-DBUILD_TEST=ON" "-DDISABLE_VCPKG=1")))
1396 (inputs (list libsodium protobuf openssl zlib curl))
1397 (home-page "https://mistertea.github.io/EternalTerminal/")
1398 (synopsis "Remote shell that reconnects without interrupting the session")
1399 (description "@dfn{Eternal Terminal} (ET) is a remote shell that
1400automatically reconnects without interrupting the session. ET uses SSH to
1401initialize a secure connection. Unlike SSH sessions, which must be killed and
1402reconnected after a network outage an ET session will survive network outages
1403and IP roaming. ET provides the same core functionality as @command{mosh},
1404while also supporting native scrolling and @command{tmux} control mode
1405(@code{tmux -CC}).")
1406 (license license:asl2.0)))
1407
1408(define-public tilix
1409 (package
1410 (name "tilix")
1411 (version "1.9.6")
1412 (source
1413 (origin
1414 (method git-fetch)
1415 (uri (git-reference
1416 (url "https://github.com/gnunn1/tilix")
1417 (commit version)))
1418 (file-name (git-file-name name version))
1419 (sha256
1420 (base32 "1vq0igfq1hj017ivfkd03zbb620qhvcjn9vd56c5dr4r1j7jiz98"))))
1421 (build-system meson-build-system)
1422 (arguments
1423 (list
1424 #:glib-or-gtk? #t
1425 #:phases
1426 #~(modify-phases %standard-phases
1427 (add-after 'unpack 'set-env-variables
1428 (lambda _
1429 (setenv "CC"
1430 #$(cc-for-target))))
1431 (add-after 'unpack 'skip-gtk-update-icon-cache
1432 (lambda _
1433 (substitute* "meson_post_install.py"
1434 (("gtk-update-icon-cache") (which "true"))
1435 (("update-desktop-database") (which "true")))))
1436 (add-after 'install 'remove-d-include-references
1437 #$(remove-d-include-references-phase
1438 (this-package-native-input "ldc"))))))
1439 (inputs (list dbus
1440 dconf
1441 gettext-minimal
1442 gsettings-desktop-schemas
1443 gtkd
1444 gtk+
1445 libsecret
1446 libunwind
1447 vte/gtk+-3))
1448 (native-inputs (list appstream
1449 desktop-file-utils
1450 `(,glib "bin")
1451 `(,gtk+ "bin")
1452 ldc
1453 pkg-config))
1454 (home-page "https://gnunn1.github.io/tilix-web/")
1455 (synopsis "Tiling terminal emulator")
1456 (description
1457 "Tilix is a tiling terminal emulator following the
1458Gnome Human Interface Guidelines. Its features include:
1459@enumerate
1460@item Layout terminals in any fashion by splitting them horizontally or
1461vertically.
1462@item Terminals can be re-arranged using drag and drop both within and between
1463windows.
1464@item Terminals can be detached into a new window via drag and drop.
1465@item Input can be synchronized between terminals so commands typed in one
1466terminal are replicated to the others.
1467@item Supports notifications when processes are completed out of view.
1468@end enumerate")
1469 (license license:mpl2.0)))
1470
1471(define-public tio
1472 (package
1473 (name "tio")
1474 (version "3.9")
1475 (source
1476 (origin
1477 (method git-fetch)
1478 (uri (git-reference
1479 (url "https://github.com/tio/tio")
1480 (commit (string-append "v" version))))
1481 (file-name (git-file-name name version))
1482 (sha256
1483 (base32 "12g2857gp3g2m5g0zjh0dw752lybcnn6gfs7awrsh603b7iqavzp"))))
1484 (build-system meson-build-system)
1485 (native-inputs (list pkg-config))
1486 (inputs (list glib lua))
1487 (arguments
1488 (list
1489 #:configure-flags
1490 #~(list "-Dbashcompletiondir=share/bash-completion/completions")))
1491 (home-page "https://tio.github.io/")
1492 (synopsis "Simple TTY terminal I/O application")
1493 (description "tio is a simple TTY terminal application which features a
1494straightforward commandline interface to easily connect to TTY devices for
1495basic input/output.")
1496 (license license:gpl2+)))
1497
1498(define-public alacritty
1499 (package
1500 (name "alacritty")
1501 (version "0.17.0")
1502 (source
1503 (origin
1504 ;; XXX: The crate at "crates.io" contains only the alacritty subproject
1505 ;; of alacritty and thus has limited contents. In particular,
1506 ;; it does not contain "extra" directory with completions, icon, etc.
1507 (method git-fetch)
1508 (uri (git-reference
1509 (url "https://github.com/alacritty/alacritty")
1510 (commit (string-append "v" version))))
1511 (file-name (git-file-name name version))
1512 (sha256
1513 (base32 "1aw5v127f0jr3jq5cclsbvbvf82g6s195dh1vjlcwjpbc0gl56w9"))))
1514 (build-system cargo-build-system)
1515 (arguments
1516 (list
1517 #:imported-modules (append %copy-build-system-modules
1518 %cargo-build-system-modules)
1519 #:modules '((guix build cargo-build-system)
1520 ((guix build copy-build-system) #:prefix copy:)
1521 (guix build utils))
1522 #:install-source? #f
1523 #:cargo-install-paths ''("alacritty")
1524 #:cargo-test-flags
1525 ''("--"
1526 ;; Changes in clap regularly break this test.
1527 "--skip=cli::tests::completions")
1528 #:phases
1529 #~(modify-phases %standard-phases
1530 (add-after 'unpack 'patch-xdg-open
1531 (lambda* (#:key inputs #:allow-other-keys)
1532 (substitute* "alacritty/src/config/ui_config.rs"
1533 (("xdg-open") (search-input-file inputs "/bin/xdg-open")))))
1534 (add-after 'configure 'add-absolute-library-references
1535 (lambda* (#:key inputs vendor-dir #:allow-other-keys)
1536 ;; Fix dlopen()ing some libraries on pure Wayland (no $DISPLAY):
1537 ;; Failed to initialize any backend! Wayland status: NoWaylandLib
1538 ;; XXX We patch transitive dependencies that aren't even direct
1539 ;; inputs to this package, because of the way Guix's Rust build
1540 ;; system currently works. <http://issues.guix.gnu.org/46399>
1541 ;; might fix this and allow patching them directly.
1542 (define shared-library-regex
1543 ;; Using regex decreases the time it takes to run the
1544 ;; substitution over 12000 files by about 40%.
1545 (string-join
1546 (list "libEGL\\.so" ; rust-glutin
1547 "libGL\\.so" ; rust-x11-dl, rust-glutin
1548 "libX[[:alpha:]]*\\.so" ; rust-x11-dl
1549 ; rust-wayland-sys, rust-wayland-backend
1550 "libwayland-[[:alpha:]]*\\.so"
1551 ;; rust-xkbcommon-dl
1552 "libxkbcommon\\.so"
1553 "libxkbcommon-x11\\.so")
1554 "|"))
1555 (substitute* (find-files vendor-dir "\\.rs$")
1556 ((shared-library-regex all)
1557 (search-input-file inputs (string-append "lib/" all))))))
1558 (add-after 'install 'install-more
1559 (lambda* (#:key native-inputs inputs #:allow-other-keys
1560 #:rest args)
1561 (let ((tic (search-input-file
1562 (or native-inputs inputs) "/bin/tic"))
1563 (terminfo (string-append #$output "/share/terminfo")))
1564 (define (create-manpage manpage)
1565 (with-input-from-file manpage
1566 (lambda _
1567 (with-output-to-file (string-drop-right manpage 4)
1568 (lambda _ (invoke "scdoc"))))))
1569 (with-directory-excursion "extra/man"
1570 (for-each create-manpage
1571 (find-files "." "^alacritty.*\\.[[:digit:]]\\.scd$")))
1572 (apply (assoc-ref copy:%standard-phases 'install)
1573 #:install-plan
1574 '(("extra/man" "share/man/man1" #:include-regexp ("\\.1$"))
1575 ("extra/man" "share/man/man5" #:include-regexp ("\\.5$"))
1576 ("extra/man" "share/man/man7" #:include-regexp ("\\.7$"))
1577 ("extra/linux/Alacritty.desktop" "share/applications/")
1578 ("extra/linux/org.alacritty.Alacritty.appdata.xml"
1579 "share/metainfo/")
1580 ("extra/logo/alacritty-term.svg"
1581 "share/icons/hicolor/scalable/apps/Alacritty.svg")
1582 ;; completions
1583 ("extra/completions/alacritty.bash"
1584 "share/bash-completion/completions/alacritty")
1585 ("extra/completions/_alacritty"
1586 "share/zsh/site-functions/")
1587 ("extra/completions/alacritty.fish"
1588 "share/fish/vendor_completions.d/"))
1589 args)
1590 ;; Install terminfo.
1591 (mkdir-p terminfo)
1592 ;; We don't compile alacritty-common entry because
1593 ;; it's being used only for inheritance.
1594 (invoke tic "-x" "-e" "alacritty,alacritty-direct"
1595 "-o" terminfo
1596 "extra/alacritty.info")))))))
1597 (native-inputs
1598 (list ncurses
1599 pkg-config
1600 python
1601 scdoc))
1602 (inputs
1603 (cons* expat
1604 fontconfig
1605 freetype
1606 libx11
1607 libxcb
1608 libxcursor
1609 libxext
1610 libxft
1611 libxi
1612 libxinerama
1613 libxkbcommon
1614 libxmu
1615 libxpresent
1616 libxrandr
1617 libxscrnsaver
1618 libxt
1619 libxtst
1620 libxxf86vm
1621 mesa
1622 xdg-utils
1623 wayland
1624 (cargo-inputs 'alacritty)))
1625 (native-search-paths
1626 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1627 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1628 (list (search-path-specification
1629 (variable "TERMINFO_DIRS")
1630 (files '("share/terminfo")))))
1631 (home-page "https://alacritty.org/")
1632 (synopsis "GPU-accelerated terminal emulator")
1633 (description
1634 "Alacritty is a GPU-accelerated terminal emulator with a strong focus on
1635simplicity and performance. With such a strong focus on performance, included
1636features are carefully considered and you can always expect Alacritty to be
1637blazingly fast. By making sane choices for defaults, Alacritty requires no
1638additional setup. However, it does allow configuration of many aspects of the
1639terminal. Note that you need support for OpenGL 3.2 or higher.")
1640 (license license:asl2.0)))
1641
1642(define-public bootterm
1643 (package
1644 (name "bootterm")
1645 (version "0.5")
1646 (source (origin
1647 (method git-fetch)
1648 (uri (git-reference
1649 (url "https://github.com/wtarreau/bootterm")
1650 (commit (string-append "v" version))))
1651 (file-name (git-file-name name version))
1652 (sha256
1653 (base32
1654 "1xag6agcqkq2p7gp20qxjb95ah7p6lia65jmm5v51rqxfzclx2h1"))))
1655 (build-system gnu-build-system)
1656 (arguments
1657 (list #:tests? #f ; no test suite
1658 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
1659 (string-append "PREFIX=" #$output))
1660 #:phases
1661 #~(modify-phases %standard-phases
1662 ;; No ./configure script
1663 (delete 'configure)
1664 (add-after 'install 'install-doc
1665 (lambda* (#:key outputs #:allow-other-keys)
1666 (let ((doc (format #f "~a/share/doc/~a-~a"
1667 #$output #$name #$version)))
1668 (install-file "README.md" doc)))))))
1669 (home-page "https://github.com/wtarreau/bootterm")
1670 (synopsis "Serial terminal")
1671 (description "Bootterm is a terminal designed to ease connection to
1672ephemeral serial ports. It features automatic port detection, port enumeration,
1673support for non-standard baud rates, the ability to wait for ports to appear,
1674and the ability to read and write via stdin and stdout.")
1675 (license license:expat)))
1676
1677(define-public roxterm
1678 (package
1679 (name "roxterm")
1680 (version "3.17.2")
1681 (source (origin
1682 (method git-fetch)
1683 (uri (git-reference
1684 (url "https://github.com/realh/roxterm")
1685 (commit version)))
1686 (file-name (git-file-name name version))
1687 (sha256
1688 (base32
1689 "1lr8fd40qwjghmlkfqa8b9c64mlxxfws7diia0rdk88v0cvb3ia0"))))
1690 (build-system cmake-build-system)
1691 (arguments
1692 `(#:tests? #f)) ; No tests
1693 (native-inputs
1694 (list docbook-xsl
1695 docbook-xml
1696 (list glib "bin")
1697 gettext-minimal
1698 libxml2
1699 libxslt
1700 pkg-config))
1701 (inputs
1702 (list dbus dbus-glib gtk+ pcre vte/gtk+-3))
1703 (synopsis "Terminal emulator")
1704 (description "This package provides a terminal emulator with hyperlink
1705support. It's based on VTE and aimed at power users.")
1706 (home-page "https://realh.github.io/roxterm/en/index.html")
1707 ;; src/gresources.c is under LGPL 2.1+
1708 (license (list license:gpl2+ license:lgpl2.1+))))
1709
1710(define-public fbterm
1711 (package
1712 (name "fbterm")
1713 (version "1.7")
1714 (source
1715 (origin
1716 (method git-fetch)
1717 (uri (git-reference (url "https://salsa.debian.org/debian/fbterm.git")
1718 (commit (string-append "upstream/" version))))
1719 (file-name (git-file-name name version))
1720 (sha256
1721 (base32
1722 "1nl9z169a59akgb8b5j2pw5fp3bbkmv553rryffkfz45d1cxskvq"))))
1723 (build-system gnu-build-system)
1724 (arguments
1725 (list #:make-flags #~(list (string-append "prefix=" #$output)
1726 "HOME=/tmp"
1727
1728 ;; Silence "narrow conversion" errors.
1729 "CXXFLAGS=-Wno-narrowing -O2 -g")))
1730 (inputs (list freetype fontconfig ncurses gpm))
1731 (native-inputs (list pkg-config))
1732 (home-page "https://salsa.debian.org/debian/fbterm")
1733 (synopsis "Fast and lightweight framebuffer-based terminal emulator for Linux")
1734 (description "FbTerm is a fast terminal emulator for Linux with frame
1735buffer device or VESA video card. Features include:
1736
1737@itemize
1738@item mostly as fast as terminal of Linux kernel while accelerated scrolling
1739is enabled;
1740@item select font with fontconfig and draw text with freetype2, same as
1741Qt/Gtk+ based GUI apps;
1742@item dynamically create/destroy up to 10 windows initially running default
1743shell;
1744@item record scrollback history for every window;
1745@item auto-detect current locale and convert text encoding, support double
1746width scripts like Chinese, Japanese etc;
1747@item switch between configurable additional text encodings with hot keys on
1748the fly;
1749@item copy/paste selected text between windows with mouse when gpm server is
1750running;
1751@item change the orientation of screen display, a.k.a. screen rotation;
1752@item lightweight input method framework with client-server architecture;
1753@item background image for eye candy.
1754@end itemize")
1755 (license license:gpl2+)))
1756
1757;; See https://github.com/wezterm/wezterm/blob/main/README-DISTRO-MAINTAINER.md
1758(define-public wezterm
1759 (let ((commit "05343b387085842b434d267f91b6b0ec157e4331")
1760 ;; git -c "core.abbrev=8" show -s "--format=%cd" "--date=format:%Y%m%d.%H%M%S"
1761 (date "20260117.154428"))
1762 (package
1763 (name "wezterm")
1764 (version (string-append date "." (substring commit 0 8)))
1765 (source
1766 (origin
1767 (method git-fetch)
1768 (file-name (git-file-name name version))
1769 (uri (git-reference
1770 (url "https://github.com/wezterm/wezterm")
1771 (commit commit)))
1772 (sha256
1773 (base32 "1pkng8dvjc917j4i8sly8cz91nx1yh2k83i78rcs43gdxs79gjds"))
1774 (modules
1775 '((ice-9 match)
1776 (guix build utils)))
1777 (snippet
1778 '(begin
1779 ;; Remove bundled dependencies.
1780 (for-each
1781 delete-file-recursively
1782 '("assets/fonts"
1783 "assets/macos"
1784 "assets/windows"
1785 "deps/cairo/cairo"
1786 "deps/cairo/pixman"))
1787 ;; Link static libraries for dependencies under ./deps.
1788 (for-each
1789 (match-lambda
1790 ((name dependencies)
1791 (with-directory-excursion (in-vicinity "deps" name)
1792 (make-file-writable "build.rs")
1793 (with-output-to-file "build.rs"
1794 (lambda ()
1795 (format #t "\
1796// Modified by Guix.
1797fn main() {
1798~{\
1799 println!(\"cargo:rustc-link-lib=~a\");
1800~}\
1801}~%"
1802 dependencies))))))
1803 '(("cairo" ("cairo" "pixman-1"))
1804 ("fontconfig" ("fontconfig"))
1805 ("freetype" ("freetype" "png" "z"))
1806 ("harfbuzz" ("harfbuzz"))))
1807 ;; Don't try to vendor lua.
1808 (substitute* "config/Cargo.toml"
1809 (("\"vendored\", ") ""))))))
1810 (build-system cargo-build-system)
1811 (arguments
1812 (list
1813 #:install-source? #f
1814 #:features
1815 ''("distro-defaults")
1816 #:cargo-test-flags
1817 ''("--"
1818 ;; Test data differs, probably due to unbundling of fonts.
1819 ;; https://codeberg.org/guix/guix/pulls/6020#issuecomment-10364990
1820 "--skip=shapecache::test::ligatures_jetbrains")
1821 #:modules
1822 '((srfi srfi-26)
1823 (ice-9 match)
1824 (guix build cargo-build-system)
1825 (guix build utils))
1826 #:phases
1827 #~(modify-phases %standard-phases
1828 (add-after 'unpack 'use-guix-vendored-dependencies
1829 (lambda _
1830 ;; Override dependencies declared with git repos / revisions.
1831 (substitute* "Cargo.toml"
1832 ;; finl-unicode
1833 ((", git.*default-features")
1834 ", default-features")
1835 ;; xcb-imdkit-rs.
1836 ((", git.*, rev.*}")
1837 ;; use-system-lib ensures the package won't try pulling in
1838 ;; additional dependencies and instead relies on the inputs
1839 ;; we passed in.
1840 ", features=[\"use-system-lib\"]}"))))
1841 (add-after 'unpack 'prepare-build-environment
1842 (lambda _
1843 (with-output-to-file ".tag"
1844 (lambda ()
1845 (display #$(package-version this-package))))
1846 ;; These libraries will be used at runtime. Add into RUNPATH.
1847 (setenv "RUSTFLAGS"
1848 (string-join
1849 '("-C" "link-arg=-lEGL"
1850 "-C" "link-arg=-lvulkan")
1851 " "))))
1852 (add-after 'unpack 'fix-font-load-path
1853 (lambda* (#:key inputs #:allow-other-keys)
1854 (substitute* "wezterm-font/src/parser.rs"
1855 (("../../assets/fonts/(.*\\.ttf)" _ font)
1856 (search-input-file
1857 inputs (in-vicinity "share/fonts/truetype" font))))))
1858 (replace 'install
1859 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1860 ;; Binaries
1861 (with-directory-excursion "target/release"
1862 (for-each (cut install-file <> (in-vicinity #$output "bin"))
1863 '("wezterm" "wezterm-gui"
1864 "wezterm-mux-server"
1865 "strip-ansi-escapes")))
1866
1867 ;; Terminfo
1868 (with-directory-excursion "termwiz/data"
1869 (let ((terminfo (in-vicinity #$output "share/terminfo"))
1870 (tic (search-input-file
1871 (or native-inputs inputs) "bin/tic")))
1872 (mkdir-p terminfo)
1873 (for-each (cut invoke tic "-x" "-o" terminfo <>)
1874 '("wezterm.terminfo"
1875 ;; Wezterm by default identifies itself as
1876 ;; xterm-256color, which this terminfo provides
1877 ;; despite the "-italic" part.
1878 "xterm-256color-italic.terminfo"))))
1879
1880 ;; Completions
1881 (with-directory-excursion "assets/shell-completion"
1882 (for-each
1883 (match-lambda
1884 ((shell . target)
1885 (let ((path (in-vicinity #$output target)))
1886 (mkdir-p (dirname path))
1887 (copy-file shell path))))
1888 '(("bash" . "share/bash-completion/completions/wezterm")
1889 ("fish" . "share/fish/vendor_completions.d/wezterm.fish")
1890 ("zsh" . "share/zsh/site-functions/_wezterm"))))
1891
1892 ;; Integrations
1893 (with-directory-excursion "assets/shell-integration"
1894 (let ((profile-d (in-vicinity #$output "etc/profile.d")))
1895 (mkdir-p profile-d)
1896 (install-file "wezterm.sh" profile-d)))
1897
1898 ;; Icon
1899 (with-directory-excursion "assets/icon"
1900 (let ((icons (in-vicinity
1901 #$output "share/icons/hicolor/scalable/apps")))
1902 (mkdir-p icons)
1903 (copy-file
1904 "wezterm-icon.svg"
1905 (in-vicinity icons "org.wezfurlong.wezterm.svg"))))
1906
1907 ;; Desktop file
1908 (install-file "assets/wezterm.desktop"
1909 (in-vicinity #$output "share/applications"))
1910 (install-file "assets/wezterm.appdata.xml"
1911 (in-vicinity #$output "share/metainfo"))
1912
1913 ;; Nautilus extension
1914 (install-file
1915 "assets/wezterm-nautilus.py"
1916 (in-vicinity #$output "share/nautilus-python/extensions"))
1917
1918 ;; Helper script
1919 (install-file "assets/open-wezterm-here"
1920 (in-vicinity #$output "bin")))))))
1921 (native-inputs (list ncurses pkg-config))
1922 (inputs
1923 (cons* font-google-noto-emoji
1924 font-google-roboto
1925 font-jetbrains-mono
1926 font-nerd-symbols
1927 libgit2
1928 libssh
1929 libssh2
1930 libx11
1931 libxcb
1932 libxkbcommon
1933 lua-5.4
1934 mesa
1935 openssl
1936 sqlite
1937 vulkan-loader
1938 wayland
1939 xcb-imdkit
1940 xcb-util
1941 xcb-util-image
1942 `(,zstd "lib")
1943 ;; Replacements for deps/ libraries.
1944 cairo
1945 fontconfig
1946 freetype
1947 harfbuzz
1948 libpng
1949 pixman
1950 zlib
1951 (cargo-inputs 'wezterm)))
1952 (native-search-paths
1953 ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
1954 ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
1955 (list (search-path-specification
1956 (variable "TERMINFO_DIRS")
1957 (files '("share/terminfo")))))
1958 (home-page "https://wezterm.org/")
1959 (synopsis "Cross-platform terminal emulator and multiplexer")
1960 (description
1961 "WezTerm is a GPU-accelerated terminal emulator and multiplexer that
1962features:
1963
1964@itemize
1965@item Multiplex terminal panes, tabs and windows on local and remote hosts, with
1966native mouse and scrollback.
1967@item Ligatures, color emoji and font fallback, with true color and dynamic
1968color schemes.
1969@item Hyperlinks.
1970@end itemize")
1971 (license license:expat))))