gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / tmux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
5 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
6 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
7 ;;; Copyright © 2019–2021 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
9 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
10 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages tmux)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system trivial)
34 #:use-module (guix build-system python)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages bash)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages libevent)
40 #:use-module (gnu packages ncurses)
41 #:use-module (gnu packages sphinx))
42
43 (define-public tmux
44 (package
45 (name "tmux")
46 (version "3.2")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append
50 "https://github.com/tmux/tmux/releases/download/"
51 version "/tmux-" version ".tar.gz"))
52 (sha256
53 (base32
54 "16d310gcpfnfh7rl5vy1lwqy54ai5awkkybzkm1bw761719k8kb6"))))
55 (build-system gnu-build-system)
56 (inputs
57 `(("libevent" ,libevent)
58 ("ncurses" ,ncurses)))
59 (home-page "https://tmux.github.io/")
60 (synopsis "Terminal multiplexer")
61 (description
62 "tmux is a terminal multiplexer: it enables a number of terminals (or
63 windows), each running a separate program, to be created, accessed, and
64 controlled from a single screen. tmux may be detached from a screen and
65 continue running in the background, then later reattached.")
66 (license license:isc)))
67
68 (define-public tmux-themepack
69 (let ((commit "03a372866f7677f7fe63bcee140b48b9fd372c48")
70 (revision "1"))
71 (package
72 (name "tmux-themepack")
73 (version (git-version "0.0.0" revision commit)) ; no version tags
74 (source (origin
75 (method git-fetch)
76 (uri (git-reference
77 (url "https://github.com/jimeh/tmux-themepack")
78 (commit commit)))
79 (sha256
80 (base32
81 "1d3k87mq5lca042jbap5kxskjy3kg79wjhhpnm6jacbn3anc67zl"))
82 (file-name (git-file-name name version))))
83 (build-system gnu-build-system)
84 (arguments
85 `(#:tests? #f ; no test suite
86 #:phases (modify-phases %standard-phases
87 (delete 'configure)
88 (delete 'build)
89 (replace 'install
90 (lambda* (#:key outputs #:allow-other-keys)
91 (let* ((out (string-append
92 (assoc-ref outputs "out")
93 "/share/" ,name "-" ,version)))
94 (copy-recursively "." out)))))))
95 (home-page "https://github.com/jimeh/tmux-themepack")
96 (synopsis "Collection of themes for Tmux")
97 (description "A collection of various themes for Tmux.")
98 (license license:wtfpl2))))
99
100 (define-public tmuxifier
101 (package
102 (name "tmuxifier")
103 (version "0.13.0")
104 (source (origin
105 (method git-fetch)
106 (uri (git-reference
107 (url "https://github.com/jimeh/tmuxifier")
108 (commit (string-append "v" version))))
109 (file-name (git-file-name name version))
110 (sha256
111 (base32
112 "1b6a1cw2mnml84k5vhbcp58kvp94xlnlpp4kwdhqw4jrzfgcjfzd"))))
113 (build-system gnu-build-system)
114 (arguments
115 `(#:tests? #f
116 #:phases (modify-phases %standard-phases
117 (delete 'configure)
118 (delete 'build)
119 (replace 'install
120 (lambda* (#:key outputs #:allow-other-keys)
121 (let* ((out (assoc-ref %outputs "out"))
122 (bindir (string-append out "/bin"))
123 (share (string-append out "/share/" ,name)))
124 (install-file "bin/tmuxifier" bindir)
125 (substitute* (string-append bindir "/tmuxifier")
126 (("set -e")
127 (string-append "TMUXIFIER=" share "\nset -e")))
128 (for-each (lambda (init-script)
129 (install-file init-script (string-append
130 share "/init")))
131 '("init.sh" "init.tcsh" "init.fish"))
132 (for-each (lambda (dir)
133 (copy-recursively dir (string-append
134 share "/" dir)))
135 '("completion" "lib" "libexec"
136 "templates"))))))))
137 (home-page "https://github.com/jimeh/tmuxifier")
138 (synopsis "Powerful session, window & pane management for Tmux")
139 (description "Tmuxifier allows you to easily create, edit, and load
140 @code{layout} files, which are simple shell scripts where you use the tmux
141 command and helper commands provided by tmuxifier to manage Tmux sessions and
142 windows.")
143 (license license:expat)))
144
145 (define-public python-libtmux
146 (package
147 (name "python-libtmux")
148 (version "0.8.5")
149 (source
150 (origin
151 (method git-fetch)
152 ;; PyPI source tarball does not include tests.
153 (uri (git-reference
154 (url "https://github.com/tmux-python/libtmux")
155 (commit (string-append "v" version))))
156 (file-name (git-file-name name version))
157 (sha256
158 (base32 "1vrd99kl2gsk49mvbp6k7l1k7r96vf1fczsqclb62yd4hdpp7zaa"))))
159 (build-system python-build-system)
160 (propagated-inputs
161 `(("procps" ,procps))) ;tests need top
162 (native-inputs
163 `(("python-pytest" ,python-pytest)
164 ("tmux" ,tmux)))
165 (arguments
166 `(#:phases
167 (modify-phases %standard-phases
168 (replace 'check
169 (lambda _
170 ;; Extend PYTHONPATH so the built package will be found.
171 (setenv "PYTHONPATH"
172 (string-append (getcwd) "/build/lib:"
173 (getenv "PYTHONPATH")))
174 ;; Fix <https://github.com/tmux-python/libtmux/issues/265>.
175 (setenv "LANG" "en_US.utf8")
176 ;; Skip tests that I suspect fail because of a change
177 ;; in behavior in tmux 3 from tmux 2
178 ;; https://github.com/tmux-python/libtmux/issues/281
179 (invoke "pytest" "-vv" "-k"
180 (string-append "not test_show_option_unknown "
181 "and not test_show_window_option_unknown"))
182 #t)))))
183 (home-page "https://github.com/tmux-python/libtmux")
184 (synopsis "Python API for tmux")
185 (description "Libtmux is the tool behind @command{tmuxp}, a tmux workspace
186 manager in Python. It creates object mappings to traverse, inspect and interact
187 with live tmux sessions.")
188 (license license:expat)))
189
190 (define-public python-daemux
191 (package
192 (name "python-daemux")
193 (version "0.1.0")
194 (source
195 ;; We fetch from the Git repo because there are no tests in the PyPI
196 ;; archive.
197 (origin
198 (method git-fetch)
199 (uri (git-reference
200 (url "https://github.com/edouardklein/daemux")
201 (commit (string-append "v" version))))
202 (file-name (git-file-name name version))
203 (sha256
204 (base32 "0cb8v552f2hkwz6d3hwsmrz3gd28jikga3lcc3r1zlw8ra7804ph"))))
205 (build-system python-build-system)
206 (arguments
207 `(#:phases (modify-phases %standard-phases
208 (replace 'check
209 (lambda _
210 (mkdir-p "tmptmux")
211 (setenv "TMUX_TMPDIR" (string-append (getcwd) "/tmptmux"))
212 (invoke "tmux" "new-session" "-d")
213 (invoke "make" "test"))))))
214 (propagated-inputs
215 `(("python-libtmux" ,python-libtmux)))
216 (native-inputs
217 `(("python-coverage" ,python-coverage)
218 ("python-sphinx" ,python-sphinx)
219 ("tmux" ,tmux)))
220 (home-page "https://github.com/edouardklein/daemux")
221 (synopsis "Start, stop, restart and check daemons via tmux")
222 (description
223 "Daemux lets you run daemons in a @command{tmux} pane. Users can launch
224 long-running background tasks, and check these tasks' health by hand, relaunch
225 them, etc., by attaching to the corresponding pane in tmux.")
226 (license license:agpl3+)))
227
228 (define-public tmux-xpanes
229 (package
230 (name "tmux-xpanes")
231 (version "4.1.3")
232 (source (origin
233 (method git-fetch)
234 (uri (git-reference
235 (url "https://github.com/greymd/tmux-xpanes")
236 (commit (string-append "v" version))))
237 (file-name (git-file-name name version))
238 (sha256
239 (base32
240 "09fmnn1q76r1l4cv7clmfr3j9cjmd053kq238d0qj2i486948ivv"))))
241 (build-system trivial-build-system)
242 (inputs
243 `(("bash" ,bash)))
244 (arguments
245 `(#:modules ((guix build utils))
246 #:builder
247 (begin
248 (use-modules (guix build utils))
249 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
250 (copy-recursively (assoc-ref %build-inputs "source") ".")
251 (substitute* "bin/xpanes"
252 (("/bin/bash") (which "bash")))
253 (install-file "bin/xpanes" (string-append %output "/bin"))
254 (install-file "man/xpanes.1" (string-append %output "/man/man1"))
255 #t)))
256 (home-page "https://github.com/greymd/tmux-xpanes")
257 (synopsis "Tmux based terminal divider")
258 (description "This package provides tmux-based terminal divider.
259
260 @code{xpanes} or @code{tmux-xpanes} (alias of @code{xpanes}) commands have
261 following features:
262
263 @itemize
264 @item Split tmux window into multiple panes.
265 @item Build command lines & execute them on the panes.
266 @item Runnable from outside of tmux session.
267 @item Runnable from inside of tmux session.
268 @item Record operation log.
269 @item Flexible layout arrangement for panes.
270 @item Display pane title on each pane.
271 @item Generate command lines from standard input (Pipe mode).
272 @end itemize")
273 (license license:expat)))