Merge pull request #102231 from teto/neovim_fix

neovim: revert change to extraMakeWrapperArgs
This commit is contained in:
Matthieu Coudron 2020-10-31 19:36:49 +01:00 committed by GitHub
commit 36ac62c6d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 14 deletions

View File

@ -118,7 +118,7 @@ let
# to keep backwards compatibility # to keep backwards compatibility
legacyWrapper = neovim: { legacyWrapper = neovim: {
extraMakeWrapperArgs ? [] extraMakeWrapperArgs ? ""
, withPython ? true , withPython ? true
/* the function you would have passed to python.withPackages */ /* the function you would have passed to python.withPackages */
, extraPythonPackages ? (_: []) , extraPythonPackages ? (_: [])
@ -147,13 +147,9 @@ let
}; };
in in
wrapNeovimUnstable neovim (res // { wrapNeovimUnstable neovim (res // {
wrapperArgs = res.wrapperArgs wrapperArgs = lib.escapeShellArgs (
++ [ res.wrapperArgs ++ [ "--add-flags" "-u ${writeText "init.vim" res.neovimRcContent}" ])
"--add-flags" "-u ${writeText "init.vim" res.neovimRcContent}" + " " + extraMakeWrapperArgs
]
++ (if builtins.isList extraMakeWrapperArgs then extraMakeWrapperArgs
else lib.warn "Passing a string as extraMakeWrapperArgs to the neovim wrapper is
deprecated, please use a list instead")
; ;
}); });
in in

View File

@ -14,7 +14,7 @@ neovim:
let let
wrapper = { wrapper = {
# should contain all args but the binary # should contain all args but the binary
wrapperArgs ? [] wrapperArgs ? ""
, manifestRc ? null , manifestRc ? null
, withPython2 ? true, python2Env ? null , withPython2 ? true, python2Env ? null
, withPython3 ? true, python3Env ? null , withPython3 ? true, python3Env ? null
@ -33,7 +33,7 @@ let
# wrapper with most arguments we need, excluding those that cause problems to # wrapper with most arguments we need, excluding those that cause problems to
# generate rplugin.vim, but still required for the final wrapper. # generate rplugin.vim, but still required for the final wrapper.
finalMakeWrapperArgs = finalMakeWrapperArgs =
[ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ] ++ wrapperArgs ++ [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ] ++
[ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ]; [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ];
in in
symlinkJoin { symlinkJoin {
@ -66,11 +66,11 @@ let
'' ''
+ optionalString (manifestRc != null) (let + optionalString (manifestRc != null) (let
manifestWrapperArgs = manifestWrapperArgs =
[ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" ] ++ wrapperArgs; [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" ];
in '' in ''
echo "Generating remote plugin manifest" echo "Generating remote plugin manifest"
export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim
makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} ${wrapperArgs}
# Some plugins assume that the home directory is accessible for # Some plugins assume that the home directory is accessible for
# initializing caches, temporary files, etc. Even if the plugin isn't # initializing caches, temporary files, etc. Even if the plugin isn't
@ -100,7 +100,7 @@ let
'') '')
+ '' + ''
rm $out/bin/nvim rm $out/bin/nvim
makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgs}
''; '';
paths = [ neovim ]; paths = [ neovim ];

View File

@ -23984,7 +23984,7 @@ in
# more usecases when wrapping neovim. The interface is being actively worked on # more usecases when wrapping neovim. The interface is being actively worked on
# so expect breakage. use wrapNeovim instead if you want a stable alternative # so expect breakage. use wrapNeovim instead if you want a stable alternative
wrapNeovimUnstable = callPackage ../applications/editors/neovim/wrapper.nix { }; wrapNeovimUnstable = callPackage ../applications/editors/neovim/wrapper.nix { };
wrapNeovim = neovimUtils.legacyWrapper; wrapNeovim = neovim-unwrapped: lib.makeOverridable (neovimUtils.legacyWrapper neovim-unwrapped);
neovim-unwrapped = callPackage ../applications/editors/neovim { neovim-unwrapped = callPackage ../applications/editors/neovim {
lua = lua =
# neovim doesn't work with luajit on aarch64: https://github.com/neovim/neovim/issues/7879 # neovim doesn't work with luajit on aarch64: https://github.com/neovim/neovim/issues/7879