From 657e18e0119baa29ed3dbb6bfdc0c40f13bf32c1 Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Wed, 7 Nov 2018 12:23:43 -0800 Subject: [PATCH 1/2] nodePackages.neovim: init at 4.2.1 --- .../node-packages/node-packages-v8.json | 1 + .../node-packages/node-packages-v8.nix | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/pkgs/development/node-packages/node-packages-v8.json b/pkgs/development/node-packages/node-packages-v8.json index 662eb44740fe..49410016383d 100644 --- a/pkgs/development/node-packages/node-packages-v8.json +++ b/pkgs/development/node-packages/node-packages-v8.json @@ -69,6 +69,7 @@ , "meguca" , "mocha" , "multi-file-swagger" +, "neovim" , "nijs" , "node2nix" , "node-gyp" diff --git a/pkgs/development/node-packages/node-packages-v8.nix b/pkgs/development/node-packages/node-packages-v8.nix index 364f4d64f82c..a31e79dfdb63 100644 --- a/pkgs/development/node-packages/node-packages-v8.nix +++ b/pkgs/development/node-packages/node-packages-v8.nix @@ -12309,6 +12309,15 @@ let 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" = { name = "event-pubsub"; packageName = "event-pubsub"; @@ -22698,6 +22707,15 @@ let 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" = { name = "msgpack5"; packageName = "msgpack5"; @@ -50876,6 +50894,39 @@ in production = 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 { name = "nijs"; packageName = "nijs"; From da4a004193614945641c0a634855deec926b089b Mon Sep 17 00:00:00 2001 From: "Wael M. Nasreddine" Date: Wed, 7 Nov 2018 12:38:18 -0800 Subject: [PATCH 2/2] neovim wrapper: add withNodeJs to build wrapper with nodejs support --- pkgs/applications/editors/neovim/wrapper.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 568043f96687..bd4304560fd1 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -1,6 +1,8 @@ { stdenv, lib, makeWrapper , vimUtils , bundlerEnv, ruby +, nodejs +, nodePackages , pythonPackages , python3Packages }: @@ -12,6 +14,7 @@ let wrapper = { withPython ? true, extraPythonPackages ? (_: []) /* 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 , withPyGUI ? false , vimAlias ? false @@ -50,6 +53,8 @@ let ++ (extraPython3PackagesFun ps) ++ (concatMap (f: f ps) pluginPython3Packages)); + binPath = makeBinPath (optionals withRuby [rubyEnv] ++ optionals withNodeJs [nodejs]); + in stdenv.mkDerivation { name = "neovim-${stdenv.lib.getVersion neovim}"; @@ -62,10 +67,12 @@ let makeWrapper "$(readlink -v --canonicalize-existing "${bin}")" \ "$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 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"}\" " \ - ${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) ''