2007-12-13 10:50:22 +01: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
|
2016-11-07 15:10:32 +01:00
|
|
|
args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext
|
|
|
|
, composableDerivation, writeText, lib, config, glib, gtk2, python, perl, tcl, ruby
|
2015-09-15 06:27:19 +02:00
|
|
|
, libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
|
2015-10-20 01:46:23 +02:00
|
|
|
, libICE
|
|
|
|
|
|
|
|
# apple frameworks
|
|
|
|
, CoreServices, CoreData, Cocoa, Foundation, libobjc, cf-private
|
|
|
|
|
|
|
|
, ... }: with args;
|
2014-06-28 22:34:48 +02:00
|
|
|
|
|
|
|
|
2016-11-07 15:10:32 +01:00
|
|
|
let
|
|
|
|
inherit (args.composableDerivation) composableDerivation edf;
|
|
|
|
nixosRuntimepath = writeText "nixos-vimrc" ''
|
2014-07-09 22:01:14 +02:00
|
|
|
set nocompatible
|
|
|
|
syntax on
|
|
|
|
|
2014-06-28 22:34:48 +02: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 21:45:26 +02:00
|
|
|
|
|
|
|
if filereadable("/etc/vimrc")
|
|
|
|
source /etc/vimrc
|
|
|
|
elseif filereadable("/etc/vim/vimrc")
|
|
|
|
source /etc/vim/vimrc
|
|
|
|
endif
|
2014-06-28 22:34:48 +02:00
|
|
|
'';
|
2016-11-07 15:10:32 +01:00
|
|
|
|
|
|
|
common = callPackage ./common.nix {};
|
2014-06-28 22:34:48 +02:00
|
|
|
in
|
2013-06-13 10:12:12 +02:00
|
|
|
composableDerivation {
|
2015-08-20 13:21:00 +02:00
|
|
|
} (fix: rec {
|
2007-12-12 08:20:41 +01:00
|
|
|
|
2015-08-20 13:21:00 +02:00
|
|
|
name = "vim_configurable-${version}";
|
2016-11-07 15:10:32 +01:00
|
|
|
|
2016-11-07 16:29:20 +01:00
|
|
|
inherit (common) version postPatch hardeningDisable enableParallelBuilding meta;
|
2016-11-07 15:10:32 +01:00
|
|
|
|
|
|
|
src = builtins.getAttr source {
|
|
|
|
"default" = common.src; # latest release
|
2013-12-29 16:38:43 +01:00
|
|
|
|
2013-05-27 18:29:35 +02: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 17:52:07 +02:00
|
|
|
};
|
2007-12-12 08:20:41 +01:00
|
|
|
|
2016-11-07 15:45:48 +01:00
|
|
|
patches = [ ./cflags-prune.diff ];
|
2014-06-02 00:33:58 +02:00
|
|
|
|
2013-06-15 12:48:20 +02:00
|
|
|
configureFlags
|
|
|
|
= [ "--enable-gui=${args.gui}" "--with-features=${args.features}" ];
|
2007-12-12 08:20:41 +01:00
|
|
|
|
2016-11-07 15:45:48 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs
|
|
|
|
= [ ncurses gtk2 libX11 libXext libSM libXpm libXt libXaw libXau
|
2013-06-13 10:12:12 +02:00
|
|
|
libXmu glib libICE ];
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
# most interpreters aren't tested yet.. (see python for example how to do it)
|
2009-03-07 01:27:13 +01:00
|
|
|
flags = {
|
|
|
|
ftNix = {
|
2016-11-07 15:45:48 +01:00
|
|
|
patches = [ ./ft-nix-support.patch ];
|
2009-03-07 01:27:13 +01:00
|
|
|
};
|
|
|
|
}
|
2015-10-20 01:46:23 +02:00
|
|
|
// edf {
|
|
|
|
name = "darwin";
|
|
|
|
enable = {
|
2016-11-07 15:45:48 +01:00
|
|
|
buildInputs = [ CoreServices CoreData Cocoa Foundation libobjc cf-private ];
|
2015-10-20 01:46:23 +02:00
|
|
|
NIX_LDFLAGS = stdenv.lib.optional stdenv.isDarwin
|
|
|
|
"/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation";
|
|
|
|
};
|
|
|
|
} #Disable Darwin (Mac OS X) support.
|
2009-03-07 00:21:28 +01:00
|
|
|
// edf { name = "xsmp"; } #Disable XSMP session management
|
|
|
|
// edf { name = "xsmp_interact"; } #Disable XSMP interaction
|
2015-03-18 23:50:37 +01:00
|
|
|
// edf { name = "mzscheme"; feat = "mzschemeinterp";} #Include MzScheme interpreter.
|
2012-12-28 19:20:09 +01:00
|
|
|
// edf { name = "perl"; feat = "perlinterp"; enable = { nativeBuildInputs = [perl]; };} #Include Perl interpreter.
|
2013-06-19 04:05:42 +02:00
|
|
|
|
|
|
|
// edf {
|
|
|
|
name = "python";
|
2016-01-06 20:52:42 +01:00
|
|
|
feat = "python${if python ? isPy3 then "3" else ""}interp";
|
2013-06-19 04:05:42 +02:00
|
|
|
enable = {
|
2016-11-07 15:45:48 +01:00
|
|
|
buildInputs = [ python ];
|
2013-06-19 04:05:42 +02:00
|
|
|
} // lib.optionalAttrs stdenv.isDarwin {
|
|
|
|
configureFlags
|
2016-01-06 20:52:42 +01:00
|
|
|
= [ "--enable-python${if python ? isPy3 then "3" else ""}interp=yes"
|
|
|
|
"--with-python${if python ? isPy3 then "3" else ""}-config-dir=${python}/lib"
|
|
|
|
"--disable-python${if python ? isPy3 then "" else "3"}interp" ];
|
2015-03-17 22:30:47 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-11-07 15:45:48 +01:00
|
|
|
// edf { name = "tcl"; feat = "tclinterp"; enable = { buildInputs = [tcl]; }; } #Include Tcl interpreter.
|
|
|
|
// edf { name = "ruby"; feat = "rubyinterp"; enable = { buildInputs = [ruby]; };} #Include Ruby interpreter.
|
2013-12-29 02:27:56 +01:00
|
|
|
// edf {
|
|
|
|
name = "lua";
|
|
|
|
feat = "luainterp";
|
|
|
|
enable = {
|
2016-11-07 15:45:48 +01:00
|
|
|
buildInputs = [lua];
|
2013-12-29 02:27:56 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-lua-prefix=${args.lua}"
|
|
|
|
"--enable-luainterp"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
2009-03-07 00:21:28 +01: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 12:59:57 +02:00
|
|
|
// edf { name = "sniff"; feat = "sniff" ; } #Include Sniff interface.
|
2009-03-07 00:21:28 +01:00
|
|
|
// edf { name = "multibyte"; } #Include multibyte editing support.
|
2010-08-03 12:59:57 +02:00
|
|
|
// edf { name = "hangulinput"; feat = "hangulinput" ;} #Include Hangul input support.
|
|
|
|
// edf { name = "xim"; } #Include XIM input support.
|
2009-03-07 00:21:28 +01: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 19:20:09 +01:00
|
|
|
// edf { name = "nls"; enable = {nativeBuildInputs = [gettext];}; } #Don't support NLS (gettext()).
|
2009-03-07 00:21:28 +01:00
|
|
|
;
|
2008-12-20 02:20:35 +01:00
|
|
|
|
2009-03-07 00:21:28 +01:00
|
|
|
cfg = {
|
2013-12-29 02:27:56 +01:00
|
|
|
luaSupport = config.vim.lua or true;
|
2012-09-19 19:56:56 +02:00
|
|
|
pythonSupport = config.vim.python or true;
|
2013-06-15 12:48:20 +02:00
|
|
|
rubySupport = config.vim.ruby or true;
|
2012-09-19 19:56:56 +02:00
|
|
|
nlsSupport = config.vim.nls or false;
|
|
|
|
tclSupport = config.vim.tcl or false;
|
|
|
|
multibyteSupport = config.vim.multibyte or false;
|
2014-11-13 17:02:14 +01:00
|
|
|
cscopeSupport = config.vim.cscope or true;
|
2013-06-13 10:12:12 +02:00
|
|
|
netbeansSupport = config.netbeans or true; # eg envim is using it
|
2016-02-02 16:14:26 +01:00
|
|
|
ximSupport = config.vim.xim or false;
|
2013-06-13 10:12:12 +02:00
|
|
|
|
|
|
|
# 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 11:18:14 +02:00
|
|
|
# add .nix filetype detection and minimal syntax highlighting support
|
2012-09-19 19:56:56 +02:00
|
|
|
ftNixSupport = config.vim.ftNix or true;
|
2009-03-07 00:21:28 +01:00
|
|
|
};
|
2007-12-12 08:20:41 +01:00
|
|
|
|
2009-03-07 00:21:28 +01: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 02:20:35 +01:00
|
|
|
|
2013-06-19 04:05:42 +02:00
|
|
|
postInstall = stdenv.lib.optionalString stdenv.isLinux ''
|
2016-11-07 15:45:48 +01:00
|
|
|
patchelf --set-rpath \
|
|
|
|
"$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \
|
|
|
|
"$out"/bin/{vim,gvim}
|
|
|
|
|
|
|
|
ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc
|
2013-06-19 04:05:42 +02:00
|
|
|
'';
|
2013-06-13 10:12:12 +02:00
|
|
|
|
|
|
|
dontStrip = 1;
|
2013-05-27 18:29:35 +02:00
|
|
|
})
|
|
|
|
|