Merge pull request #23256 from edanaher/ensime

Ensime
This commit is contained in:
Michael Raskin 2017-03-18 18:24:19 +01:00 committed by GitHub
commit 846b6d250a
4 changed files with 61 additions and 8 deletions

View File

@ -53,18 +53,24 @@ let
rubyWrapper = ''--suffix PATH : \"${rubyEnv}/bin\" '' +
''--suffix GEM_HOME : \"${rubyEnv}/${rubyEnv.ruby.gemPath}\" '';
pluginPythonPackages = builtins.concatLists
(map ({ pythonDependencies ? [], ...}: pythonDependencies)
(vimUtils.requiredPlugins configure));
pythonEnv = pythonPackages.python.buildEnv.override {
extraLibs = (
if withPyGUI
then [ pythonPackages.neovim_gui ]
else [ pythonPackages.neovim ]
) ++ extraPythonPackages;
) ++ extraPythonPackages ++ pluginPythonPackages;
ignoreCollisions = true;
};
pythonWrapper = ''--cmd \"let g:python_host_prog='$out/bin/nvim-python'\" '';
pluginPython3Packages = builtins.concatLists
(map ({ python3Dependencies ? [], ...}: python3Dependencies)
(vimUtils.requiredPlugins configure));
python3Env = python3Packages.python.buildEnv.override {
extraLibs = [ python3Packages.neovim ] ++ extraPython3Packages;
extraLibs = [ python3Packages.neovim ] ++ extraPython3Packages ++ pluginPython3Packages;
ignoreCollisions = true;
};
python3Wrapper = ''--cmd \"let g:python3_host_prog='$out/bin/nvim-python3'\" '';

View File

@ -4,6 +4,7 @@
, xkb_switch, rustracerd, fzf
, python3, boost, icu
, ycmd
, pythonPackages, python3Packages
, Cocoa ? null
}:
@ -344,6 +345,18 @@ rec {
};
ensime-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
name = "ensime-vim-2017-02-06";
src = fetchgit {
url = "git://github.com/ensime/ensime-vim";
rev = "7b5f79c67a078c6e1e5f8c906d4227ce86d33df8";
sha256 = "04knizaa4gc1z22gxj41qybjl4ysqpv15rwi28h10l7gk9fb1b41";
};
dependencies = ["vimproc" "vimshell" "self" "forms"];
pythonDependencies = with pythonPackages; [ sexpdata websocket_client ];
};
extradite = buildVimPluginFrom2Nix { # created by nix#NixDerivation
name = "extradite-2015-09-22";
src = fetchgit {
@ -355,6 +368,17 @@ rec {
};
forms = buildVimPluginFrom2Nix { # created by nix#NixDerivation
name = "forms-2012-11-28";
src = fetchgit {
url = "git://github.com/megaannum/forms";
rev = "b601e03fe0a3b8a43766231f4a6217e4492b4f75";
sha256 = "19kp1i5c6jmnpbsap9giayqbzlv7vh02mp4mjvicqj9n0nfyay74";
};
dependencies = ["self"];
};
fugitive = buildVimPluginFrom2Nix { # created by nix#NixDerivation
name = "fugitive-2017-02-25";
src = fetchgit {
@ -1154,6 +1178,17 @@ rec {
'';
};
self = buildVimPluginFrom2Nix { # created by nix#NixDerivation
name = "self-2014-05-28";
src = fetchgit {
url = "git://github.com/megaannum/self";
rev = "2ed666b547eddee6ae1fcc63babca4ba0b66a59f";
sha256 = "1gcwn6i5i3msg7hrlzsnv1bs6pm4jz9cff8ppaz2xdj8xv9qy6fn";
};
dependencies = [];
};
shabadou-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
name = "shabadou-vim-2016-07-19";
src = fetchgit {

View File

@ -47,6 +47,7 @@
"github:elmcast/elm-vim"
"github:embear/vim-localvimrc"
"github:enomsg/vim-haskellConcealPlus"
"github:ensime/ensime-vim"
"github:esneider/YUNOcommit.vim"
"github:fatih/vim-go"
"github:flazz/vim-colorschemes"

View File

@ -150,6 +150,10 @@ vim_with_plugins can be installed like any other application within Nix.
let
inherit (stdenv) lib;
toNames = x:
if builtins.isString x then [x]
else (lib.optional (x ? name) x.name)
++ (x.names or []);
findDependenciesRecursively = {knownPlugins, names}:
let depsOf = name: (builtins.getAttr name knownPlugins).dependencies or [];
@ -211,11 +215,6 @@ let
(let
knownPlugins = vam.knownPlugins or vimPlugins;
toNames = x:
if builtins.isString x then [x]
else (lib.optional (x ? name) x.name)
++ (x.names or []);
names = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; };
# Vim almost reads JSON, so eventually JSON support should be added to Nix
@ -412,6 +411,19 @@ rec {
configurePhase =":";
} // a);
requiredPlugins = {
knownPlugins ? vimPlugins,
vam ? null,
pathogen ? null, ...
}:
let
pathogenNames = map (name: knownPlugins.${name}) (findDependenciesRecursively { inherit knownPlugins; names = pathogen.pluginNames; });
vamNames = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; };
names = (lib.optionals (pathogen != null) pathogenNames) ++
(lib.optionals (vam != null) vamNames);
in
map (name: knownPlugins.${name}) names;
# test cases:
test_vim_with_vim_addon_nix_using_vam = vim_configurable.customize {
name = "vim-with-vim-addon-nix-using-vam";
@ -427,5 +439,4 @@ rec {
name = "vim-with-vim-addon-nix";
vimrcConfig.packages.myVimPackage.start = with vimPlugins; [ vim-addon-nix ];
};
}