vimPlugins.blink-cmp: fix runtime version detection error

The plugin fails to load in neovim because it cannot detect the git tag
used during build time. Add patch to force using src.tag instead of
runtime detection, preventing the error:
"Detected an out of date or missing fuzzy matching library. Can't
download from github due to not being on a git tag..."
This commit is contained in:
Heitor Augusto
2024-12-27 22:45:33 -03:00
parent d9e4728900
commit 8fd65e57f1
2 changed files with 16 additions and 0 deletions
@@ -6,6 +6,7 @@
vimUtils,
nix-update-script,
git,
replaceVars,
}:
let
version = "0.8.2";
@@ -39,6 +40,10 @@ vimUtils.buildVimPlugin {
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
'';
patches = [
(replaceVars ./force-version.patch { inherit (src) tag; })
];
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.blink-cmp.blink-fuzzy-lib";
@@ -0,0 +1,11 @@
--- a/lua/blink/cmp/fuzzy/download/init.lua
+++ b/lua/blink/cmp/fuzzy/download/init.lua
@@ -21,7 +21,7 @@ function download.ensure_downloaded(callback)
}
end)
:map(function(version)
- local target_git_tag = download_config.force_version or version.git.tag
+ local target_git_tag = download_config.force_version or '@tag@'
-- not built locally, not on a git tag, error
assert(