2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper
|
2020-10-27 01:52:46 +01:00
|
|
|
, ncurses, python3, perl, textual-window-manager
|
|
|
|
, gettext, vim, bc, screen }:
|
2013-05-06 13:06:59 +02:00
|
|
|
|
2020-10-27 01:52:46 +01:00
|
|
|
let
|
|
|
|
pythonEnv = python3.withPackages (ps: with ps; [ snack ]);
|
|
|
|
in
|
2013-05-06 13:06:59 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2020-03-06 08:12:15 +01:00
|
|
|
version = "5.133";
|
2015-11-11 11:23:13 +01:00
|
|
|
name = "byobu-" + version;
|
2013-05-06 13:06:59 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-11-11 11:23:13 +01:00
|
|
|
url = "https://launchpad.net/byobu/trunk/${version}/+download/byobu_${version}.orig.tar.gz";
|
2020-03-06 08:12:15 +01:00
|
|
|
sha256 = "0qvmmdnvwqbgbhn5c8asmrmjhclcl029py2d2zvmd7h5ij7s93jd";
|
2013-05-06 13:06:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ perl gettext ];
|
2020-10-27 01:52:46 +01:00
|
|
|
propagatedBuildInputs = [ textual-window-manager screen ];
|
2015-09-15 03:41:45 +02:00
|
|
|
|
2020-10-27 01:52:46 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace usr/bin/byobu-export.in \
|
|
|
|
--replace "gettext" "${gettext}/bin/gettext"
|
|
|
|
substituteInPlace usr/lib/byobu/menu \
|
|
|
|
--replace "gettext" "${gettext}/bin/gettext"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Byobu does not compile its po files for some reason
|
|
|
|
for po in po/*.po; do
|
|
|
|
lang=''${po#po/}
|
|
|
|
lang=''${lang%.po}
|
|
|
|
# Path where byobu looks for translations as observed in the source code and strace
|
|
|
|
mkdir -p $out/share/byobu/po/$lang/LC_MESSAGES/
|
|
|
|
msgfmt $po -o $out/share/byobu/po/$lang/LC_MESSAGES/byobu.mo
|
|
|
|
done
|
|
|
|
|
|
|
|
# Override the symlinks otherwise they mess with the wrapping
|
|
|
|
cp --remove-destination $out/bin/byobu $out/bin/byobu-screen
|
|
|
|
cp --remove-destination $out/bin/byobu $out/bin/byobu-tmux
|
|
|
|
|
|
|
|
for i in $out/bin/byobu*; do
|
|
|
|
# We don't use the usual ".$package-wrapped" because arg0 within the shebang scripts
|
|
|
|
# points to the filename and byobu matches against this to know which backend
|
|
|
|
# to start with
|
|
|
|
file=".$(basename $i)"
|
|
|
|
mv $i $out/bin/$file
|
|
|
|
makeWrapper "$out/bin/$file" "$out/bin/$(basename $i)" --argv0 $(basename $i) \
|
|
|
|
--set BYOBU_PATH ${lib.escapeShellArg (lib.makeBinPath [ vim bc ])} \
|
|
|
|
--set BYOBU_PYTHON "${pythonEnv}/bin/python"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-03-06 08:12:15 +01:00
|
|
|
homepage = "https://launchpad.net/byobu/";
|
2013-10-05 16:22:46 +02:00
|
|
|
description = "Text-based window manager and terminal multiplexer";
|
2013-05-06 13:06:59 +02:00
|
|
|
|
|
|
|
longDescription =
|
2020-10-27 01:52:46 +01:00
|
|
|
''Byobu is a GPLv3 open source text-based window manager and terminal multiplexer.
|
|
|
|
It was originally designed to provide elegant enhancements to the otherwise functional,
|
|
|
|
plain, practical GNU Screen, for the Ubuntu server distribution.
|
|
|
|
Byobu now includes an enhanced profiles, convenient keybindings,
|
|
|
|
configuration utilities, and toggle-able system status notifications for both
|
|
|
|
the GNU Screen window manager and the more modern Tmux terminal multiplexer,
|
2013-05-06 13:06:59 +02:00
|
|
|
and works on most Linux, BSD, and Mac distributions.
|
|
|
|
'';
|
|
|
|
|
2020-10-27 01:52:46 +01:00
|
|
|
license = licenses.gpl3;
|
2013-05-06 13:06:59 +02:00
|
|
|
|
2020-10-27 01:52:46 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ qknight berbiche ];
|
2013-05-06 13:06:59 +02:00
|
|
|
};
|
|
|
|
}
|