1{
2 lib,
3 stdenv,
4 ncurses,
5 customConfig ? null,
6 pname,
7 version,
8 src,
9 patches ? [ ],
10}:
11stdenv.mkDerivation {
12
13 inherit
14 pname
15 version
16 src
17 patches
18 ;
19
20 CFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-D_DARWIN_C_SOURCE";
21
22 postPatch = lib.optionalString (customConfig != null) ''
23 cp ${builtins.toFile "config.h" customConfig} ./config.h
24 '';
25
26 nativeBuildInputs = [ ncurses ];
27 buildInputs = [ ncurses ];
28
29 prePatch = ''
30 substituteInPlace Makefile \
31 --replace /usr/share/terminfo $out/share/terminfo
32 '';
33
34 makeFlags = [ "PREFIX=$(out)" ];
35
36 meta = with lib; {
37 description = "Dynamic virtual terminal manager";
38 homepage = "http://www.brain-dump.org/projects/dvtm";
39 license = licenses.mit;
40 maintainers = [ ];
41 platforms = platforms.unix;
42 };
43}