diff --git a/pkgs/applications/editors/vim/builder.sh b/pkgs/applications/editors/vim/builder.sh deleted file mode 100644 index a30b191c93e..00000000000 --- a/pkgs/applications/editors/vim/builder.sh +++ /dev/null @@ -1,9 +0,0 @@ -source $stdenv/setup - -postInstall=postInstall - -postInstall() { - ln -s $out/bin/vim $out/bin/vi -} - -genericBuild diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index 42560d497d3..71d89f44888 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -1,16 +1,35 @@ -{stdenv, fetchurl, ncurses}: +args: +args.stdenv.mkDerivation { + name = "vim-7.1" + + (if ((args ? hugeFeatures) + && args.hugeFeatures) then + "-huge" else "") + + (if ((args ? libX11)&&(args.libX11 != null)) + then "-X11" else "") + ; -stdenv.mkDerivation { - name = "vim-7.1"; - - builder = ./builder.sh; - src = fetchurl { + src = args.fetchurl { url = ftp://ftp.nluug.nl/pub/editors/vim/unix/vim-7.1.tar.bz2; sha256 = "0w6gy49gdbw7hby5rjkjpa7cdvc0z5iajsm4j1h8108rvfam22kz"; }; - inherit ncurses; - buildInputs = [ncurses]; + inherit (args) ncurses; + + buildInputs =(with ({libX11=null; libXext=null; + libSM=null; libXpm=null; libXt=null; + libXaw=null; libXau=null; glib=null; + gtk=null; pkgconfig=null; + } // args); [ncurses] ++ + (args.lib.filter (x: x != null) + [libX11 libXext libSM libXpm libXt + libXaw libXau glib gtk pkgconfig])); + + postInstall = "ln -s $out/bin/vim $out/bin/vi"; + preBuild="touch src/auto/link.sed"; + configureFlags=" --enable-gui=auto --disable-xim "+ + (if ((args ? hugeFeatures) && args.hugeFeatures) then + "--with-features=huge --enable-cscope --enable-multibyte --enable-xsmp " + else ""); meta = { description = "The most popular clone of the VI editor"; diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index 720ffcf9b37..3b4124fbc27 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -124,5 +124,6 @@ rec { then [] else [first] ++ range (builtins.add first 1) last; + #Return [arg] or [] for null arg } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4452293c47f..e0838487af3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3330,7 +3330,7 @@ rec { }; vim = import ../applications/editors/vim { - inherit fetchurl stdenv ncurses; + inherit fetchurl stdenv ncurses lib; }; vimDiet = lowPrio (appendToName "diet" (import ../applications/editors/vim-diet { @@ -3339,6 +3339,14 @@ rec { stdenv = useDietLibC stdenv; })); + vimHugeX = import ../applications/editors/vim { + inherit fetchurl stdenv lib ncurses pkgconfig; + inherit (xlibs) libX11 libXext libSM libXpm + libXt libXaw libXau; + inherit (gtkLibs) glib gtk; + hugeFeatures = true; + }; + vlc = import ../applications/video/vlc { inherit fetchurl stdenv perl x11 wxGTK zlib mpeg2dec a52dec libmad ffmpeg