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