2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2024-02-29 20:09:43 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, bison
|
|
|
|
, libevent
|
2022-06-16 17:23:12 +00:00
|
|
|
, ncurses
|
|
|
|
, pkg-config
|
2023-07-15 17:15:38 +00:00
|
|
|
, runCommand
|
2023-02-02 18:25:31 +00:00
|
|
|
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
|
2022-11-27 09:42:12 +00:00
|
|
|
, withUtf8proc ? true, utf8proc # gets Unicode updates faster than glibc
|
2024-09-26 11:04:55 +00:00
|
|
|
, withUtempter ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl, libutempter
|
2024-02-29 20:09:43 +00:00
|
|
|
, withSixel ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
bashCompletion = fetchFromGitHub {
|
|
|
|
owner = "imomaliev";
|
|
|
|
repo = "tmux-bash-completion";
|
2020-11-03 02:18:15 +00:00
|
|
|
rev = "f5d53239f7658f8e8fbaf02535cc369009c436d6";
|
|
|
|
sha256 = "0sq2g3w0h3mkfa6qwqdw93chb5f1hgkz5vdl8yw8mxwdqwhsdprr";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "tmux";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "3.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tmux";
|
|
|
|
repo = "tmux";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = finalAttrs.version;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-RX3RZ0Mcyda7C7im1r4QgUxTnp95nfpGgQ2HRxr0s64=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tmux/tmux/commit/2d1afa0e62a24aa7c53ce4fb6f1e35e29d01a904.diff";
|
|
|
|
hash = "sha256-mDt5wy570qrUc0clGa3GhZFTKgL0sfnQcWJEJBKAbKs=";
|
|
|
|
})
|
|
|
|
# this patch is designed for android but FreeBSD exhibits the same error for the same reason
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tmux/tmux/commit/4f5a944ae3e8f7a230054b6c0b26f423fa738e71.patch";
|
|
|
|
hash = "sha256-HlUeU5ZicPe7Ya8A1HpunxfVOE2BF6jOHq3ZqTuU5RE=";
|
|
|
|
})
|
2024-07-01 15:47:52 +00:00
|
|
|
# https://github.com/tmux/tmux/issues/3983
|
|
|
|
# fix tmux crashing when neovim is used in a ssh session
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tmux/tmux/commit/aa17f0e0c1c8b3f1d6fc8617613c74f07de66fae.patch";
|
|
|
|
hash = "sha256-jhWGnC9tsGqTTA5tU+i4G3wlwZ7HGz4P0UHl17dVRU4=";
|
|
|
|
})
|
2024-09-19 14:19:46 +00:00
|
|
|
# https://github.com/tmux/tmux/issues/3905
|
|
|
|
# fix tmux hanging on shutdown
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/tmux/tmux/commit/3823fa2c577d440649a84af660e4d3b0c095d248.patch";
|
|
|
|
hash = "sha256-FZDy/ZgVdwUAam8g5SfGBSnMhp2nlHHfrO9eJNIhVPo=";
|
|
|
|
})
|
2024-06-20 14:57:18 +00:00
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
autoreconfHook
|
|
|
|
bison
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ncurses
|
|
|
|
libevent
|
2022-06-26 10:26:21 +00:00
|
|
|
] ++ lib.optionals withSystemd [ systemd ]
|
2022-11-27 09:42:12 +00:00
|
|
|
++ lib.optionals withUtf8proc [ utf8proc ]
|
2022-11-21 17:40:18 +00:00
|
|
|
++ lib.optionals withUtempter [ libutempter ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
2022-06-26 10:26:21 +00:00
|
|
|
] ++ lib.optionals withSystemd [ "--enable-systemd" ]
|
2024-02-29 20:09:43 +00:00
|
|
|
++ lib.optionals withSixel [ "--enable-sixel" ]
|
2022-11-21 17:40:18 +00:00
|
|
|
++ lib.optionals withUtempter [ "--enable-utempter" ]
|
2022-11-27 09:42:12 +00:00
|
|
|
++ lib.optionals withUtf8proc [ "--enable-utf8proc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/bash-completion/completions
|
|
|
|
cp -v ${bashCompletion}/completions/tmux $out/share/bash-completion/completions/tmux
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2023-07-15 17:15:38 +00:00
|
|
|
mkdir $out/nix-support
|
|
|
|
echo "${finalAttrs.passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru = {
|
2024-09-26 11:04:55 +00:00
|
|
|
terminfo = runCommand "tmux-terminfo" { nativeBuildInputs = [ ncurses ]; } (if stdenv.hostPlatform.isDarwin then ''
|
2023-07-15 17:15:38 +00:00
|
|
|
mkdir -p $out/share/terminfo/74
|
|
|
|
cp -v ${ncurses}/share/terminfo/74/tmux $out/share/terminfo/74
|
|
|
|
# macOS ships an old version (5.7) of ncurses which does not include tmux-256color so we need to provide it from our ncurses.
|
|
|
|
# However, due to a bug in ncurses 5.7, we need to first patch the terminfo before we can use it with macOS.
|
|
|
|
# https://gpanders.com/blog/the-definitive-guide-to-using-tmux-256color-on-macos/
|
|
|
|
tic -o $out/share/terminfo -x <(TERMINFO_DIRS=${ncurses}/share/terminfo infocmp -x tmux-256color | sed 's|pairs#0x10000|pairs#32767|')
|
|
|
|
'' else ''
|
|
|
|
mkdir -p $out/share/terminfo/t
|
|
|
|
ln -sv ${ncurses}/share/terminfo/t/{tmux,tmux-256color,tmux-direct} $out/share/terminfo/t
|
|
|
|
'');
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2020-11-03 02:18:15 +00:00
|
|
|
homepage = "https://tmux.github.io/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Terminal multiplexer";
|
2022-06-16 17:23:12 +00:00
|
|
|
longDescription = ''
|
|
|
|
tmux is intended to be a modern, BSD-licensed alternative to programs such as GNU screen. Major features include:
|
|
|
|
* A powerful, consistent, well-documented and easily scriptable command interface.
|
|
|
|
* A window may be split horizontally and vertically into panes.
|
|
|
|
* Panes can be freely moved and resized, or arranged into preset layouts.
|
|
|
|
* Support for UTF-8 and 256-colour terminals.
|
|
|
|
* Copy and paste with multiple buffers.
|
|
|
|
* Interactive menus to select windows, sessions or clients.
|
|
|
|
* Change the current window by searching for text in the target.
|
|
|
|
* Terminal locking, manually or after a timeout.
|
|
|
|
* A clean, easily extended, BSD-licensed codebase, under active development.
|
|
|
|
'';
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/tmux/tmux/raw/${finalAttrs.version}/CHANGES";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.unix;
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "tmux";
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with lib.maintainers; [ thammers fpletz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|