Merge pull request #49884 from kalbasit/nixpkgs_neovim-build-with-nodejs

neovim wrapper: build with nodejs support
This commit is contained in:
Jörg Thalheim 2018-11-15 09:55:35 +00:00 committed by GitHub
commit 1ed494367a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 1 deletions

View File

@ -1,6 +1,8 @@
{ stdenv, lib, makeWrapper { stdenv, lib, makeWrapper
, vimUtils , vimUtils
, bundlerEnv, ruby , bundlerEnv, ruby
, nodejs
, nodePackages
, pythonPackages , pythonPackages
, python3Packages , python3Packages
}: }:
@ -12,6 +14,7 @@ let
wrapper = { wrapper = {
withPython ? true, extraPythonPackages ? (_: []) /* the function you would have passed to python.withPackages */ withPython ? true, extraPythonPackages ? (_: []) /* the function you would have passed to python.withPackages */
, withPython3 ? true, extraPython3Packages ? (_: []) /* the function you would have passed to python.withPackages */ , withPython3 ? true, extraPython3Packages ? (_: []) /* the function you would have passed to python.withPackages */
, withNodeJs? false
, withRuby ? true , withRuby ? true
, withPyGUI ? false , withPyGUI ? false
, vimAlias ? false , vimAlias ? false
@ -50,6 +53,8 @@ let
++ (extraPython3PackagesFun ps) ++ (extraPython3PackagesFun ps)
++ (concatMap (f: f ps) pluginPython3Packages)); ++ (concatMap (f: f ps) pluginPython3Packages));
binPath = makeBinPath (optionals withRuby [rubyEnv] ++ optionals withNodeJs [nodejs]);
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "neovim-${stdenv.lib.getVersion neovim}"; name = "neovim-${stdenv.lib.getVersion neovim}";
@ -62,10 +67,12 @@ let
makeWrapper "$(readlink -v --canonicalize-existing "${bin}")" \ makeWrapper "$(readlink -v --canonicalize-existing "${bin}")" \
"$out/bin/nvim" --add-flags " \ "$out/bin/nvim" --add-flags " \
--cmd \"${if withNodeJs then "let g:node_host_prog='${nodePackages.neovim}/bin/neovim-node-host'" else "let g:loaded_node_provider=1"}\" \
--cmd \"${if withPython then "let g:python_host_prog='$out/bin/nvim-python'" else "let g:loaded_python_provider = 1"}\" \ --cmd \"${if withPython then "let g:python_host_prog='$out/bin/nvim-python'" else "let g:loaded_python_provider = 1"}\" \
--cmd \"${if withPython3 then "let g:python3_host_prog='$out/bin/nvim-python3'" else "let g:loaded_python3_provider = 1"}\" \ --cmd \"${if withPython3 then "let g:python3_host_prog='$out/bin/nvim-python3'" else "let g:loaded_python3_provider = 1"}\" \
--cmd \"${if withRuby then "let g:ruby_host_prog='$out/bin/nvim-ruby'" else "let g:loaded_ruby_provider=1"}\" " \ --cmd \"${if withRuby then "let g:ruby_host_prog='$out/bin/nvim-ruby'" else "let g:loaded_ruby_provider=1"}\" " \
${optionalString withRuby '' --suffix PATH : ${rubyEnv}/bin --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' } --suffix PATH : ${binPath} \
${optionalString withRuby '' --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' }
'' ''
+ optionalString (!stdenv.isDarwin) '' + optionalString (!stdenv.isDarwin) ''

View File

@ -69,6 +69,7 @@
, "meguca" , "meguca"
, "mocha" , "mocha"
, "multi-file-swagger" , "multi-file-swagger"
, "neovim"
, "nijs" , "nijs"
, "node2nix" , "node2nix"
, "node-gyp" , "node-gyp"

View File

@ -12309,6 +12309,15 @@ let
sha1 = "df8c69eef1647923c7157b9ce83840610b02cc39"; sha1 = "df8c69eef1647923c7157b9ce83840610b02cc39";
}; };
}; };
"event-lite-0.1.2" = {
name = "event-lite";
packageName = "event-lite";
version = "0.1.2";
src = fetchurl {
url = "https://registry.npmjs.org/event-lite/-/event-lite-0.1.2.tgz";
sha512 = "HnSYx1BsJ87/p6swwzv+2v6B4X+uxUteoDfRxsAb1S1BePzQqOLevVmkdA15GHJVd9A9Ok6wygUR18Hu0YeV9g==";
};
};
"event-pubsub-4.3.0" = { "event-pubsub-4.3.0" = {
name = "event-pubsub"; name = "event-pubsub";
packageName = "event-pubsub"; packageName = "event-pubsub";
@ -22698,6 +22707,15 @@ let
sha1 = "923e2c5cffa65c8418e9b228d1124793969c429c"; sha1 = "923e2c5cffa65c8418e9b228d1124793969c429c";
}; };
}; };
"msgpack-lite-0.1.26" = {
name = "msgpack-lite";
packageName = "msgpack-lite";
version = "0.1.26";
src = fetchurl {
url = "https://registry.npmjs.org/msgpack-lite/-/msgpack-lite-0.1.26.tgz";
sha1 = "dd3c50b26f059f25e7edee3644418358e2a9ad89";
};
};
"msgpack5-3.6.0" = { "msgpack5-3.6.0" = {
name = "msgpack5"; name = "msgpack5";
packageName = "msgpack5"; packageName = "msgpack5";
@ -50876,6 +50894,39 @@ in
production = true; production = true;
bypassCache = true; bypassCache = true;
}; };
neovim = nodeEnv.buildNodePackage {
name = "neovim";
packageName = "neovim";
version = "4.2.1";
src = fetchurl {
url = "https://registry.npmjs.org/neovim/-/neovim-4.2.1.tgz";
sha512 = "2Kto3HlBsFFtgyAmV8ecNtBBUrydoXp2EfIHwIvuhOIiVinCuKJaUmp1+1u5eGGu1TDZHUiHwvFv0T05eG8T+w==";
};
dependencies = [
sources."async-1.0.0"
sources."colors-1.0.3"
sources."cycle-1.0.3"
sources."event-lite-0.1.2"
sources."eyes-0.1.8"
sources."ieee754-1.1.12"
sources."int64-buffer-0.1.10"
sources."isarray-1.0.0"
sources."isstream-0.1.2"
sources."lodash-4.17.11"
sources."msgpack-lite-0.1.26"
sources."stack-trace-0.0.10"
sources."traverse-0.6.6"
sources."winston-2.4.4"
];
buildInputs = globalBuildInputs;
meta = {
description = "Neovim client API and neovim remote plugin provider";
homepage = https://github.com/neovim/node-client;
license = "MIT";
};
production = true;
bypassCache = true;
};
nijs = nodeEnv.buildNodePackage { nijs = nodeEnv.buildNodePackage {
name = "nijs"; name = "nijs";
packageName = "nijs"; packageName = "nijs";