2007-12-13 09:50:22 +00:00
|
|
|
# TODO tidy up eg The patchelf code is patching gvim even if you don't build it..
|
|
|
|
# but I have gvim with python support now :) - Marc
|
2014-06-28 20:34:48 +00:00
|
|
|
args@{pkgs, source ? "default", ...}: with args;
|
|
|
|
|
|
|
|
|
|
|
|
let inherit (args.composableDerivation) composableDerivation edf;
|
2014-07-09 19:45:26 +00:00
|
|
|
nixosRuntimepath = pkgs.writeText "nixos-vimrc" ''
|
2014-07-09 20:01:14 +00:00
|
|
|
set nocompatible
|
|
|
|
syntax on
|
|
|
|
|
2014-06-28 20:34:48 +00:00
|
|
|
function! NixosPluginPath()
|
|
|
|
let seen = {}
|
|
|
|
for p in reverse(split($NIX_PROFILES))
|
|
|
|
for d in split(glob(p . '/share/vim-plugins/*'))
|
|
|
|
let pluginname = substitute(d, ".*/", "", "")
|
|
|
|
if !has_key(seen, pluginname)
|
|
|
|
exec 'set runtimepath^='.d
|
|
|
|
let seen[pluginname] = 1
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
endfor
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
execute NixosPluginPath()
|
2014-07-09 19:45:26 +00:00
|
|
|
|
|
|
|
if filereadable("/etc/vimrc")
|
|
|
|
source /etc/vimrc
|
|
|
|
elseif filereadable("/etc/vim/vimrc")
|
|
|
|
source /etc/vim/vimrc
|
|
|
|
endif
|
2014-06-28 20:34:48 +00:00
|
|
|
'';
|
|
|
|
in
|
2013-06-13 08:12:12 +00:00
|
|
|
composableDerivation {
|
2015-08-20 11:21:00 +00:00
|
|
|
} (fix: rec {
|
2007-12-12 07:20:41 +00:00
|
|
|
|
2015-08-20 11:21:00 +00:00
|
|
|
name = "vim_configurable-${version}";
|
|
|
|
version = "7.4.826";
|
2007-12-12 07:20:41 +00:00
|
|
|
|
2013-05-27 16:29:35 +00:00
|
|
|
enableParallelBuilding = true; # test this
|
|
|
|
|
2014-07-09 19:55:17 +00:00
|
|
|
src =
|
2013-05-27 16:29:35 +00:00
|
|
|
builtins.getAttr source {
|
|
|
|
"default" =
|
|
|
|
# latest release
|
2013-12-29 15:38:43 +00:00
|
|
|
args.fetchhg {
|
2014-11-14 22:15:30 +00:00
|
|
|
url = "http://vim.googlecode.com/hg/";
|
2015-08-20 11:21:00 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "01m67lvnkz0ad28ifj964zcg63y5hixplbnzas5xarj8vl3pc5a0";
|
2013-12-29 15:38:43 +00:00
|
|
|
};
|
|
|
|
|
2013-05-27 16:29:35 +00:00
|
|
|
"vim-nox" =
|
|
|
|
{
|
|
|
|
# vim nox branch: client-server without X by uing sockets
|
|
|
|
# REGION AUTO UPDATE: { name="vim-nox"; type="hg"; url="https://code.google.com/r/yukihironakadaira-vim-cmdsrv-nox/"; branch="cmdsrv-nox"; }
|
|
|
|
src = (fetchurl { url = "http://mawercer.de/~nix/repos/vim-nox-hg-2082fc3.tar.bz2"; sha256 = "293164ca1df752b7f975fd3b44766f5a1db752de6c7385753f083499651bd13a"; });
|
|
|
|
name = "vim-nox-hg-2082fc3";
|
|
|
|
# END
|
|
|
|
}.src;
|
2013-08-13 15:52:07 +00:00
|
|
|
};
|
2007-12-12 07:20:41 +00:00
|
|
|
|
2014-06-01 22:33:58 +00:00
|
|
|
prePatch = "cd src";
|
|
|
|
|
2013-06-19 02:05:42 +00:00
|
|
|
# if darwin support is enabled, we want to make sure we're not building with
|
|
|
|
# OS-installed python framework
|
2014-07-09 19:55:17 +00:00
|
|
|
patches = stdenv.lib.optionals
|
2014-06-01 22:33:58 +00:00
|
|
|
(stdenv.isDarwin && (config.vim.darwin or true))
|
|
|
|
[ ./python_framework.patch ];
|
2013-06-19 02:05:42 +00:00
|
|
|
|
2013-06-15 10:48:20 +00:00
|
|
|
configureFlags
|
|
|
|
= [ "--enable-gui=${args.gui}" "--with-features=${args.features}" ];
|
2007-12-12 07:20:41 +00:00
|
|
|
|
2013-06-13 08:12:12 +00:00
|
|
|
nativeBuildInputs
|
|
|
|
= [ ncurses pkgconfig gtk libX11 libXext libSM libXpm libXt libXaw libXau
|
|
|
|
libXmu glib libICE ];
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
# most interpreters aren't tested yet.. (see python for example how to do it)
|
2009-03-07 00:27:13 +00:00
|
|
|
flags = {
|
|
|
|
ftNix = {
|
2013-09-04 01:32:06 +00:00
|
|
|
# because we cd to src in the main patch phase, we can't just add this
|
|
|
|
# patch to the list, we have to apply it manually
|
|
|
|
postPatch = ''
|
|
|
|
cd ../runtime
|
|
|
|
patch -p2 < ${./ft-nix-support.patch}
|
|
|
|
cd ..
|
|
|
|
'';
|
2009-03-07 00:27:13 +00:00
|
|
|
};
|
|
|
|
}
|
2009-03-06 23:21:28 +00:00
|
|
|
// edf { name = "darwin"; } #Disable Darwin (Mac OS X) support.
|
|
|
|
// edf { name = "xsmp"; } #Disable XSMP session management
|
|
|
|
// edf { name = "xsmp_interact"; } #Disable XSMP interaction
|
2015-03-18 22:50:37 +00:00
|
|
|
// edf { name = "mzscheme"; feat = "mzschemeinterp";} #Include MzScheme interpreter.
|
2012-12-28 18:20:09 +00:00
|
|
|
// edf { name = "perl"; feat = "perlinterp"; enable = { nativeBuildInputs = [perl]; };} #Include Perl interpreter.
|
2013-06-19 02:05:42 +00:00
|
|
|
|
|
|
|
// edf {
|
|
|
|
name = "python";
|
|
|
|
feat = "pythoninterp";
|
|
|
|
enable = {
|
|
|
|
nativeBuildInputs = [ python ];
|
|
|
|
} // lib.optionalAttrs stdenv.isDarwin {
|
|
|
|
configureFlags
|
|
|
|
= [ "--enable-pythoninterp=yes"
|
|
|
|
"--with-python-config-dir=${python}/lib" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-03-17 21:30:47 +00:00
|
|
|
// edf {
|
|
|
|
name = "python3";
|
|
|
|
feat = "python3interp";
|
|
|
|
enable = {
|
|
|
|
nativeBuildInputs = [ pkgs.python3 ];
|
|
|
|
} // lib.optionalAttrs stdenv.isDarwin {
|
|
|
|
configureFlags
|
|
|
|
= [ "--enable-python3interp=yes"
|
|
|
|
"--with-python3-config-dir=${pkgs.python3}/lib"
|
|
|
|
"--disable-pythoninterp" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-03-18 22:50:37 +00:00
|
|
|
// edf { name = "tcl"; feat = "tclinterp"; enable = { nativeBuildInputs = [tcl]; }; } #Include Tcl interpreter.
|
2012-12-28 18:20:09 +00:00
|
|
|
// edf { name = "ruby"; feat = "rubyinterp"; enable = { nativeBuildInputs = [ruby]; };} #Include Ruby interpreter.
|
2013-12-29 01:27:56 +00:00
|
|
|
// edf {
|
|
|
|
name = "lua";
|
|
|
|
feat = "luainterp";
|
|
|
|
enable = {
|
|
|
|
nativeBuildInputs = [lua];
|
|
|
|
configureFlags = [
|
|
|
|
"--with-lua-prefix=${args.lua}"
|
|
|
|
"--enable-luainterp"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
2009-03-06 23:21:28 +00:00
|
|
|
// edf { name = "cscope"; } #Include cscope interface.
|
|
|
|
// edf { name = "workshop"; } #Include Sun Visual Workshop support.
|
|
|
|
// edf { name = "netbeans"; } #Disable NetBeans integration support.
|
2010-08-03 10:59:57 +00:00
|
|
|
// edf { name = "sniff"; feat = "sniff" ; } #Include Sniff interface.
|
2009-03-06 23:21:28 +00:00
|
|
|
// edf { name = "multibyte"; } #Include multibyte editing support.
|
2010-08-03 10:59:57 +00:00
|
|
|
// edf { name = "hangulinput"; feat = "hangulinput" ;} #Include Hangul input support.
|
|
|
|
// edf { name = "xim"; } #Include XIM input support.
|
2009-03-06 23:21:28 +00:00
|
|
|
// edf { name = "fontset"; } #Include X fontset output support.
|
|
|
|
// edf { name = "acl"; } #Don't check for ACL support.
|
|
|
|
// edf { name = "gpm"; } #Don't use gpm (Linux mouse daemon).
|
2012-12-28 18:20:09 +00:00
|
|
|
// edf { name = "nls"; enable = {nativeBuildInputs = [gettext];}; } #Don't support NLS (gettext()).
|
2009-03-06 23:21:28 +00:00
|
|
|
;
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
cfg = {
|
2013-12-29 01:27:56 +00:00
|
|
|
luaSupport = config.vim.lua or true;
|
2012-09-19 17:56:56 +00:00
|
|
|
pythonSupport = config.vim.python or true;
|
2015-03-17 21:30:47 +00:00
|
|
|
python3Support = config.vim.python3 or false;
|
2013-06-15 10:48:20 +00:00
|
|
|
rubySupport = config.vim.ruby or true;
|
2012-09-19 17:56:56 +00:00
|
|
|
nlsSupport = config.vim.nls or false;
|
|
|
|
tclSupport = config.vim.tcl or false;
|
|
|
|
multibyteSupport = config.vim.multibyte or false;
|
2014-11-13 16:02:14 +00:00
|
|
|
cscopeSupport = config.vim.cscope or true;
|
2013-06-13 08:12:12 +00:00
|
|
|
netbeansSupport = config.netbeans or true; # eg envim is using it
|
|
|
|
|
|
|
|
# by default, compile with darwin support if we're compiling on darwin, but
|
|
|
|
# allow this to be disabled by setting config.vim.darwin to false
|
|
|
|
darwinSupport = stdenv.isDarwin && (config.vim.darwin or true);
|
|
|
|
|
2010-10-03 09:18:14 +00:00
|
|
|
# add .nix filetype detection and minimal syntax highlighting support
|
2012-09-19 17:56:56 +00:00
|
|
|
ftNixSupport = config.vim.ftNix or true;
|
2009-03-06 23:21:28 +00:00
|
|
|
};
|
2007-12-12 07:20:41 +00:00
|
|
|
|
2009-03-06 23:21:28 +00:00
|
|
|
#--enable-gui=OPTS X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon
|
|
|
|
/*
|
|
|
|
// edf "gtk_check" "gtk_check" { } #If auto-select GUI, check for GTK default=yes
|
|
|
|
// edf "gtk2_check" "gtk2_check" { } #If GTK GUI, check for GTK+ 2 default=yes
|
|
|
|
// edf "gnome_check" "gnome_check" { } #If GTK GUI, check for GNOME default=no
|
|
|
|
// edf "motif_check" "motif_check" { } #If auto-select GUI, check for Motif default=yes
|
|
|
|
// edf "athena_check" "athena_check" { } #If auto-select GUI, check for Athena default=yes
|
|
|
|
// edf "nextaw_check" "nextaw_check" { } #If auto-select GUI, check for neXtaw default=yes
|
|
|
|
// edf "carbon_check" "carbon_check" { } #If auto-select GUI, check for Carbon default=yes
|
|
|
|
// edf "gtktest" "gtktest" { } #Do not try to compile and run a test GTK program
|
|
|
|
*/
|
2008-12-20 01:20:35 +00:00
|
|
|
|
2013-06-19 02:05:42 +00:00
|
|
|
postInstall = stdenv.lib.optionalString stdenv.isLinux ''
|
2013-06-13 08:12:12 +00:00
|
|
|
rpath=`patchelf --print-rpath $out/bin/vim`;
|
|
|
|
for i in $nativeBuildInputs; do
|
|
|
|
echo adding $i/lib
|
|
|
|
rpath=$rpath:$i/lib
|
2009-03-06 23:21:28 +00:00
|
|
|
done
|
2013-06-13 08:12:12 +00:00
|
|
|
echo $nativeBuildInputs
|
|
|
|
echo $rpath
|
|
|
|
patchelf --set-rpath $rpath $out/bin/{vim,gvim}
|
2014-06-28 20:34:48 +00:00
|
|
|
|
|
|
|
ln -sfn ${nixosRuntimepath} $out/share/vim/vimrc
|
2013-06-19 02:05:42 +00:00
|
|
|
'';
|
2013-06-13 08:12:12 +00:00
|
|
|
|
|
|
|
dontStrip = 1;
|
2007-12-12 07:20:41 +00:00
|
|
|
|
2013-09-04 01:32:06 +00:00
|
|
|
meta = with stdenv.lib; {
|
2009-03-06 23:21:28 +00:00
|
|
|
description = "The most popular clone of the VI editor";
|
2013-09-04 01:32:06 +00:00
|
|
|
homepage = http://www.vim.org;
|
2015-05-28 17:20:29 +00:00
|
|
|
license = licenses.vim;
|
2013-09-04 01:32:06 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2007-12-13 09:50:22 +00:00
|
|
|
};
|
2013-05-27 16:29:35 +00:00
|
|
|
})
|
|
|
|
|