summary refs log tree commit diff
path: root/pkgs/applications/window-managers/vwm/default.nix
blob: e1a8c8f3dd24a58279cfb06b297448493b8664aa (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, stdenv
, fetchurl
, ncurses
, pkg-config
, glib
, libviper
, libpseudo
, gpm
, libvterm
}:

stdenv.mkDerivation rec {
  pname = "vwm";
  version = "2.1.3";

  src = fetchurl {
    url = "mirror://sourceforge/vwm/vwm-${version}.tar.gz";
    sha256 = "1r5wiqyfqwnyx7dfihixlnavbvg8rni36i4gq169aisjcg7laxaf";
  };

  postPatch = ''
    sed -i -e s@/usr/local@$out@ \
      -e s@/usr/lib@$out/lib@ \
      -e 's@tic vwmterm@tic -o '$out/lib/terminfo' vwmterm@' \
      -e /ldconfig/d Makefile modules/*/Makefile vwm.h

    # Fix ncurses-6.3 support:
    substituteInPlace vwm_bkgd.c --replace \
      'mvwprintw(window,height-1,width-(strlen(version_str)),version_str);' \
      'mvwprintw(window,height-1,width-(strlen(version_str)),"%s", version_str);'
  '';

  preInstall = ''
    mkdir -p $out/bin $out/include
  '';

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ ncurses glib libviper libpseudo gpm libvterm ];

  meta = with lib; {
    homepage = "http://vwm.sourceforge.net/";
    description = "Dynamic window manager for the console";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ ];
    platforms = platforms.linux;
  };
}