|
1 | 1 | { stdenv, fetchFromGitHub, cmake, gettext, libmsgpack, libtermkey
|
2 | 2 | , libtool, libuv, luaPackages, ncurses, perl, pkgconfig
|
3 |
| -, unibilium, makeWrapper, vimUtils, xsel, gperf |
| 3 | +, unibilium, makeWrapper, vimUtils, xsel, gperf, callPackage |
4 | 4 |
|
5 | 5 | , withPython ? true, pythonPackages, extraPythonPackages ? []
|
6 | 6 | , withPython3 ? true, python3Packages, extraPython3Packages ? []
|
7 | 7 | , withJemalloc ? true, jemalloc
|
8 |
| -, withRuby ? true, bundlerEnv |
| 8 | +, withRuby ? true, bundlerEnv, ruby |
9 | 9 |
|
10 | 10 | , withPyGUI ? false
|
11 | 11 | , vimAlias ? false
|
|
48 | 48 | rubyEnv = bundlerEnv {
|
49 | 49 | name = "neovim-ruby-env";
|
50 | 50 | gemdir = ./ruby_provider;
|
| 51 | + postBuild = '' |
| 52 | + ln -s ${ruby}/bin/* $out/bin |
| 53 | + ''; |
51 | 54 | };
|
52 |
| - |
53 |
| - rubyWrapper = ''--suffix PATH : \"${rubyEnv}/bin\" '' + |
54 |
| - ''--suffix GEM_HOME : \"${rubyEnv}/${rubyEnv.ruby.gemPath}\" ''; |
| 55 | + rubyWrapper = ''--cmd \"let g:ruby_host_prog='$out/bin/nvim-ruby'\" ''; |
55 | 56 |
|
56 | 57 | pluginPythonPackages = if configure == null then [] else builtins.concatLists
|
57 | 58 | (map ({ pythonDependencies ? [], ...}: pythonDependencies)
|
|
74 | 75 | ignoreCollisions = true;
|
75 | 76 | };
|
76 | 77 | python3Wrapper = ''--cmd \"let g:python3_host_prog='$out/bin/nvim-python3'\" '';
|
77 |
| - pythonFlags = optionalString (withPython || withPython3) ''--add-flags "${ |
78 |
| - (optionalString withPython pythonWrapper) + |
79 |
| - (optionalString withPython3 python3Wrapper) |
80 |
| - }"''; |
| 78 | + |
| 79 | + additionalFlags = |
| 80 | + optionalString (withPython || withPython3 || withRuby) |
| 81 | + ''--add-flags "${(optionalString withPython pythonWrapper) + |
| 82 | + (optionalString withPython3 python3Wrapper) + |
| 83 | + (optionalString withRuby rubyWrapper)}" --unset PYTHONPATH '' + |
| 84 | + optionalString (withRuby) |
| 85 | + ''--suffix PATH : \"${rubyEnv}/bin\" --set GEM_HOME \"${rubyEnv}/${rubyEnv.ruby.gemPath}\" ''; |
81 | 86 |
|
82 | 87 | neovim = stdenv.mkDerivation rec {
|
83 | 88 | name = "neovim-${version}";
|
@@ -128,21 +133,23 @@ let
|
128 | 133 | substituteInPlace src/nvim/CMakeLists.txt --replace " util" ""
|
129 | 134 | '';
|
130 | 135 |
|
131 |
| - postInstall = stdenv.lib.optionalString stdenv.isDarwin '' |
132 |
| - echo patching $out/bin/nvim |
| 136 | + postInstall = stdenv.lib.optionalString stdenv.isLinux '' |
| 137 | + sed -i -e "s|'xsel|'${xsel}/bin/xsel|" $out/share/nvim/runtime/autoload/provider/clipboard.vim |
| 138 | + '' + stdenv.lib.optionalString (withJemalloc && stdenv.isDarwin) '' |
133 | 139 | install_name_tool -change libjemalloc.1.dylib \
|
134 | 140 | ${jemalloc}/lib/libjemalloc.1.dylib \
|
135 | 141 | $out/bin/nvim
|
136 |
| - sed -i -e "s|'xsel|'${xsel}/bin/xsel|" $out/share/nvim/runtime/autoload/provider/clipboard.vim |
137 | 142 | '' + optionalString withPython ''
|
138 | 143 | ln -s ${pythonEnv}/bin/python $out/bin/nvim-python
|
| 144 | + '' + optionalString withPython3 '' |
| 145 | + ln -s ${python3Env}/bin/python3 $out/bin/nvim-python3 |
| 146 | + '' + optionalString withPython3 '' |
| 147 | + ln -s ${rubyEnv}/bin/neovim-ruby-host $out/bin/nvim-ruby |
139 | 148 | '' + optionalString withPyGUI ''
|
140 | 149 | makeWrapper "${pythonEnv}/bin/pynvim" "$out/bin/pynvim" \
|
141 | 150 | --prefix PATH : "$out/bin"
|
142 |
| - '' + optionalString withPython3 '' |
143 |
| - ln -s ${python3Env}/bin/python3 $out/bin/nvim-python3 |
144 | 151 | '' + optionalString (withPython || withPython3 || withRuby) ''
|
145 |
| - wrapProgram $out/bin/nvim ${rubyWrapper + pythonFlags} |
| 152 | + wrapProgram $out/bin/nvim ${additionalFlags} |
146 | 153 | '';
|
147 | 154 |
|
148 | 155 | meta = {
|
|
0 commit comments