From fbba3cb434a5079d0cbd596e7910ec7bb4648739 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 19 Dec 2024 22:05:18 -0600 Subject: [PATCH] vimPlugins.LanguageClient-neovim: move out of vim generated --- .../plugins/LanguageClient-neovim/default.nix | 51 +++++++++++++++++++ .../editors/vim/plugins/generated.nix | 12 ----- .../editors/vim/plugins/overrides.nix | 37 +------------- .../editors/vim/plugins/vim-plugin-names | 1 - 4 files changed, 52 insertions(+), 49 deletions(-) create mode 100644 pkgs/applications/editors/vim/plugins/LanguageClient-neovim/default.nix diff --git a/pkgs/applications/editors/vim/plugins/LanguageClient-neovim/default.nix b/pkgs/applications/editors/vim/plugins/LanguageClient-neovim/default.nix new file mode 100644 index 000000000000..2ede65b4e72d --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/LanguageClient-neovim/default.nix @@ -0,0 +1,51 @@ +{ + lib, + fetchFromGitHub, + nix-update-script, + rustPlatform, + vimUtils, +}: +let + version = "0.1.161"; + src = fetchFromGitHub { + owner = "autozimu"; + repo = "LanguageClient-neovim"; + tag = version; + hash = "sha256-Z9S2ie9RxJCIbmjSV/Tto4lK04cZfWmK3IAy8YaySVI="; + }; + LanguageClient-neovim-bin = rustPlatform.buildRustPackage { + pname = "LanguageClient-neovim-bin"; + inherit version src; + + cargoHash = "sha256-H34UqJ6JOwuSABdOup5yKeIwFrGc83TUnw1ggJEx9o4="; + }; +in +vimUtils.buildVimPlugin { + pname = "LanguageClient-neovim"; + inherit version src; + + propagatedBuildInputs = [ LanguageClient-neovim-bin ]; + + preFixup = '' + substituteInPlace "$out"/autoload/LanguageClient.vim \ + --replace-fail \ + "let l:path = s:root . '/bin/'" \ + "let l:path = '${LanguageClient-neovim-bin}' . '/bin/'" + ''; + + passthru = { + updateScript = nix-update-script { + extraArgs = [ "--version-regex=(\\d+\\.\\d+\\.\\d+)" ]; + attrPath = "vimPlugins.LanguageClient-neovim.LanguageClient-neovim-bin"; + }; + + # needed for the update script + inherit LanguageClient-neovim-bin; + }; + + meta = { + homepage = "https://github.com/autozimu/LanguageClient-neovim/"; + changelog = "https://github.com/autozimu/LanguageClient-neovim/releases/tag/${src.tag}"; + license = lib.licenses.mit; + }; +} diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 4201ae9c839f..84f9b5af71d8 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -159,18 +159,6 @@ final: prev: meta.homepage = "https://github.com/martinda/Jenkinsfile-vim-syntax/"; }; - LanguageClient-neovim = buildVimPlugin { - pname = "LanguageClient-neovim"; - version = "2022-06-07"; - src = fetchFromGitHub { - owner = "autozimu"; - repo = "LanguageClient-neovim"; - rev = "cf6dd11baf62fb6ce18308e96c0ab43428b7c686"; - sha256 = "0jmbxc0li4w59dzpzadq2phnfhnibggwxb3rvlmhr88dbglm0s8n"; - }; - meta.homepage = "https://github.com/autozimu/LanguageClient-neovim/"; - }; - LanguageTool-nvim = buildVimPlugin { pname = "LanguageTool.nvim"; version = "2020-10-19"; diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 1530e2f009c3..789e22556d5b 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -1398,42 +1398,7 @@ in nvimRequireCheck = "kulala"; }; - LanguageClient-neovim = - let - version = "0.1.161"; - LanguageClient-neovim-src = fetchFromGitHub { - owner = "autozimu"; - repo = "LanguageClient-neovim"; - rev = version; - sha256 = "Z9S2ie9RxJCIbmjSV/Tto4lK04cZfWmK3IAy8YaySVI="; - }; - LanguageClient-neovim-bin = rustPlatform.buildRustPackage { - pname = "LanguageClient-neovim-bin"; - inherit version; - src = LanguageClient-neovim-src; - - cargoHash = "sha256-H34UqJ6JOwuSABdOup5yKeIwFrGc83TUnw1ggJEx9o4="; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices ]; - - # FIXME: Use impure version of CoreFoundation because of missing symbols. - # Undefined symbols for architecture x86_64: "_CFURLResourceIsReachable" - preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' - export NIX_LDFLAGS="-F${CoreFoundation}/Library/Frameworks -framework CoreFoundation $NIX_LDFLAGS" - ''; - }; - in - buildVimPlugin { - pname = "LanguageClient-neovim"; - inherit version; - src = LanguageClient-neovim-src; - - propagatedBuildInputs = [ LanguageClient-neovim-bin ]; - - preFixup = '' - substituteInPlace "$out"/autoload/LanguageClient.vim \ - --replace "let l:path = s:root . '/bin/'" "let l:path = '${LanguageClient-neovim-bin}' . '/bin/'" - ''; - }; + LanguageClient-neovim = callPackage ./LanguageClient-neovim { }; LazyVim = super.LazyVim.overrideAttrs { # Any other dependency is optional diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index e87c429fb6d6..df61a5b9f1a2 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -12,7 +12,6 @@ https://github.com/antoinemadec/FixCursorHold.nvim/,, https://github.com/vim-scripts/Improved-AnsiEsc/,, https://github.com/ionide/Ionide-vim/,HEAD, https://github.com/martinda/Jenkinsfile-vim-syntax/,, -https://github.com/autozimu/LanguageClient-neovim/,, https://github.com/vigoux/LanguageTool.nvim/,, https://github.com/LazyVim/LazyVim/,, https://github.com/Yggdroot/LeaderF/,,