You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1007 lines
42 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
  3. ;;; Copyright © 2016 Mckinley Olsen <mck.olsen@gmail.com>
  4. ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
  5. ;;; Copyright © 2016 David Craven <david@craven.ch>
  6. ;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
  7. ;;; Copyright © 2016, 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
  8. ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  9. ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
  10. ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
  11. ;;; Copyright © 2017 Petter <petter@mykolab.ch>
  12. ;;; Copyright © 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
  13. ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
  14. ;;; Copyright © 2018 Gabriel Hondet <gabrielhondet@gmail.com>
  15. ;;;
  16. ;;; This file is part of GNU Guix.
  17. ;;;
  18. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  19. ;;; under the terms of the GNU General Public License as published by
  20. ;;; the Free Software Foundation; either version 3 of the License, or (at
  21. ;;; your option) any later version.
  22. ;;;
  23. ;;; GNU Guix is distributed in the hope that it will be useful, but
  24. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  25. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. ;;; GNU General Public License for more details.
  27. ;;;
  28. ;;; You should have received a copy of the GNU General Public License
  29. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  30. (define-module (gnu packages terminals)
  31. #:use-module ((guix licenses) #:prefix license:)
  32. #:use-module (guix build-system cmake)
  33. #:use-module (guix build-system gnu)
  34. #:use-module (guix build-system glib-or-gtk)
  35. #:use-module (guix build-system go)
  36. #:use-module (guix build-system python)
  37. #:use-module (guix download)
  38. #:use-module (guix git-download)
  39. #:use-module (guix packages)
  40. #:use-module (gnu packages)
  41. #:use-module (gnu packages autotools)
  42. #:use-module (gnu packages check)
  43. #:use-module (gnu packages compression)
  44. #:use-module (gnu packages docbook)
  45. #:use-module (gnu packages fontutils)
  46. #:use-module (gnu packages freedesktop)
  47. #:use-module (gnu packages gettext)
  48. #:use-module (gnu packages gl)
  49. #:use-module (gnu packages glib)
  50. #:use-module (gnu packages gnome)
  51. #:use-module (gnu packages gtk)
  52. #:use-module (gnu packages image)
  53. #:use-module (gnu packages libevent)
  54. #:use-module (gnu packages linux)
  55. #:use-module (gnu packages ncurses)
  56. #:use-module (gnu packages perl)
  57. #:use-module (gnu packages perl-check)
  58. #:use-module (gnu packages pkg-config)
  59. #:use-module (gnu packages python)
  60. #:use-module (gnu packages python-web)
  61. #:use-module (gnu packages python-xyz)
  62. #:use-module (gnu packages qt)
  63. #:use-module (gnu packages serialization)
  64. #:use-module (gnu packages ssh)
  65. #:use-module (gnu packages textutils)
  66. #:use-module (gnu packages wm)
  67. #:use-module (gnu packages xdisorg)
  68. #:use-module (gnu packages xml)
  69. #:use-module (gnu packages xorg)
  70. #:use-module (srfi srfi-26))
  71. (define-public tilda
  72. (package
  73. (name "tilda")
  74. (version "1.4.1")
  75. (source (origin
  76. (method git-fetch)
  77. (uri (git-reference
  78. (url "https://github.com/lanoxx/tilda.git")
  79. (commit (string-append "tilda-" version))))
  80. (file-name (git-file-name name version))
  81. (sha256
  82. (base32
  83. "154rsldqjv2m1bddisb930qicb0y35kx7bxq392n2hn68jr2pxkj"))))
  84. (build-system glib-or-gtk-build-system)
  85. (arguments
  86. '(#:phases (modify-phases %standard-phases
  87. (replace 'bootstrap
  88. (lambda _
  89. (setenv "NOCONFIGURE" "true")
  90. (invoke "sh" "autogen.sh"))))))
  91. (native-inputs
  92. `(("autoconf" ,autoconf)
  93. ("automake" ,automake)
  94. ("gettext" ,gettext-minimal)
  95. ("pkg-config" ,pkg-config)))
  96. (inputs
  97. `(("libconfuse" ,libconfuse)
  98. ("vte" ,vte)))
  99. (synopsis "GTK+-based drop-down terminal")
  100. (description "Tilda is a terminal emulator similar to normal terminals like
  101. gnome-terminal (GNOME) or Konsole (KDE), with the difference that it drops down
  102. from the edge of a screen when a certain configurable hotkey is pressed. This
  103. is similar to the built-in consoles in some applications. Tilda is highly
  104. configurable through a graphical wizard.")
  105. (home-page "https://github.com/lanoxx/tilda")
  106. (license license:gpl2+)))
  107. (define-public termite
  108. (package
  109. (name "termite")
  110. (version "14")
  111. (source
  112. (origin
  113. (method git-fetch)
  114. (uri (git-reference
  115. (url (string-append "https://github.com/thestinger/"
  116. name ".git"))
  117. (commit (string-append "v" version))
  118. (recursive? #t)))
  119. (file-name (string-append name "-" version "-checkout"))
  120. (sha256
  121. (base32
  122. "0dmz9rpc2fdvcwhcmjnhb48ixn403gxpq03g334d1hgjw2hsyx7x"))))
  123. (build-system gnu-build-system)
  124. (arguments
  125. `(#:phases
  126. (modify-phases %standard-phases
  127. (delete 'configure))
  128. #:tests? #f
  129. ;; This sets the destination when installing the necessary terminal
  130. ;; capability data, which are not provided by 'ncurses'. See
  131. ;; <https://lists.gnu.org/archive/html/bug-ncurses/2009-10/msg00031.html>.
  132. #:make-flags (list "PREFIX="
  133. (string-append "VERSION=v" (version))
  134. (string-append "DESTDIR="
  135. (assoc-ref %outputs "out")))))
  136. (inputs
  137. `(("vte" ,vte-ng)
  138. ("gtk+" ,gtk+)
  139. ("ncurses" ,ncurses)))
  140. (native-inputs
  141. `(("pkg-config" ,pkg-config)))
  142. ;; FIXME: This should only be located in 'ncurses'. Nonetheless it is
  143. ;; provided for usability reasons. See <https://bugs.gnu.org/22138>.
  144. (native-search-paths
  145. (list (search-path-specification
  146. (variable "TERMINFO_DIRS")
  147. (files '("share/terminfo")))))
  148. (home-page "https://github.com/thestinger/termite/")
  149. (synopsis "Keyboard-centric, VTE-based terminal")
  150. (description "Termite is a minimal terminal emulator designed for use with
  151. tiling window managers. It is a modal application, similar to Vim, with an
  152. insert mode and command mode where keybindings have different functions.")
  153. ;; Files under util/ are under the Expat license; the rest is LGPLv2+.
  154. (license license:lgpl2.0+)))
  155. (define-public asciinema
  156. (package
  157. (name "asciinema")
  158. (version "1.4.0")
  159. (source
  160. (origin
  161. (method url-fetch)
  162. (uri (pypi-uri "asciinema" version))
  163. (sha256
  164. (base32
  165. "1jrf8c8711gkdilmvyv3d37kp8xfvdc5cqighw5k92a6g9z4acgv"))))
  166. (build-system python-build-system)
  167. (arguments
  168. `(#:phases
  169. (modify-phases %standard-phases
  170. (add-before 'build 'patch-exec-paths
  171. (lambda* (#:key inputs #:allow-other-keys)
  172. (let ((ncurses (assoc-ref inputs "ncurses")))
  173. (substitute* "asciinema/recorder.py"
  174. (("'tput'")
  175. (string-append "'" ncurses "/bin/tput'"))))
  176. #t)))))
  177. (inputs `(("ncurses" ,ncurses)))
  178. (native-inputs
  179. ;; For tests.
  180. `(("python-requests" ,python-requests)))
  181. (home-page "https://asciinema.org")
  182. (synopsis "Terminal session recorder")
  183. (description
  184. "Use asciinema to record and share your terminal sessions, the right way.
  185. Forget screen recording apps and blurry video. Enjoy a lightweight, purely
  186. text-based approach to terminal recording.")
  187. (license license:gpl3)))
  188. (define-public libtsm
  189. (let ((commit "f70e37982f382b03c6939dac3d5f814450bda253")
  190. (revision "1"))
  191. (package
  192. (name "libtsm")
  193. (version (git-version "0.0.0" revision commit))
  194. (source (origin
  195. (method git-fetch)
  196. ;; The freedesktop repository is no longer maintained.
  197. (uri (git-reference
  198. (url (string-append "https://github.com/Aetf/" name))
  199. (commit commit)))
  200. (sha256
  201. (base32
  202. "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx"))))
  203. (build-system cmake-build-system)
  204. (arguments
  205. `(#:configure-flags '("-DBUILD_TESTING=ON")))
  206. (native-inputs
  207. `(("pkg-config" ,pkg-config)))
  208. (inputs
  209. `(("libxkbcommon" ,libxkbcommon)
  210. ("check" ,check)))
  211. (synopsis "Xterm state machine library")
  212. (description "TSM is a state machine for DEC VT100-VT520 compatible
  213. terminal emulators. It tries to support all common standards while keeping
  214. compatibility to existing emulators like xterm, gnome-terminal, konsole, etc.")
  215. (home-page "https://www.freedesktop.org/wiki/Software/libtsm")
  216. ;; Hash table implementation is lgpl2.1+ licensed.
  217. ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
  218. ;; derived from ISC.
  219. ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
  220. ;; under the bsd 2 license.
  221. (license (list license:expat license:lgpl2.1+ license:isc license:bsd-2)))))
  222. (define-public kmscon
  223. (let ((commit "01dd0a231e2125a40ceba5f59fd945ff29bf2cdc")
  224. (revision "1"))
  225. (package
  226. (name "kmscon")
  227. (version (git-version "0.0.0" revision commit))
  228. (source (origin
  229. (method git-fetch)
  230. ;; The freedesktop repository is no longer maintained.
  231. (uri (git-reference
  232. (url (string-append "https://github.com/Aetf/" name))
  233. (commit commit)))
  234. (sha256
  235. (base32
  236. "0q62kjsvy2iwy8adfiygx2bfwlh83rphgxbis95ycspqidg9py87"))
  237. (patches
  238. (search-patches "kmscon-runtime-keymap-switch.patch"))
  239. (modules '((guix build utils)))))
  240. (build-system gnu-build-system)
  241. (arguments
  242. `(#:phases (modify-phases %standard-phases
  243. (replace 'bootstrap
  244. (lambda _
  245. (setenv "NOCONFIGURE" "indeed")
  246. (invoke "sh" "autogen.sh")))
  247. ;; Use elogind instead of systemd.
  248. (add-before 'configure 'remove-systemd
  249. (lambda _
  250. (substitute* "configure"
  251. (("libsystemd-daemon libsystemd-login")
  252. "libelogind"))
  253. (substitute* "src/uterm_systemd.c"
  254. (("#include <systemd/sd-login.h>")
  255. "#include <elogind/sd-login.h>")
  256. ;; We don't have this header.
  257. (("#include <systemd/sd-daemon\\.h>")
  258. "")
  259. ;; Replace the call to 'sd_booted' by the truth value.
  260. (("sd_booted\\(\\)")
  261. "1")))))))
  262. (native-inputs
  263. `(("pkg-config" ,pkg-config)
  264. ("autoconf" ,autoconf)
  265. ("automake" ,automake)
  266. ("libtool" ,libtool)
  267. ("libxslt" ,libxslt) ;to build the man page
  268. ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
  269. ("docbook-xsl" ,docbook-xsl)))
  270. (inputs
  271. `(("libdrm" ,libdrm)
  272. ("libtsm" ,libtsm)
  273. ("libxkbcommon" ,libxkbcommon)
  274. ("logind" ,elogind)
  275. ("mesa" ,mesa)
  276. ("pango" ,pango)
  277. ("udev" ,eudev)))
  278. (synopsis "Linux KMS-based terminal emulator")
  279. (description "Kmscon is a terminal emulator based on Linux's @dfn{kernel
  280. mode setting} (KMS). It can replace the in-kernel virtual terminal (VT)
  281. implementation with a user-space console. Compared to the Linux console,
  282. kmscon provides enhanced features including XKB-compatible internationalized
  283. keyboard support, UTF-8 input/font support, hardware-accelerated rendering,
  284. multi-seat support, a replacement for @command{mingetty}, and more.")
  285. (home-page "https://www.freedesktop.org/wiki/Software/kmscon")
  286. ;; Hash table implementation is lgpl2.1+ licensed.
  287. ;; The wcwidth implementation in external/wcwidth.{h,c} uses a license
  288. ;; derived from ISC.
  289. ;; UCS-4 to UTF-8 encoding is copied from "terminology" which is released
  290. ;; under the bsd 2 license.
  291. ;; Unifont-Font is from http://unifoundry.com/unifont.html and licensed
  292. ;; under the terms of the GNU GPL.
  293. (license (list license:expat license:lgpl2.1+ license:bsd-2
  294. license:gpl2+))
  295. (supported-systems (filter (cut string-suffix? "-linux" <>)
  296. %supported-systems)))))
  297. (define-public libtermkey
  298. (package
  299. (name "libtermkey")
  300. (version "0.20")
  301. (source (origin
  302. (method url-fetch)
  303. (uri (string-append "http://www.leonerd.org.uk/code/"
  304. name "/" name "-" version ".tar.gz"))
  305. (sha256
  306. (base32 "1xfj6lchhfljmbcl6dz8dpakppyy13nbl4ykxiv5x4dr9b4qf3bc"))))
  307. (build-system gnu-build-system)
  308. (arguments
  309. '(#:make-flags (list
  310. "CC=gcc"
  311. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  312. #:phases (modify-phases %standard-phases
  313. (delete 'configure))
  314. #:test-target "test"))
  315. (inputs `(("ncurses" ,ncurses)))
  316. (native-inputs `(("libtool" ,libtool)
  317. ("perl-test-harness" ,perl-test-harness)
  318. ("pkg-config" ,pkg-config)))
  319. (synopsis "Keyboard entry processing library for terminal-based programs")
  320. (description
  321. "Libtermkey handles all the necessary logic to recognise special keys, UTF-8
  322. combining, and so on, with a simple interface.")
  323. (home-page "http://www.leonerd.org.uk/code/libtermkey")
  324. (license license:expat)))
  325. (define-public picocom
  326. (package
  327. (name "picocom")
  328. (version "2.2")
  329. (source (origin
  330. (method git-fetch)
  331. (uri (git-reference
  332. (url "https://github.com/npat-efault/picocom.git")
  333. (commit version)))
  334. (file-name (git-file-name name version))
  335. (sha256
  336. (base32
  337. "06b2ic34dnxc73cprc5imi3iamlhsv623sbg9vj5h5rvs586dwjx"))))
  338. (build-system gnu-build-system)
  339. (arguments
  340. `(#:make-flags '("CC=gcc")
  341. #:tests? #f ; No tests
  342. #:phases
  343. (modify-phases %standard-phases
  344. (delete 'configure)
  345. (replace 'install
  346. (lambda* (#:key outputs #:allow-other-keys)
  347. (let* ((out (assoc-ref outputs "out"))
  348. (bin (string-append out "/bin"))
  349. (man (string-append out "/share/man/man1")))
  350. (install-file "picocom" bin)
  351. (install-file "picocom.1" man)))))))
  352. (home-page "https://github.com/npat-efault/picocom")
  353. (synopsis "Minimal dumb-terminal emulation program")
  354. (description "It was designed to serve as a simple, manual, modem
  355. configuration, testing, and debugging tool. It has also serves well
  356. as a low-tech serial communications program to allow access to all
  357. types of devices that provide serial consoles.")
  358. (license license:gpl2+)))
  359. (define-public beep
  360. (package
  361. (name "beep")
  362. (version "1.3")
  363. (source (origin
  364. (method url-fetch)
  365. (uri (string-append "http://www.johnath.com/" name "/"
  366. name "-" version ".tar.gz"))
  367. (sha256
  368. (base32
  369. "0bgch6jq5cahakk3kbr9549iysf2dik09afixxy5brbxk1xfzb2r"))))
  370. (build-system gnu-build-system)
  371. (arguments
  372. `(#:tests? #f ; no tests.
  373. #:phases
  374. (modify-phases %standard-phases
  375. (delete 'configure)
  376. (add-after 'unpack 'patch-makefile
  377. (lambda* (#:key outputs #:allow-other-keys)
  378. (substitute* "Makefile" (("/usr") (assoc-ref outputs "out")))
  379. #t))
  380. (add-before 'install 'create-output-directories
  381. (lambda* (#:key outputs #:allow-other-keys)
  382. (let ((out (assoc-ref %outputs "out")))
  383. (mkdir-p (string-append out "/bin"))
  384. (mkdir-p (string-append out "/man/man1"))))))))
  385. (synopsis "Linux command-line utility to control the PC speaker")
  386. (description "beep allows the user to control the PC speaker with precision,
  387. allowing different sounds to indicate different events. While it can be run
  388. quite happily on the command line, its intended place of residence is within
  389. scripts, notifying the user when something interesting occurs. Of course, it
  390. has no notion of what's interesing, but it's very good at that notifying part.")
  391. (home-page "http://www.johnath.com/beep")
  392. (license license:gpl2+)))
  393. (define-public unibilium
  394. (package
  395. (name "unibilium")
  396. (version "1.2.1")
  397. (source
  398. (origin
  399. (method git-fetch)
  400. (uri (git-reference
  401. (url "https://github.com/mauke/unibilium.git")
  402. (commit (string-append "v" version))))
  403. (file-name (git-file-name name version))
  404. (sha256
  405. (base32
  406. "11mbfijdrvbmdlmxs8j4vij78ki0vna89yg3r9n9g1i6j45hiq2r"))))
  407. (build-system gnu-build-system)
  408. (arguments
  409. `(#:make-flags
  410. (list "CC=gcc"
  411. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  412. #:test-target "test"
  413. ;; FIXME: tests require "prove"
  414. #:tests? #f
  415. #:phases
  416. (modify-phases %standard-phases
  417. (delete 'configure))))
  418. (native-inputs
  419. `(("libtool" ,libtool)))
  420. (home-page "https://github.com/mauke/unibilium")
  421. (synopsis "Terminfo parsing library")
  422. (description "Unibilium is a basic C terminfo library. It doesn't depend
  423. on curses or any other library. It also doesn't use global variables, so it
  424. should be thread-safe.")
  425. (license license:lgpl3+)))
  426. (define-public libvterm
  427. (package
  428. (name "libvterm")
  429. (version "0+bzr681")
  430. (source
  431. (origin
  432. (method url-fetch)
  433. (uri (string-append "http://www.leonerd.org.uk/code/libvterm/"
  434. "libvterm-" version ".tar.gz"))
  435. (sha256
  436. (base32
  437. "1s56c8p1qz6frkcri0hg4qyydv2wcccj6n2xmz1dwcdqn38ldsmb"))))
  438. (build-system gnu-build-system)
  439. (arguments
  440. `(#:make-flags
  441. (list "CC=gcc"
  442. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  443. #:test-target "test"
  444. #:phases
  445. (modify-phases %standard-phases
  446. (delete 'configure))))
  447. (native-inputs
  448. `(("libtool" ,libtool)
  449. ("perl" ,perl)))
  450. (home-page "http://www.leonerd.org.uk/code/libvterm/")
  451. (synopsis "VT220/xterm/ECMA-48 terminal emulator library")
  452. (description "Libvterm is an abstract C99 library which implements a VT220
  453. or xterm-like terminal emulator. It doesn't use any particular graphics
  454. toolkit or output system, instead it invokes callback function pointers that
  455. its embedding program should provide it to draw on its behalf. It avoids
  456. calling @code{malloc} during normal running state, allowing it to be used in
  457. embedded kernel situations.")
  458. (license license:expat)))
  459. (define-public cool-retro-term
  460. (let ((commit "dd799cf5c0eda92cf44f3938c0c2dcae5651a99e")
  461. (revision "1"))
  462. (package
  463. (name "cool-retro-term")
  464. (version (string-append "1.0.1-" revision "." (string-take commit 7)))
  465. (source (origin
  466. (method git-fetch)
  467. (file-name (string-append name "-" version "-checkout"))
  468. (uri (git-reference
  469. (url (string-append "https://github.com/Swordfish90/" name))
  470. (commit commit)
  471. (recursive? #t)))
  472. (sha256
  473. (base32 "08mrvj8zk9ck15q90ipjzza1acnnsjhprv2rxg8yyck0xl9p40jd"))
  474. (patches
  475. (search-patches "cool-retro-term-fix-array-size.patch"
  476. "cool-retro-term-dont-check-uninit-member.patch"
  477. "cool-retro-term-memory-leak-1.patch"))
  478. (modules '((guix build utils)
  479. (srfi srfi-1)
  480. (srfi srfi-26)
  481. (ice-9 rdelim)
  482. (ice-9 regex)))
  483. (snippet
  484. '(let* ((fonts '(;"1971-ibm-3278" ; BSD 3-clause
  485. ;"1975-knight-tv" ; GPL
  486. "1977-apple2" ; Non-Free
  487. "1977-commodore-pet" ; Non-Free
  488. "1979-atari-400-800" ; Non-Free
  489. "1982-commodore64" ; Non-Free
  490. "1985-atari-st" ; ?
  491. "1985-ibm-pc-vga" ; Unclear
  492. ;"modern-fixedsys-excelsior" ; Redistributable
  493. ;"modern-hermit" ; SIL
  494. ;"modern-inconsolata"; SIL
  495. ;"modern-pro-font-win-tweaked" ; X11
  496. ;"modern-proggy-tiny"; X11
  497. ;"modern-terminus" ; SIL
  498. "modern-monaco")) ; Apple Non-Free
  499. (name-rx (make-regexp " *name: *\"([^\"]*)\""))
  500. (source-rx (make-regexp " *source: \"fonts/([^/]*)[^\"]*\""))
  501. (fontname-rx (make-regexp "\"fontName\":\"([^\"]*).*"))
  502. (names
  503. ;; Gather font names from all Fonts*.qml files.
  504. ;; These will be used to remove items from the
  505. ;; default profiles.
  506. (fold
  507. (lambda (font-file names)
  508. (call-with-input-file font-file
  509. (lambda (port)
  510. (let loop ((name #f) (names names))
  511. (let ((line (read-line port)))
  512. (cond
  513. ((eof-object? line) (pk 'names names))
  514. ((regexp-exec name-rx line)
  515. => (lambda (m)
  516. (loop (match:substring m 1) names)))
  517. ((regexp-exec source-rx line)
  518. => (lambda (m)
  519. (let ((font (match:substring m 1)))
  520. (if (member font fonts)
  521. (loop #f (lset-adjoin string=?
  522. names name))
  523. (loop #f names)))))
  524. (else (loop name names))))))))
  525. '() (find-files "app/qml" "Font.*\\.qml"))))
  526. ;; Remove the font files themselves
  527. (for-each (lambda (font)
  528. (delete-file-recursively
  529. (string-append "app/qml/fonts/" font)))
  530. fonts)
  531. ;; Remove mention of those fonts in the source
  532. (substitute* "app/qml/resources.qrc"
  533. (((string-append " *<file>fonts/("
  534. (string-join fonts "|")
  535. ").*"))
  536. ""))
  537. (for-each
  538. (lambda (file)
  539. (let ((start-rx (make-regexp " *ListElement\\{"))
  540. (end-rx (make-regexp " *\\}")))
  541. (with-atomic-file-replacement file
  542. (lambda (in out)
  543. (let loop ((line-buffer '())
  544. (hold? #f)
  545. (discard? #f))
  546. (let ((line (read-line in 'concat)))
  547. (cond
  548. ((eof-object? line) #t) ;done
  549. ((regexp-exec start-rx line)
  550. (loop (cons line line-buffer) #t #f))
  551. ((or (regexp-exec source-rx line)
  552. (regexp-exec fontname-rx line))
  553. => (lambda (m)
  554. (let ((font-or-name (match:substring m 1)))
  555. (if (or (member font-or-name fonts)
  556. (member font-or-name names))
  557. (loop '() #f #t)
  558. (loop (cons line line-buffer)
  559. hold? #f)))))
  560. ((regexp-exec end-rx line)
  561. (unless discard?
  562. (for-each (cut display <> out)
  563. (reverse line-buffer))
  564. (display line out))
  565. (loop '() #f #f))
  566. (hold? (loop (cons line line-buffer)
  567. hold? discard?))
  568. (discard? (loop line-buffer #f #t))
  569. (else (display line out)
  570. (loop '() #f #f)))))))))
  571. '("app/qml/FontPixels.qml"
  572. "app/qml/FontScanlines.qml"
  573. "app/qml/Fonts.qml"
  574. "app/qml/ApplicationSettings.qml"))
  575. ;; Final substitution for default scanline and pixel fonts
  576. (substitute* "app/qml/ApplicationSettings.qml"
  577. (("COMMODORE_PET") "PROGGY_TINY"))
  578. #t))))
  579. (build-system gnu-build-system)
  580. (inputs
  581. `(("qtbase" ,qtbase)
  582. ("qtdeclarative" ,qtdeclarative)
  583. ("qtgraphicaleffects" ,qtgraphicaleffects)
  584. ("qtquickcontrols" ,qtquickcontrols)))
  585. (arguments
  586. `(#:phases
  587. (modify-phases %standard-phases
  588. (replace 'configure
  589. (lambda* (#:key outputs #:allow-other-keys)
  590. (let ((out (assoc-ref outputs "out")))
  591. (substitute* '("qmltermwidget/qmltermwidget.pro")
  592. (("INSTALL_DIR = \\$\\$\\[QT_INSTALL_QML\\]")
  593. (string-append "INSTALL_DIR = " out "/lib/qt5/qml")))
  594. (substitute* '("cool-retro-term.pro" "app/app.pro")
  595. (("/usr") out))
  596. (invoke "qmake"))))
  597. (add-after 'install 'wrap-executable
  598. (lambda* (#:key inputs outputs #:allow-other-keys)
  599. (let ((out (assoc-ref outputs "out"))
  600. (qml "/lib/qt5/qml"))
  601. (wrap-program (string-append out "/bin/cool-retro-term")
  602. `("QML2_IMPORT_PATH" ":" prefix
  603. (,(string-append out qml)
  604. ,@(map (lambda (i)
  605. (string-append (assoc-ref inputs i) qml))
  606. '("qtdeclarative"
  607. "qtgraphicaleffects"
  608. "qtquickcontrols")))))
  609. #t)))
  610. (add-after 'install 'add-alternate-name
  611. (lambda* (#:key outputs #:allow-other-keys)
  612. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  613. (symlink (string-append bin "/cool-retro-term")
  614. (string-append bin "/crt")))))
  615. (add-after 'install 'install-man
  616. (lambda* (#:key outputs #:allow-other-keys)
  617. (let ((mandir (string-append (assoc-ref outputs "out")
  618. "/share/man/man1")))
  619. (install-file "packaging/debian/cool-retro-term.1" mandir)
  620. #t))))))
  621. (synopsis "Terminal emulator")
  622. (description
  623. "Cool-retro-term (crt) is a terminal emulator which mimics the look and
  624. feel of the old cathode ray tube (CRT) screens. It has been designed to be
  625. eye-candy, customizable, and reasonably lightweight.")
  626. (home-page "https://github.com/Swordfish90/cool-retro-term")
  627. (license (list
  628. license:gpl2+ ; qmltermwidget
  629. license:gpl3+ ; cool-retro-term
  630. ;; Fonts
  631. license:silofl1.1
  632. license:x11
  633. license:bsd-3)))))
  634. (define-public sakura
  635. (package
  636. (name "sakura")
  637. (version "3.6.0")
  638. (source (origin
  639. (method url-fetch)
  640. (uri (string-append "https://launchpad.net/" name "/trunk/"
  641. version "/+download/" name "-" version
  642. ".tar.bz2"))
  643. (sha256
  644. (base32
  645. "1q463qm41ym7jb3kbzjz7b6x549vmgkb70arpkhsf86yxly1y5m1"))))
  646. (build-system cmake-build-system)
  647. (arguments
  648. '(#:tests? #f)) ; no check phase
  649. (native-inputs
  650. `(("gettext" ,gettext-minimal)
  651. ("perl" ,perl) ; for pod2man
  652. ("pkg-config" ,pkg-config)))
  653. (inputs
  654. `(("libxft" ,libxft)
  655. ("vte" ,vte)))
  656. (home-page "https://launchpad.net/sakura")
  657. (synopsis "A simple but powerful libvte-based terminal emulator")
  658. (description "@code{Sakura} is a terminal emulator based on GTK+ and VTE.
  659. It's a terminal emulator with few dependencies, so you don't need a full GNOME
  660. desktop installed to have a decent terminal emulator.")
  661. (license license:gpl2)))
  662. (define-public go-github.com-nsf-termbox-go
  663. (let ((commit "4ed959e0540971545eddb8c75514973d670cf739")
  664. (revision "0"))
  665. (package
  666. (name "go-github.com-nsf-termbox-go")
  667. (version (git-version "0.0.0" revision commit))
  668. (source (origin
  669. (method git-fetch)
  670. (uri (git-reference
  671. (url "https://github.com/nsf/termbox-go.git")
  672. (commit commit)))
  673. (file-name (git-file-name name version))
  674. (sha256
  675. (base32
  676. "1vx64i1mg660if3wwm81p4b7lzxfb3qbr39i7misdyld3fc486p9"))))
  677. (build-system go-build-system)
  678. (arguments
  679. '(#:import-path "github.com/nsf/termbox-go"))
  680. (propagated-inputs
  681. `(("go-github.com-mattn-go-runewidth"
  682. ,go-github.com-mattn-go-runewidth)))
  683. (synopsis "@code{termbox} provides a minimal API for text-based user
  684. interfaces")
  685. (description
  686. "Termbox is a library that provides a minimalistic API which allows the
  687. programmer to write text-based user interfaces.")
  688. (home-page "https://github.com/nsf/termbox-go")
  689. (license license:expat))))
  690. (define-public go-golang.org-x-crypto-ssh-terminal
  691. (let ((commit "c78caca803c95773f48a844d3dcab04b9bc4d6dd")
  692. (revision "0"))
  693. (package
  694. (name "go-golang.org-x-crypto-ssh-terminal")
  695. (version (git-version "0.0.0" revision commit))
  696. (source (origin
  697. (method git-fetch)
  698. (uri (git-reference
  699. (url "https://go.googlesource.com/crypto")
  700. (commit commit)))
  701. (file-name (git-file-name name version))
  702. (sha256
  703. (base32
  704. "0vxlfxr9y681yn2cfh6dbqmq35vvq4f45ay0mm31ffkny9cms0y4"))))
  705. (build-system go-build-system)
  706. (arguments
  707. '(#:import-path "golang.org/x/crypto/ssh/terminal"
  708. #:unpack-path "golang.org/x/crypto"
  709. #:phases
  710. (modify-phases %standard-phases
  711. (add-before 'reset-gzip-timestamps 'make-gzip-archive-writable
  712. (lambda* (#:key outputs #:allow-other-keys)
  713. (map (lambda (file)
  714. (make-file-writable file))
  715. (find-files
  716. (string-append (assoc-ref outputs "out")
  717. "/src/golang.org/x/crypto/ed25519/testdata")
  718. ".*\\.gz$"))
  719. #t)))))
  720. (synopsis "Support functions for dealing with terminals in Go")
  721. (description "@code{terminal} provides support functions for dealing
  722. with terminals in Go.")
  723. (home-page "https://go.googlesource.com/crypto/")
  724. (license license:bsd-3))))
  725. (define-public go-github.com-howeyc-gopass
  726. (let ((commit "bf9dde6d0d2c004a008c27aaee91170c786f6db8")
  727. (revision "0"))
  728. (package
  729. (name "go-github.com-howeyc-gopass")
  730. (version (git-version "0.0.0" revision commit))
  731. (source (origin
  732. (method git-fetch)
  733. (uri (git-reference
  734. (url "https://github.com/howeyc/gopass.git")
  735. (commit commit)))
  736. (file-name (git-file-name name version))
  737. (sha256
  738. (base32
  739. "1jxzyfnqi0h1fzlsvlkn10bncic803bfhslyijcxk55mgh297g45"))))
  740. (build-system go-build-system)
  741. (arguments
  742. '(#:import-path "github.com/howeyc/gopass"))
  743. (propagated-inputs
  744. `(("go-golang.org-x-crypto-ssh-terminal"
  745. ,go-golang.org-x-crypto-ssh-terminal)))
  746. (synopsis "Retrieve password from a terminal or piped input in Go")
  747. (description
  748. "@code{gopass} is a Go package for retrieving a password from user
  749. terminal or piped input.")
  750. (home-page "https://github.com/howeyc/gopass")
  751. (license license:isc))))
  752. (define-public python-pyte
  753. (package
  754. (name "python-pyte")
  755. (version "0.7.0")
  756. (source
  757. (origin
  758. (method url-fetch)
  759. (uri (pypi-uri "pyte" version))
  760. (sha256
  761. (base32
  762. "1an54hvyjm8gncx8cgabz9mkpgjkdb0bkyjlkh7g7f94nr3wnfl7"))))
  763. (build-system python-build-system)
  764. (arguments
  765. '(#:phases
  766. (modify-phases %standard-phases
  767. (add-after 'unpack 'remove-failing-test
  768. ;; TODO: Reenable when the `captured` files required by this test
  769. ;; are included in the archive.
  770. (lambda _
  771. (delete-file "tests/test_input_output.py")
  772. #t)))))
  773. (propagated-inputs
  774. `(("python-wcwidth" ,python-wcwidth)))
  775. (native-inputs
  776. `(("python-pytest-runner" ,python-pytest-runner)
  777. ("python-pytest" ,python-pytest)))
  778. (home-page "https://pyte.readthedocs.io/")
  779. (synopsis "Simple VTXXX-compatible terminal emulator")
  780. (description "@code{pyte} is an in-memory VTxxx-compatible terminal
  781. emulator. @var{VTxxx} stands for a series of video terminals, developed by
  782. DEC between 1970 and 1995. The first and probably most famous one was the
  783. VT100 terminal, which is now a de-facto standard for all virtual terminal
  784. emulators.
  785. pyte is a fork of vt102, which was an incomplete pure Python implementation
  786. of VT100 terminal.")
  787. (license license:lgpl3+)))
  788. (define-public python2-pyte
  789. (package-with-python2 python-pyte))
  790. (define-public python-blessings
  791. (package
  792. (name "python-blessings")
  793. (version "1.6.1")
  794. (source
  795. (origin
  796. (method url-fetch)
  797. (uri (pypi-uri "blessings" version))
  798. (sha256
  799. (base32
  800. "1smngy65p8mi62lgm04icasx22v976szhs2aq95y2ljmi1srb4bl"))))
  801. (build-system python-build-system)
  802. (arguments
  803. ;; TODO: For py3, 2to2 is used to convert the code, but test-suite fails
  804. `(#:tests? #f))
  805. (native-inputs
  806. `(("python-nose" ,python-nose)))
  807. (home-page "https://github.com/erikrose/blessings")
  808. (synopsis "Python module to manage terminal color, styling, and
  809. positioning")
  810. (description "Blessings is a pythonic API to manipulate terminal color,
  811. styling, and positioning. It provides similar features to curses but avoids
  812. some of curses’s limitations: it does not require clearing the whole screen
  813. for little changes, provides a scroll-back buffer after the program exits, and
  814. avoids styling altogether when the output is redirected to something other
  815. than a terminal.")
  816. (license license:expat)))
  817. (define-public python2-blessings
  818. (package-with-python2 python-blessings))
  819. (define-public python-curtsies
  820. (package
  821. (name "python-curtsies")
  822. (version "0.2.11")
  823. (source
  824. (origin
  825. (method url-fetch)
  826. (uri (pypi-uri "curtsies" version))
  827. (sha256
  828. (base32
  829. "1vljmw3sy6lrqahhpyg4gk13mzcx3mwhvg8s41698ms3cpgkjipc"))))
  830. (build-system python-build-system)
  831. (arguments
  832. `(#:phases
  833. (modify-phases %standard-phases
  834. (replace 'check
  835. (lambda _
  836. (invoke "nosetests" "-v"))))))
  837. (propagated-inputs
  838. `(("python-blessings" ,python-blessings)
  839. ("python-wcwidth" ,python-wcwidth)))
  840. (native-inputs
  841. `(("python-mock" ,python-mock)
  842. ("python-pyte" ,python-pyte)
  843. ("python-nose" ,python-nose)))
  844. (home-page "https://github.com/thomasballinger/curtsies")
  845. (synopsis "Library for curses-like terminal interaction with colored
  846. strings")
  847. (description "Curtsies is a Python library for interacting with the
  848. terminal. It features string-like objects which carry formatting information,
  849. per-line fullscreen terminal rendering, and keyboard input event reporting.")
  850. (license license:expat)))
  851. (define-public python2-curtsies
  852. (package-with-python2 python-curtsies))
  853. (define-public tmate
  854. (package
  855. (name "tmate")
  856. (version "2.2.1")
  857. (source
  858. (origin
  859. (method git-fetch)
  860. (uri (git-reference
  861. (url "https://github.com/tmate-io/tmate.git")
  862. (commit version)))
  863. (file-name (git-file-name name version))
  864. (sha256
  865. (base32
  866. "0pfl9vrswzim9ydi1n652h3rax2zrmy6sqkp0r09yy3lw83h4y1r"))))
  867. (build-system gnu-build-system)
  868. (inputs
  869. `(("libevent" ,libevent)
  870. ("libssh" ,libssh)
  871. ("msgpack" ,msgpack)
  872. ("ncurses" ,ncurses)))
  873. (native-inputs
  874. `(("autoconf" ,autoconf)
  875. ("automake" ,automake)
  876. ("pkg-config" ,pkg-config)))
  877. (home-page "https://tmate.io/")
  878. (synopsis "Terminal sharing application")
  879. (description "tmate is a terminal sharing application that allows you to
  880. share your terminal with other users over the Internet. tmate is a fork of
  881. tmux.")
  882. (license license:isc)))
  883. (define-public kitty
  884. (package
  885. (name "kitty")
  886. (version "0.13.1")
  887. (home-page "https://sw.kovidgoyal.net/kitty/")
  888. (source
  889. (origin
  890. (method git-fetch)
  891. (uri (git-reference
  892. (url "https://github.com/kovidgoyal/kitty.git")
  893. (commit (string-append "v" version))))
  894. (file-name (git-file-name name version))
  895. (sha256
  896. (base32
  897. "1j24zjasdh48z7majfpqr71n1wn5a9688wsmmqn26v8kfb68pqs4"))
  898. (modules '((guix build utils)))
  899. (snippet
  900. '(begin
  901. ;; patch needed as sphinx-build is used as a python script
  902. ;; whereas the guix package uses a bash script launching the
  903. ;; python script
  904. (substitute* "docs/conf.py"
  905. (("(from kitty.constants import str_version)" kitty-imp)
  906. (string-append "sys.path.append(\"..\")\n" kitty-imp)))
  907. (substitute* "docs/Makefile"
  908. (("^SPHINXBUILD[[:space:]]+= (python3.*)$")
  909. "SPHINXBUILD = sphinx-build\n"))
  910. #t))))
  911. (build-system gnu-build-system)
  912. (inputs
  913. `(("python" ,python)
  914. ("harfbuzz" ,harfbuzz)
  915. ("zlib" ,zlib)
  916. ("libpng" ,libpng)
  917. ("freetype" ,freetype)
  918. ("fontconfig" ,fontconfig)
  919. ("pygments" ,python2-pygments)))
  920. (native-inputs
  921. `(("pkg-config" ,pkg-config)
  922. ("libxrandr" ,libxrandr)
  923. ("libdbus" ,dbus)
  924. ("libxcursor" ,libxcursor)
  925. ("libxi" ,libxi)
  926. ("libxinerama" ,libxinerama)
  927. ("libgl1-mesa" ,mesa)
  928. ("libxkbcommon" ,libxkbcommon)
  929. ("sphinx" ,python-sphinx)
  930. ("ncurses" ,ncurses) ;; for tic command
  931. ("wayland-protocols" ,wayland-protocols)))
  932. (arguments
  933. '(#:phases (modify-phases %standard-phases
  934. (delete 'configure)
  935. (replace 'build
  936. (lambda _
  937. (invoke "python3" "setup.py" "linux-package")))
  938. (replace 'check
  939. (lambda _
  940. (invoke "python3" "setup.py" "test")))
  941. (add-before 'install 'rm-pycache
  942. ;; created python cache __pycache__ are non deterministic
  943. (lambda _
  944. (let ((pycaches (find-files "linux-package/"
  945. "__pycache__"
  946. #:directories? #t)))
  947. (for-each delete-file-recursively pycaches)
  948. #t)))
  949. (replace 'install
  950. (lambda _
  951. (let* ((out (assoc-ref %outputs "out"))
  952. (obin (string-append out "/bin"))
  953. (olib (string-append out "/lib"))
  954. (oshare (string-append out "/share")))
  955. (copy-recursively "linux-package/bin" obin)
  956. (copy-recursively "linux-package/share" oshare)
  957. (copy-recursively "linux-package/lib" olib)
  958. #t))))))
  959. (synopsis "Fast, featureful, GPU based terminal emulator")
  960. (description "Kitty is a fast and featureful GPU-based terminal emulator:
  961. @itemize
  962. @item Offloads rendering to the GPU for lower system load and buttery smooth
  963. scrolling. Uses threaded rendering to minimize input latency.
  964. @item Supports all modern terminal features: graphics (images), unicode,
  965. true-color, OpenType ligatures, mouse protocol, focus tracking, bracketed
  966. paste and several new terminal protocol extensions.
  967. @item Supports tiling multiple terminal windows side by side in different
  968. layouts without needing to use an extra program like tmux.
  969. @item Can be controlled from scripts or the shell prompt, even over SSH.
  970. @item Has a framework for Kittens, small terminal programs that can be used to
  971. extend kitty's functionality. For example, they are used for Unicode input,
  972. hints, and side-by-side diff.
  973. @item Supports startup sessions which allow you to specify the window/tab
  974. layout, working directories and programs to run on startup.
  975. @item Allows you to open the scrollback buffer in a separate window using
  976. arbitrary programs of your choice. This is useful for browsing the history
  977. comfortably in a pager or editor.
  978. @end itemize")
  979. (license license:gpl3+)))