diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix index 2e0e3a1743c5..1a8f7417d535 100644 --- a/pkgs/applications/editors/neovim/default.nix +++ b/pkgs/applications/editors/neovim/default.nix @@ -6,6 +6,7 @@ , withPython3 ? true, python3Packages, extraPython3Packages ? [] , withJemalloc ? true, jemalloc +, withPyGUI ? false , vimAlias ? false , configure ? null }: @@ -45,7 +46,11 @@ let }; pythonEnv = pythonPackages.python.buildEnv.override { - extraLibs = [ pythonPackages.neovim ] ++ extraPythonPackages; + extraLibs = ( + if withPyGUI + then [ pythonPackages.neovim_gui ] + else [ pythonPackages.neovim ] + ) ++ extraPythonPackages; ignoreCollisions = true; }; @@ -103,6 +108,8 @@ let $out/bin/nvim '' + optionalString withPython '' ln -s ${pythonEnv}/bin/python $out/bin/nvim-python + '' + optionalString withPyGUI '' + ln -s ${pythonEnv}/bin/pynvim $out/bin/pynvim '' + optionalString withPython3 '' ln -s ${python3Env}/bin/python3 $out/bin/nvim-python3 '' + optionalString (withPython || withPython3) '' diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9206d23e346b..7ca1b919e556 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -20456,6 +20456,34 @@ let }; }; + neovim_gui = buildPythonPackage rec { + name = "neovim-gui-${self.neovim.version}"; + disabled = !isPy27; + + src = self.neovim.src; + + propagatedBuildInputs = [ + self.msgpack + self.greenlet + self.trollius + self.click + self.pygobject3 + pkgs.gobjectIntrospection + pkgs.makeWrapper + pkgs.gtk3 + ]; + + patchPhase = '' + sed -i -e "s|entry_points=entry_points,|entry_points=dict(console_scripts=['pynvim=neovim.ui.cli:main [GUI]']),|" setup.py + ''; + + postInstall = '' + wrapProgram $out/bin/pynvim \ + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \ + --prefix PYTHONPATH : "${self.pygobject3}/lib/python2.7/site-packages:$PYTHONPATH" + ''; + }; + ghp-import = buildPythonPackage rec { version = "0.4.1"; name = "ghp-import-${version}";