iosevka: 32.4.0 -> 32.5.0 (#378549)
[NixPkgs.git] / pkgs / by-name / by / byobu / package.nix
blob462b2ef3a7bde3f7ed2e6a76645a8832485e5340
2   lib,
3   autoreconfHook,
4   bc,
5   fetchFromGitHub,
6   gettext,
7   makeWrapper,
8   perl,
9   python3,
10   screen,
11   stdenv,
12   vim,
13   tmux,
16 let
17   pythonEnv = python3.withPackages (ps: with ps; [ snack ]);
19 stdenv.mkDerivation (finalAttrs: {
20   pname = "byobu";
21   version = "6.12";
23   src = fetchFromGitHub {
24     owner = "dustinkirkland";
25     repo = "byobu";
26     rev = finalAttrs.version;
27     hash = "sha256-NzC9Njsnz14mfKnERGDZw8O3vux0wnfCKwjUeTBQswc=";
28   };
30   nativeBuildInputs = [
31     autoreconfHook
32     gettext
33     makeWrapper
34   ];
36   buildInputs = [
37     perl # perl is needed for `lib/byobu/include/*` scripts
38     screen
39     tmux
40   ];
42   doCheck = true;
43   strictDeps = true;
45   postPatch = ''
46     for file in usr/bin/byobu-export.in usr/lib/byobu/menu; do
47       substituteInPlace $file \
48         --replace "gettext" "${gettext}/bin/gettext"
49     done
50   '';
52   postInstall = ''
53     # By some reason the po files are not being compiled
54     for po in po/*.po; do
55       lang=''${po#po/}
56       lang=''${lang%.po}
57       # Path where byobu looks for translations, as observed in the source code
58       # and strace
59       mkdir -p $out/share/byobu/po/$lang/LC_MESSAGES/
60       msgfmt --verbose $po -o $out/share/byobu/po/$lang/LC_MESSAGES/byobu.mo
61     done
63     # Override the symlinks, otherwise they mess with the wrapping
64     cp --remove-destination $out/bin/byobu $out/bin/byobu-screen
65     cp --remove-destination $out/bin/byobu $out/bin/byobu-tmux
67     for file in $out/bin/byobu*; do
68       # We don't use the usual "-wrapped" suffix because arg0 within the shebang
69       # scripts points to the filename and byobu matches against this to know
70       # which backend to start with
71       bname="$(basename $file)"
72       mv "$file" "$out/bin/.$bname"
73       makeWrapper "$out/bin/.$bname" "$out/bin/$bname" \
74         --argv0 $bname \
75         --prefix PATH ":" "$out/bin" \
76         --set BYOBU_PATH ${
77           lib.makeBinPath [
78             vim
79             bc
80           ]
81         } \
82         --set BYOBU_PYTHON "${pythonEnv}/bin/python"
83     done
84   '';
86   meta = {
87     homepage = "https://www.byobu.org/";
88     description = "Text-based window manager and terminal multiplexer";
89     longDescription = ''
90       Byobu is a text-based window manager and terminal multiplexer. It was
91       originally designed to provide elegant enhancements to the otherwise
92       functional, plain, practical GNU Screen, for the Ubuntu server
93       distribution. Byobu now includes an enhanced profiles, convenient
94       keybindings, configuration utilities, and toggle-able system status
95       notifications for both the GNU Screen window manager and the more modern
96       Tmux terminal multiplexer, and works on most Linux, BSD, and Mac
97       distributions.
98     '';
99     license = with lib.licenses; [ gpl3Plus ];
100     mainProgram = "byobu";
101     maintainers = with lib.maintainers; [ AndersonTorres ];
102     platforms = lib.platforms.unix;
103   };