From 6d151f1e1931702078eaafc38a24f516fde47209 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 12 Aug 2024 14:02:55 -0700 Subject: [PATCH] kakoune-lsp: use replaceVars --- pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch | 8 ++++---- pkgs/by-name/ka/kakoune-lsp/package.nix | 9 ++------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch b/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch index 747a9481025b..a83e208c1716 100644 --- a/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch +++ b/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch @@ -21,13 +21,13 @@ index b173478..015c3ca 100644 - fi echo >$kak_command_fifo "echo -to-file $kak_response_fifo -quoting kakoune -- %reg{a}" - perl < $kak_response_fifo -we ' -+ @perl@ < $kak_response_fifo -we ' ++ @perl@/bin/perl < $kak_response_fifo -we ' use strict; my $Q = "'\''"; my @args = (); @@ -2410,11 +2406,6 @@ define-command -hidden lsp-snippets-insert-completion -params 1 %{ evaluate-comm }} - + define-command lsp-snippets-insert -hidden -params 1 %[ - evaluate-commands %sh{ - if ! command -v perl > /dev/null; then @@ -42,10 +42,10 @@ index b173478..015c3ca 100644 set-register x nop evaluate-commands %sh[ # $kak_quoted_selections - perl -e ' -+ @perl@ -e ' ++ @perl@/bin/perl -e ' use strict; use warnings; use Text::ParseWords(); --- +-- 2.44.0 diff --git a/pkgs/by-name/ka/kakoune-lsp/package.nix b/pkgs/by-name/ka/kakoune-lsp/package.nix index 8dc64d99c288..1135fa3430a7 100644 --- a/pkgs/by-name/ka/kakoune-lsp/package.nix +++ b/pkgs/by-name/ka/kakoune-lsp/package.nix @@ -2,7 +2,7 @@ lib, rustPlatform, fetchFromGitHub, - substituteAll, + replaceVars, perl, stdenv, CoreServices, @@ -21,12 +21,7 @@ rustPlatform.buildRustPackage rec { sha256 = "sha256-uXKquAjfytUn/Q0kx+0BGRQTkVMQ9rMRnTCy622upag="; }; - patches = [ - (substituteAll { - src = ./Hardcode-perl.patch; - perl = lib.getExe perl; - }) - ]; + patches = [ (replaceVars ./Hardcode-perl.patch { inherit perl; }) ]; cargoHash = "sha256-XnhYODMzqInwbgM8wveY048sljZ8OKw4hLYJG5h8Twc=";