Merge pull request #136429 from teto/vim-remove-rtpPath

Vim remove share/runtime/NAME prefix from the installed folder
This commit is contained in:
Matthieu Coudron 2021-09-12 19:58:17 +02:00 committed by GitHub
commit ed77db85ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 19 deletions

View file

@ -84,6 +84,13 @@ rec {
viAlias = true;
};
nvim_with_plug = neovim.override {
extraName = "-with-plug";
configure.plug.plugins = with pkgs.vimPlugins; [
vim-go
];
};
# nixpkgs should detect that no wrapping is necessary
nvimShouldntWrap = wrapNeovim2 "-should-not-wrap" nvimAutoDisableWrap;

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
buildCommand = ''
mkdir -p "$out"/bin
cp "${vimPlugins.vimacs}"/share/vim-plugins/vimacs/bin/vim $out/bin/vimacs
cp "${vimPlugins.vimacs}"/bin/vim $out/bin/vimacs
substituteInPlace "$out"/bin/vimacs \
--replace '-vim}' '-@bin@/bin/vim}' \
--replace '-gvim}' '-@bin@/bin/vim -g}' \

View file

@ -19,7 +19,7 @@ rec {
buildPhase ? "",
preInstall ? "",
postInstall ? "",
path ? lib.getName name,
path ? ".",
addonInfo ? null,
...
}:

View file

@ -99,10 +99,10 @@ self: super: {
# The linked ruby code shows generates the required '.clang_complete' for cmake based projects
# https://gist.github.com/Mic92/135e83803ed29162817fce4098dec144
preFixup = ''
substituteInPlace "$out"/share/vim-plugins/clang_complete/plugin/clang_complete.vim \
substituteInPlace "$out"/plugin/clang_complete.vim \
--replace "let g:clang_library_path = '' + "''" + ''" "let g:clang_library_path='${llvmPackages.libclang.lib}/lib/libclang.so'"
substituteInPlace "$out"/share/vim-plugins/clang_complete/plugin/libclang.py \
substituteInPlace "$out"/plugin/libclang.py \
--replace "/usr/lib/clang" "${llvmPackages.clang.cc}/lib/clang"
'';
});
@ -110,7 +110,7 @@ self: super: {
clighter8 = super.clighter8.overrideAttrs (old: {
preFixup = ''
sed "/^let g:clighter8_libclang_path/s|')$|${llvmPackages.clang.cc.lib}/lib/libclang.so')|" \
-i "$out"/share/vim-plugins/clighter8/plugin/clighter8.vim
-i "$out"/plugin/clighter8.vim
'';
});
@ -203,7 +203,7 @@ self: super: {
direnv-vim = super.direnv-vim.overrideAttrs (oa: {
preFixup = oa.preFixup or "" + ''
substituteInPlace $out/share/vim-plugins/direnv.vim/autoload/direnv.vim \
substituteInPlace $out/autoload/direnv.vim \
--replace "let s:direnv_cmd = get(g:, 'direnv_cmd', 'direnv')" \
"let s:direnv_cmd = get(g:, 'direnv_cmd', '${lib.getBin direnv}/bin/direnv')"
'';
@ -354,7 +354,7 @@ self: super: {
propagatedBuildInputs = [ LanguageClient-neovim-bin ];
preFixup = ''
substituteInPlace "$out"/share/vim-plugins/LanguageClient-neovim/autoload/LanguageClient.vim \
substituteInPlace "$out"/autoload/LanguageClient.vim \
--replace "let l:path = s:root . '/bin/'" "let l:path = '${LanguageClient-neovim-bin}' . '/bin/'"
'';
};
@ -387,9 +387,9 @@ self: super: {
minimap-vim = super.minimap-vim.overrideAttrs (old: {
preFixup = ''
substituteInPlace $out/share/vim-plugins/minimap.vim/plugin/minimap.vim \
substituteInPlace $out/plugin/minimap.vim \
--replace "code-minimap" "${code-minimap}/bin/code-minimap"
substituteInPlace $out/share/vim-plugins/minimap.vim/bin/minimap_generator.sh \
substituteInPlace $out/bin/minimap_generator.sh \
--replace "code-minimap" "${code-minimap}/bin/code-minimap"
'';
});
@ -691,7 +691,7 @@ self: super: {
vim-dasht = super.vim-dasht.overrideAttrs (old: {
preFixup = ''
substituteInPlace $out/share/vim-plugins/vim-dasht/autoload/dasht.vim \
substituteInPlace $out/autoload/dasht.vim \
--replace "['dasht']" "['${dasht}/bin/dasht']"
'';
});
@ -795,7 +795,7 @@ self: super: {
in
super.vim-markdown-composer.overrideAttrs (oldAttrs: rec {
preFixup = ''
substituteInPlace "$out"/share/vim-plugins/vim-markdown-composer/after/ftplugin/markdown/composer.vim \
substituteInPlace "$out"/after/ftplugin/markdown/composer.vim \
--replace "let l:args = [s:plugin_root . '/target/release/markdown-composer']" \
"let l:args = ['${vim-markdown-composer-bin}/bin/markdown-composer']"
'';

View file

@ -7,7 +7,6 @@ vimPluginGenTags() {
target="$out/@rtpPath@/$pname"
mkdir -p $out/@rtpPath@
cp -r . $target
# build help tags
if [ -d "$target/doc" ]; then

View file

@ -185,7 +185,7 @@ let
else (lib.optional (x ? name) x.name)
++ (x.names or []);
rtpPath = "share/vim-plugins";
rtpPath = ".";
nativeImpl = packages:
(let
@ -196,13 +196,14 @@ let
ln -sf ${plugin}/${plugin.pname}-${plugin.version}-rocks/${plugin.pname}/${plugin.version}/* $out/pack/${packageName}/${dir}/${plugin.pname}/
'';
linkVimlPlugin = pluginPath: packageName: dir:
"ln -sf ${pluginPath}/${rtpPath}/* $out/pack/${packageName}/${dir}";
linkVimlPlugin = plugin: packageName: dir: ''
mkdir -p $out/pack/${packageName}/${dir}/${plugin.pname}
ln -sf ${plugin}/${rtpPath}/* $out/pack/${packageName}/${dir}/${plugin.pname}
'';
# (builtins.trace pluginPath )
link = pluginPath: if hasLuaModule pluginPath
then linkLuaPlugin pluginPath
else linkVimlPlugin pluginPath;
link = pluginPath: if hasLuaModule pluginPath
then linkLuaPlugin pluginPath
else linkVimlPlugin pluginPath;
packageLinks = (packageName: {start ? [], opt ? []}:
let