about summary refs log tree commit diff
path: root/pkgs/applications/editors/vim/default.nix
blob: 5a524d6dabefa58e47d0dcd9a0342721ac8e0021 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
args:
let 
	defList = [];
	#stdenv and fetchurl are added automatically
	getVal = (args.lib.getValue args defList);
	check = args.lib.checkFlag args;
	reqsList = [
	["gtkGUI" "glib" "gtk" "pkgconfig" "libXpm" "libXext" "x11Support"]
	["athenaGUI" "libXau" "libXt" "libXaw" "libXpm" "libXext" "x11Support"]
	["x11Support" "libX11"]
	["hugeFeatures"]
	["pythonSupport" "python"]
	["perlSupport" "perl"]
	["tclSupport" "tcl"]
	["true" "ncurses"]
	["false" "libSM"]
	];
	nameSuffixes = [
	"hugeFeatures" "-huge"
	"x11Support" "-X11"
	"pythonSupport" "-python"
	"perlSupport" "-perl"
	"tclSupport" "-tcl"
	"ximSupport" "-xim"
	];
	configFlags = [
	"true" " "
	"x11Support" " --enable-gui=auto "
	"hugeFeatures" "--with-features=huge --enable-cscope --enable-multibyte --enable-xsmp "
	"pythonSupport" " --enable-pythoninterp "
	"perlSupport" " --enable-perlinterp "
	"tclSupport" " --enable-tclinterp "
	"ximSupport" " --enable-xim "
	];
	buildInputsNames = args.lib.filter (x: (null!=getVal x)) 
		(args.lib.uniqList {inputList = 
		(args.lib.concatLists (map 
		(x:(if (x==[]) then [] else builtins.tail x)) 
		reqsList));});
in
	assert args.lib.checkReqs args defList reqsList;
args.stdenv.mkDerivation {
  name = args.lib.condConcat "vim-7.1" nameSuffixes check;
 
  src = args.fetchurl {
    url = ftp://ftp.nluug.nl/pub/editors/vim/unix/vim-7.1.tar.bz2;
    sha256 = "0w6gy49gdbw7hby5rjkjpa7cdvc0z5iajsm4j1h8108rvfam22kz";
  };
 
  inherit (args) ncurses;

  buildInputs = args.lib.filter (x: (x!=null)) (map getVal buildInputsNames);

  postInstall = "ln -s $out/bin/vim $out/bin/vi";
  preBuild="touch src/auto/link.sed";
  configureFlags = args.lib.condConcat "" configFlags check;

  meta = {
    description = "The most popular clone of the VI editor";
  };
}