lol
1{ lib
2, stdenv
3, fetchFromGitHub
4, autoreconfHook
5, bison
6, libevent
7, ncurses
8, pkg-config
9, withSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic, systemd
10, utf8proc
11, withUtempter ? stdenv.isLinux && !stdenv.hostPlatform.isMusl, libutempter
12}:
13
14let
15
16 bashCompletion = fetchFromGitHub {
17 owner = "imomaliev";
18 repo = "tmux-bash-completion";
19 rev = "f5d53239f7658f8e8fbaf02535cc369009c436d6";
20 sha256 = "0sq2g3w0h3mkfa6qwqdw93chb5f1hgkz5vdl8yw8mxwdqwhsdprr";
21 };
22
23in
24
25stdenv.mkDerivation rec {
26 pname = "tmux";
27 version = "3.3a";
28
29 outputs = [ "out" "man" ];
30
31 src = fetchFromGitHub {
32 owner = "tmux";
33 repo = "tmux";
34 rev = version;
35 sha256 = "sha256-SygHxTe7N4y7SdzKixPFQvqRRL57Fm8zWYHfTpW+yVY=";
36 };
37
38 nativeBuildInputs = [
39 pkg-config
40 autoreconfHook
41 bison
42 ];
43
44 buildInputs = [
45 ncurses
46 libevent
47 ] ++ lib.optionals withSystemd [ systemd ]
48 ++ lib.optionals stdenv.isDarwin [ utf8proc ]
49 ++ lib.optionals withUtempter [ libutempter ];
50
51 configureFlags = [
52 "--sysconfdir=/etc"
53 "--localstatedir=/var"
54 ] ++ lib.optionals withSystemd [ "--enable-systemd" ]
55 ++ lib.optionals withUtempter [ "--enable-utempter" ]
56 ++ lib.optionals stdenv.isDarwin [ "--enable-utf8proc" ];
57
58 enableParallelBuilding = true;
59
60 postInstall = ''
61 mkdir -p $out/share/bash-completion/completions
62 cp -v ${bashCompletion}/completions/tmux $out/share/bash-completion/completions/tmux
63 '';
64
65 meta = {
66 homepage = "https://tmux.github.io/";
67 description = "Terminal multiplexer";
68 longDescription = ''
69 tmux is intended to be a modern, BSD-licensed alternative to programs such as GNU screen. Major features include:
70 * A powerful, consistent, well-documented and easily scriptable command interface.
71 * A window may be split horizontally and vertically into panes.
72 * Panes can be freely moved and resized, or arranged into preset layouts.
73 * Support for UTF-8 and 256-colour terminals.
74 * Copy and paste with multiple buffers.
75 * Interactive menus to select windows, sessions or clients.
76 * Change the current window by searching for text in the target.
77 * Terminal locking, manually or after a timeout.
78 * A clean, easily extended, BSD-licensed codebase, under active development.
79 '';
80 changelog = "https://github.com/tmux/tmux/raw/${version}/CHANGES";
81 license = lib.licenses.bsd3;
82 platforms = lib.platforms.unix;
83 maintainers = with lib.maintainers; [ thammers fpletz SuperSandro2000 srapenne ];
84 };
85}