From b6e2bed56d21ed4889fdd910a06d1a3a16c9a07a Mon Sep 17 00:00:00 2001 From: linsui Date: Fri, 29 Dec 2023 23:58:49 +0800 Subject: [PATCH] vimPlugins.nvim-spectre: build spectre_oxi on linux --- .../editors/vim/plugins/overrides.nix | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 3856efd0187d..6a98dae86bc0 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -969,9 +969,28 @@ dependencies = with self; [ nvim-lspconfig ]; }; - nvim-spectre = super.nvim-spectre.overrideAttrs { - dependencies = with self; [ plenary-nvim ]; - }; + nvim-spectre = super.nvim-spectre.overrideAttrs (old: + let + spectre_oxi = rustPlatform.buildRustPackage { + pname = "spectre_oxi"; + inherit (old) version src; + sourceRoot = "source/spectre_oxi"; + + cargoHash = "sha256-y2ZIgOApIShkIesXmItPKDO6XjFrG4GS5HCPncJUmN8="; + + + preCheck = '' + mkdir tests/tmp/ + ''; + }; + in + (lib.optionalAttrs stdenv.isLinux { + dependencies = with self; + [ plenary-nvim ]; + postInstall = '' + ln -s ${spectre_oxi}/lib/libspectre_oxi.* $out/lua/spectre_oxi.so + ''; + })); nvim-teal-maker = super.nvim-teal-maker.overrideAttrs { postPatch = ''