diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix index e76683aa1807..354aaf6db546 100644 --- a/pkgs/applications/editors/neovim/default.nix +++ b/pkgs/applications/editors/neovim/default.nix @@ -5,6 +5,7 @@ , withPython ? true, pythonPackages, extraPythonPackages ? [] , withPython3 ? true, python3Packages, extraPython3Packages ? [] , withJemalloc ? true, jemalloc +, withRuby ? true, bundlerEnv , withPyGUI ? false , vimAlias ? false @@ -44,6 +45,14 @@ let }; }; + rubyEnv = bundlerEnv { + name = "neovim-ruby-env"; + gemdir = ./ruby_provider; + }; + + rubyWrapper = ''--suffix PATH : \"${rubyEnv}/bin\" '' + + ''--suffix GEM_HOME : \"${rubyEnv}/${rubyEnv.ruby.gemPath}\" ''; + pythonEnv = pythonPackages.python.buildEnv.override { extraLibs = ( if withPyGUI @@ -52,11 +61,17 @@ let ) ++ extraPythonPackages; ignoreCollisions = true; }; + pythonWrapper = ''--cmd \"let g:python_host_prog='$out/bin/nvim-python'\" ''; python3Env = python3Packages.python.buildEnv.override { extraLibs = [ python3Packages.neovim ] ++ extraPython3Packages; ignoreCollisions = true; }; + python3Wrapper = ''--cmd \"let g:python3_host_prog='$out/bin/nvim-python3'\" ''; + pythonFlags = optionalString (withPython || withPython3) ''--add-flags "${ + (optionalString withPython pythonWrapper) + + (optionalString withPython3 python3Wrapper) + }"''; neovim = stdenv.mkDerivation rec { name = "neovim-${version}"; @@ -124,13 +139,8 @@ let --prefix PATH : "$out/bin" '' + optionalString withPython3 '' ln -s ${python3Env}/bin/python3 $out/bin/nvim-python3 - '' + optionalString (withPython || withPython3) '' - wrapProgram $out/bin/nvim --add-flags "${ - (optionalString withPython - ''--cmd \"let g:python_host_prog='$out/bin/nvim-python'\" '') + - (optionalString withPython3 - ''--cmd \"let g:python3_host_prog='$out/bin/nvim-python3'\" '') - }" + '' + optionalString (withPython || withPython3 || withRuby) '' + wrapProgram $out/bin/nvim ${rubyWrapper + pythonFlags} ''; meta = { diff --git a/pkgs/applications/editors/neovim/ruby_provider/Gemfile b/pkgs/applications/editors/neovim/ruby_provider/Gemfile new file mode 100644 index 000000000000..eebecf2906fb --- /dev/null +++ b/pkgs/applications/editors/neovim/ruby_provider/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'neovim' diff --git a/pkgs/applications/editors/neovim/ruby_provider/Gemfile.lock b/pkgs/applications/editors/neovim/ruby_provider/Gemfile.lock new file mode 100644 index 000000000000..88100b2e8f87 --- /dev/null +++ b/pkgs/applications/editors/neovim/ruby_provider/Gemfile.lock @@ -0,0 +1,15 @@ +GEM + remote: https://rubygems.org/ + specs: + msgpack (1.0.2) + neovim (0.3.1) + msgpack (~> 1.0) + +PLATFORMS + ruby + +DEPENDENCIES + neovim + +BUNDLED WITH + 1.12.5 diff --git a/pkgs/applications/editors/neovim/ruby_provider/gemset.nix b/pkgs/applications/editors/neovim/ruby_provider/gemset.nix new file mode 100644 index 000000000000..c3ed45a78481 --- /dev/null +++ b/pkgs/applications/editors/neovim/ruby_provider/gemset.nix @@ -0,0 +1,19 @@ +{ + msgpack = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1fb2my91j08plsbbry5kilsrh7slmzgbbf6f55zy6xk28p9036lg"; + type = "gem"; + }; + version = "1.0.2"; + }; + neovim = { + dependencies = ["msgpack"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "018mk4vqaxzbk4anq558h2rgj8prbn2rmi777iwrg3n0v8k5nxqw"; + type = "gem"; + }; + version = "0.3.1"; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3dcf58e606c3..715249f036be 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -29597,12 +29597,12 @@ EOF }; neovim = buildPythonPackage rec { - version = "0.1.10"; + version = "0.1.12"; name = "neovim-${version}"; src = pkgs.fetchurl { url = "mirror://pypi/n/neovim/${name}.tar.gz"; - sha256 = "1n6xxh0n250qbvrdl0cw114d890nfv6d0wjk5wpr505sg2bg9jx4"; + sha256 = "1pll4jjqdq54d867hgqnnpiiz4pz4bbjrnh6binbp7djcbgrb8zq"; }; buildInputs = with self; [ nose ];