summary refs log tree commit diff
path: root/pkgs/tools/misc/dvtm/dvtm.nix
blob: 5bb8efb5540c6e668bb5127fef5e285263499d81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ stdenv, ncurses, customConfig ? null, name, src, patches ? [] }:
stdenv.mkDerivation {

  inherit name src patches;

  CFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-D_DARWIN_C_SOURCE";

  postPatch = stdenv.lib.optionalString (customConfig != null) ''
    cp ${builtins.toFile "config.h" customConfig} ./config.h
  '';

  nativeBuildInputs = [ ncurses ];
  buildInputs = [ ncurses ];

  prePatch = ''
    substituteInPlace Makefile \
      --replace /usr/share/terminfo $out/share/terminfo
  '';

  makeFlags = [ "PREFIX=$(out)" ];

  meta = with stdenv.lib; {
    description = "Dynamic virtual terminal manager";
    homepage = "http://www.brain-dump.org/projects/dvtm";
    license = licenses.mit;
    maintainers = [ maintainers.vrthra ];
    platforms = platforms.unix;
  };
}