screen.scm 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
  3. ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2015, 2017 Eric Bavier <bavier@member.fsf.org>
  5. ;;; Copyright © 2016, 2017, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
  7. ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
  8. ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  9. ;;;
  10. ;;; This file is part of GNU Guix.
  11. ;;;
  12. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  13. ;;; under the terms of the GNU General Public License as published by
  14. ;;; the Free Software Foundation; either version 3 of the License, or (at
  15. ;;; your option) any later version.
  16. ;;;
  17. ;;; GNU Guix is distributed in the hope that it will be useful, but
  18. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. ;;; GNU General Public License for more details.
  21. ;;;
  22. ;;; You should have received a copy of the GNU General Public License
  23. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  24. (define-module (gnu packages screen)
  25. #:use-module (guix licenses)
  26. #:use-module (guix packages)
  27. #:use-module (guix download)
  28. #:use-module (guix git-download)
  29. #:use-module (guix build-system gnu)
  30. #:use-module (gnu packages)
  31. #:use-module (gnu packages hurd)
  32. #:use-module (gnu packages ncurses)
  33. #:use-module (gnu packages perl)
  34. #:use-module (gnu packages python)
  35. #:use-module (gnu packages slang)
  36. #:use-module (gnu packages texinfo))
  37. (define-public screen
  38. (package
  39. (name "screen")
  40. (version "4.8.0")
  41. (source (origin
  42. (method url-fetch)
  43. (uri (string-append "mirror://gnu/screen/screen-"
  44. version ".tar.gz"))
  45. (patches (search-patches "screen-hurd-path-max.patch"
  46. "screen-CVE-2021-26937.patch"))
  47. (sha256
  48. (base32 "18ascpjzsy70h6hk7wpg8zmzjwgdyrdr7c6z4pg5z4l9hhyv24bf"))))
  49. (build-system gnu-build-system)
  50. (native-inputs
  51. `(("makeinfo" ,texinfo)))
  52. (inputs
  53. `(("ncurses" ,ncurses)
  54. ("perl" ,perl)))
  55. (arguments
  56. `(#:configure-flags
  57. ;; By default, screen supports 16 colors, but we want 256 when
  58. ;; ~/.screenrc contains 'term xterm-256color'.
  59. '("--enable-colors256")))
  60. (home-page "https://www.gnu.org/software/screen/")
  61. (synopsis "Full-screen window manager providing multiple terminals")
  62. (description
  63. "GNU Screen is a terminal window manager that multiplexes a single
  64. terminal between several processes. The virtual terminals each provide
  65. features such as a scroll-back buffer and a copy-and-paste mechanism. Screen
  66. then manages the different virtual terminals, allowing you to easily switch
  67. between them, to detach them from the current session, or even splitting the
  68. view to show two terminals at once.")
  69. (license gpl2+)))
  70. (define-public dtach
  71. (package
  72. (name "dtach")
  73. (version "0.9")
  74. (source (origin
  75. (method url-fetch)
  76. (uri (string-append "mirror://sourceforge/" name "/" name "/"
  77. version "/" name "-" version ".tar.gz"))
  78. (sha256
  79. (base32
  80. "1wwj2hlngi8qn2pisvhyfxxs8gyqjlgrrv5lz91w8ly54dlzvs9j"))))
  81. (build-system gnu-build-system)
  82. (arguments
  83. ;; No install target.
  84. '(#:phases
  85. (modify-phases %standard-phases
  86. (replace 'install
  87. (lambda* (#:key outputs #:allow-other-keys)
  88. (let ((out (assoc-ref outputs "out")))
  89. (install-file "dtach" (string-append out "/bin"))
  90. (install-file "dtach.1" (string-append out "/share/man/man1"))
  91. #t))))
  92. ;; No check target.
  93. #:tests? #f))
  94. (home-page "http://dtach.sourceforge.net/")
  95. (synopsis "Emulates the detach feature of screen")
  96. (description
  97. "dtach is a tiny program that emulates the detach feature of screen,
  98. allowing you to run a program in an environment that is protected from the
  99. controlling terminal and attach to it later.")
  100. (license gpl2+)))
  101. (define-public byobu
  102. (package
  103. (name "byobu")
  104. (version "5.133")
  105. (source
  106. (origin
  107. (method url-fetch)
  108. (uri (string-append "https://launchpad.net/byobu/trunk/"
  109. version "/+download/byobu_"
  110. version ".orig.tar.gz"))
  111. (sha256
  112. (base32 "0qvmmdnvwqbgbhn5c8asmrmjhclcl029py2d2zvmd7h5ij7s93jd"))
  113. (patches (search-patches "byobu-writable-status.patch"))))
  114. (build-system gnu-build-system)
  115. (inputs
  116. `(("python" ,python-wrapper) ; for config and session GUIs
  117. ("python-newt" ,newt "python")))
  118. (arguments
  119. `(#:phases
  120. (modify-phases %standard-phases
  121. (add-before
  122. 'configure 'provide-locale
  123. (lambda* (#:key inputs #:allow-other-keys)
  124. (let ((libc (assoc-ref inputs "libc"))) ; implicit input
  125. (substitute* "usr/bin/byobu.in"
  126. (("locale") (string-append libc "/bin/locale")))
  127. #t)))
  128. (add-after
  129. 'install 'wrap-python-scripts
  130. (lambda* (#:key inputs outputs #:allow-other-keys)
  131. (let* ((python (search-input-file inputs "/bin/python"))
  132. (out (assoc-ref outputs "out"))
  133. (config (string-append out "/bin/byobu-config"))
  134. (select (string-append out "/bin/byobu-select-session")))
  135. (wrap-program config
  136. `("BYOBU_PYTHON" = (,python))
  137. `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
  138. (wrap-program select
  139. `("BYOBU_PYTHON" = (,python)))
  140. #t))))))
  141. (home-page "https://byobu.org/")
  142. (synopsis "Text-based window manager and terminal multiplexer")
  143. (description
  144. "Byobu is a Japanese term for decorative, multi-panel screens that serve
  145. as folding room dividers. The Byobu software includes an enhanced profile,
  146. configuration utilities, and system status notifications for the GNU Screen
  147. window manager as well as the Tmux terminal multiplexer.")
  148. (license gpl3+)))
  149. (define-public reptyr
  150. (package
  151. (name "reptyr")
  152. (version "0.7.0")
  153. (source
  154. (origin
  155. (method git-fetch)
  156. (uri (git-reference
  157. (url "https://github.com/nelhage/reptyr")
  158. (commit (string-append "reptyr-" version))))
  159. (file-name (git-file-name name version))
  160. (sha256
  161. (base32 "1hnijfz1ab34j2h2cxc3f43rmbclyihgn9x9wxa7jqqgb2xm71hj"))))
  162. (build-system gnu-build-system)
  163. (arguments
  164. '(#:tests? #f ; no tests
  165. #:make-flags
  166. (list "CC=gcc"
  167. (string-append "PREFIX=" (assoc-ref %outputs "out"))
  168. (string-append "BASHCOMPDIR=" (assoc-ref %outputs "out")
  169. "/etc/bash_completion.d"))
  170. #:phases
  171. (modify-phases %standard-phases
  172. (delete 'configure)))) ; no configure script
  173. (home-page "https://github.com/nelhage/reptyr")
  174. (synopsis "Tool for reparenting a running program to a new terminal")
  175. (description
  176. "reptyr is a utility for taking an existing running program and attaching
  177. it to a new terminal. Started a long-running process over @code{ssh}, but have
  178. to leave and don't want to interrupt it? Just start a @code{screen}, use
  179. reptyr to grab it, and then kill the @code{ssh} session and head on home.")
  180. ;; Reptyr currently does not support mips.
  181. (supported-systems (delete "mips64el-linux" %supported-systems))
  182. (license expat)))