From 8d9ed73e6568d3efd95bbf0ff93d9094f623ceac Mon Sep 17 00:00:00 2001 From: V Date: Tue, 9 Apr 2024 06:54:05 +0200 Subject: [PATCH 1/4] kakoune-lsp: 16.0.0 -> 17.0.1 --- .../ka/kakoune-lsp/Hardcode-perl.patch | 51 +++++++++++++++++++ .../ka/kakoune-lsp/Use-full-Perl-path.patch | 37 -------------- pkgs/by-name/ka/kakoune-lsp/package.nix | 33 ++++++------ 3 files changed, 69 insertions(+), 52 deletions(-) create mode 100644 pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch delete mode 100644 pkgs/by-name/ka/kakoune-lsp/Use-full-Perl-path.patch diff --git a/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch b/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch new file mode 100644 index 0000000000000..747a9481025bd --- /dev/null +++ b/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch @@ -0,0 +1,51 @@ +From 17cec4d94bc04bd02b91361ca72f561f1eebce60 Mon Sep 17 00:00:00 2001 +From: V +Date: Tue, 9 Apr 2024 06:15:00 +0200 +Subject: [PATCH] Hardcode perl + +--- + rc/lsp.kak | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/rc/lsp.kak b/rc/lsp.kak +index b173478..015c3ca 100644 +--- a/rc/lsp.kak ++++ b/rc/lsp.kak +@@ -280,12 +280,8 @@ define-command -hidden lsp-menu -params 1.. %{ + } + define-command -hidden lsp-menu-impl %{ + evaluate-commands %sh{ +- if ! command -v perl > /dev/null; then +- printf "fail %{'perl' must be installed to use the 'lsp-menu' command}" +- exit +- 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 ' + 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 +- printf "fail %{'perl' must be installed to use the 'lsp-snippets-insert' command'}" +- fi +- } + evaluate-commands -draft -save-regs '^"' %[ + set-register '"' %arg{1} + execute-keys +@@ -2469,7 +2460,7 @@ define-command lsp-snippets-insert -hidden -params 1 %[ + define-command -hidden lsp-snippets-insert-perl-impl %[ + set-register x nop + evaluate-commands %sh[ # $kak_quoted_selections +- perl -e ' ++ @perl@ -e ' + use strict; + use warnings; + use Text::ParseWords(); +-- +2.44.0 + diff --git a/pkgs/by-name/ka/kakoune-lsp/Use-full-Perl-path.patch b/pkgs/by-name/ka/kakoune-lsp/Use-full-Perl-path.patch deleted file mode 100644 index 38f0d38cb2156..0000000000000 --- a/pkgs/by-name/ka/kakoune-lsp/Use-full-Perl-path.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b93660cfa8a80a5e5bf72e1f06fb7bf95272c7e4 Mon Sep 17 00:00:00 2001 -From: PoweredByPie -Date: Fri, 8 Dec 2023 04:39:01 -0800 -Subject: [PATCH] Use full Perl path - ---- - rc/lsp.kak | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/rc/lsp.kak b/rc/lsp.kak -index d695a2e..7c6a436 100644 ---- a/rc/lsp.kak -+++ b/rc/lsp.kak -@@ -2339,11 +2339,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 2>&1; then -- printf "fail '''perl'' must be installed to use the ''snippets-insert'' command'" -- fi -- } - evaluate-commands -draft -save-regs '^"' %[ - set-register '"' %arg{1} - execute-keys -@@ -2397,7 +2392,7 @@ define-command lsp-snippets-insert -hidden -params 1 %[ - - define-command -hidden lsp-snippets-insert-perl-impl %[ - evaluate-commands %sh[ # $kak_quoted_selections -- perl -e ' -+ @perlPath@/bin/perl -e ' - use strict; - use warnings; - use Text::ParseWords(); --- -2.42.0 - diff --git a/pkgs/by-name/ka/kakoune-lsp/package.nix b/pkgs/by-name/ka/kakoune-lsp/package.nix index 8e8406587f1cd..a13c2bf6bd737 100644 --- a/pkgs/by-name/ka/kakoune-lsp/package.nix +++ b/pkgs/by-name/ka/kakoune-lsp/package.nix @@ -1,34 +1,37 @@ -{ stdenv, lib, fetchFromGitHub, rustPlatform, perl, CoreServices, Security, SystemConfiguration }: +{ lib +, rustPlatform +, fetchFromGitHub +, substituteAll, perl +, stdenv, CoreServices, Security, SystemConfiguration +}: rustPlatform.buildRustPackage rec { pname = "kakoune-lsp"; - version = "16.0.0"; + version = "17.0.1"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - sha256 = "sha256-d4Tc6iYp20uOKMd+T2LhWgXWZzvzq1E+VWqjhhiIiHE="; + sha256 = "sha256-uXKquAjfytUn/Q0kx+0BGRQTkVMQ9rMRnTCy622upag="; }; - cargoHash = "sha256-kV8d0PwIWS6gyfCtv70iv8MrL91ZOZbwYznhc3lUw0U="; - - buildInputs = [ perl ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security SystemConfiguration ]; - patches = [ - ./Use-full-Perl-path.patch + (substituteAll { + src = ./Hardcode-perl.patch; + perl = lib.getExe perl; + }) ]; - postPatch = '' - substituteInPlace rc/lsp.kak \ - --subst-var-by perlPath ${lib.getBin perl} - ''; + cargoHash = "sha256-XnhYODMzqInwbgM8wveY048sljZ8OKw4hLYJG5h8Twc="; + + buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Security SystemConfiguration ]; - meta = with lib; { + meta = { description = "Kakoune Language Server Protocol Client"; homepage = "https://github.com/kakoune-lsp/kakoune-lsp"; - license = with licenses; [ unlicense /* or */ mit ]; - maintainers = with maintainers; [ philiptaron spacekookie poweredbypie ]; + license = with lib.licenses; [ unlicense /* or */ mit ]; + maintainers = with lib.maintainers; [ philiptaron spacekookie poweredbypie ]; mainProgram = "kak-lsp"; }; } From d176239d50cb268e2dfe63e44a1da2b976c17c71 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 12 Aug 2024 13:58:48 -0700 Subject: [PATCH 2/4] kakoune-lsp: nixfmt --- pkgs/by-name/ka/kakoune-lsp/package.nix | 36 +++++++++++++++++++------ 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/ka/kakoune-lsp/package.nix b/pkgs/by-name/ka/kakoune-lsp/package.nix index a13c2bf6bd737..8dc64d99c288f 100644 --- a/pkgs/by-name/ka/kakoune-lsp/package.nix +++ b/pkgs/by-name/ka/kakoune-lsp/package.nix @@ -1,8 +1,13 @@ -{ lib -, rustPlatform -, fetchFromGitHub -, substituteAll, perl -, stdenv, CoreServices, Security, SystemConfiguration +{ + lib, + rustPlatform, + fetchFromGitHub, + substituteAll, + perl, + stdenv, + CoreServices, + Security, + SystemConfiguration, }: rustPlatform.buildRustPackage rec { @@ -25,13 +30,28 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-XnhYODMzqInwbgM8wveY048sljZ8OKw4hLYJG5h8Twc="; - buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Security SystemConfiguration ]; + buildInputs = lib.optionals stdenv.isDarwin [ + CoreServices + Security + SystemConfiguration + ]; meta = { description = "Kakoune Language Server Protocol Client"; homepage = "https://github.com/kakoune-lsp/kakoune-lsp"; - license = with lib.licenses; [ unlicense /* or */ mit ]; - maintainers = with lib.maintainers; [ philiptaron spacekookie poweredbypie ]; + + # See https://github.com/kakoune-lsp/kakoune-lsp/commit/55dfc83409b9b7d3556bacda8ef8b71fc33b58cd + license = with lib.licenses; [ + unlicense + mit + ]; + + maintainers = with lib.maintainers; [ + philiptaron + spacekookie + poweredbypie + ]; + mainProgram = "kak-lsp"; }; } From 6d151f1e1931702078eaafc38a24f516fde47209 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 12 Aug 2024 14:02:55 -0700 Subject: [PATCH 3/4] 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 747a9481025bd..a83e208c17169 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 8dc64d99c288f..1135fa3430a7b 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="; From fd77255de410133dc772a418a569575e887089ff Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Mon, 12 Aug 2024 14:07:28 -0700 Subject: [PATCH 4/4] kakoune-lsp: 17.0.1 -> 17.1.1 --- pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch | 16 ++++++++-------- pkgs/by-name/ka/kakoune-lsp/package.nix | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch b/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch index a83e208c17169..14201b96b061d 100644 --- a/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch +++ b/pkgs/by-name/ka/kakoune-lsp/Hardcode-perl.patch @@ -1,4 +1,4 @@ -From 17cec4d94bc04bd02b91361ca72f561f1eebce60 Mon Sep 17 00:00:00 2001 +From 14bdb9c39cfd813697a4f5d83ed2b4c4c043a309 Mon Sep 17 00:00:00 2001 From: V Date: Tue, 9 Apr 2024 06:15:00 +0200 Subject: [PATCH] Hardcode perl @@ -8,7 +8,7 @@ Subject: [PATCH] Hardcode perl 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/rc/lsp.kak b/rc/lsp.kak -index b173478..015c3ca 100644 +index 306b405..6662d29 100644 --- a/rc/lsp.kak +++ b/rc/lsp.kak @@ -280,12 +280,8 @@ define-command -hidden lsp-menu -params 1.. %{ @@ -16,7 +16,7 @@ index b173478..015c3ca 100644 define-command -hidden lsp-menu-impl %{ evaluate-commands %sh{ - if ! command -v perl > /dev/null; then -- printf "fail %{'perl' must be installed to use the 'lsp-menu' command}" +- echo "lsp-show-error %{'perl' must be installed to use the 'lsp-menu' command}" - exit - fi echo >$kak_command_fifo "echo -to-file $kak_response_fifo -quoting kakoune -- %reg{a}" @@ -25,9 +25,9 @@ index b173478..015c3ca 100644 use strict; my $Q = "'\''"; my @args = (); -@@ -2410,11 +2406,6 @@ define-command -hidden lsp-snippets-insert-completion -params 1 %{ evaluate-comm +@@ -2467,11 +2463,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 @@ -37,7 +37,7 @@ index b173478..015c3ca 100644 evaluate-commands -draft -save-regs '^"' %[ set-register '"' %arg{1} execute-keys -@@ -2469,7 +2460,7 @@ define-command lsp-snippets-insert -hidden -params 1 %[ +@@ -2526,7 +2517,7 @@ define-command lsp-snippets-insert -hidden -params 1 %[ define-command -hidden lsp-snippets-insert-perl-impl %[ set-register x nop evaluate-commands %sh[ # $kak_quoted_selections @@ -46,6 +46,6 @@ index b173478..015c3ca 100644 use strict; use warnings; use Text::ParseWords(); --- -2.44.0 +-- +2.45.2 diff --git a/pkgs/by-name/ka/kakoune-lsp/package.nix b/pkgs/by-name/ka/kakoune-lsp/package.nix index 1135fa3430a7b..2a2d7a83a1756 100644 --- a/pkgs/by-name/ka/kakoune-lsp/package.nix +++ b/pkgs/by-name/ka/kakoune-lsp/package.nix @@ -12,18 +12,18 @@ rustPlatform.buildRustPackage rec { pname = "kakoune-lsp"; - version = "17.0.1"; + version = "17.1.1"; src = fetchFromGitHub { - owner = pname; - repo = pname; + owner = "kakoune-lsp"; + repo = "kakoune-lsp"; rev = "v${version}"; - sha256 = "sha256-uXKquAjfytUn/Q0kx+0BGRQTkVMQ9rMRnTCy622upag="; + sha256 = "sha256-XBH2pMDiHJNXrx90Lt0IcsbMFUM+X7GAHgiHpdlIdR4="; }; patches = [ (replaceVars ./Hardcode-perl.patch { inherit perl; }) ]; - cargoHash = "sha256-XnhYODMzqInwbgM8wveY048sljZ8OKw4hLYJG5h8Twc="; + cargoHash = "sha256-Yi+T+9E3Wvce4kDLsRgZ07RAGLrq7dkinKpvvGeLeS0="; buildInputs = lib.optionals stdenv.isDarwin [ CoreServices