Loading pkgs/applications/editors/vim/plugins/non-generated/sniprun/default.nix +19 −11 Original line number Diff line number Diff line { lib, fetchFromGitHub, nix-update-script, # sniprun-bin rustPlatform, vimUtils, makeWrapper, bashInteractive, coreutils, Loading @@ -11,21 +11,26 @@ gnugrep, gnused, procps, # sniprun vimUtils, substituteAll, nix-update-script, }: let version = "1.3.16"; version = "1.3.17"; src = fetchFromGitHub { owner = "michaelb"; repo = "sniprun"; tag = "v${version}"; hash = "sha256-2rVeBUkdLXUiHkd8slyiLTYQBKwgMQvIi/uyCToVBYA="; hash = "sha256-o8U3GXg61dfEzQxrs9zCgRDWonhr628aSPd/l+HxS70="; }; sniprun-bin = rustPlatform.buildRustPackage { pname = "sniprun-bin"; inherit version src; useFetchCargoVendor = true; cargoHash = "sha256-j3i86I5Lmt0+fQONikHnxfeLEbiyFSairgjHXmjZfTk="; cargoHash = "sha256-HLPTt0JCmCM4SRmP8o435ilM1yxoxpAnf8hg3+8C54I="; nativeBuildInputs = [ makeWrapper ]; Loading @@ -44,17 +49,20 @@ let ''; doCheck = false; meta.mainProgram = "sniprun"; }; in vimUtils.buildVimPlugin { pname = "sniprun"; inherit version src; patches = [ ./fix-paths.patch ]; postPatch = '' substituteInPlace lua/sniprun.lua --replace '@sniprun_bin@' ${sniprun-bin} ''; patches = [ (substituteAll { src = ./fix-paths.patch; sniprun = lib.getExe sniprun-bin; }) ]; propagatedBuildInputs = [ sniprun-bin ]; Loading @@ -69,7 +77,7 @@ vimUtils.buildVimPlugin { meta = { homepage = "https://github.com/michaelb/sniprun/"; changelog = "https://github.com/michaelb/sniprun/blob/${src.tag}/CHANGELOG.md"; changelog = "https://github.com/michaelb/sniprun/blob/v${version}/CHANGELOG.md"; maintainers = with lib.maintainers; [ GaetanLepage ]; license = lib.licenses.mit; }; Loading pkgs/applications/editors/vim/plugins/non-generated/sniprun/fix-paths.patch +2 −2 Original line number Diff line number Diff line diff --git a/lua/sniprun.lua b/lua/sniprun.lua index 49be442..1834566 100644 index 49be442..9342351 100644 --- a/lua/sniprun.lua +++ b/lua/sniprun.lua @@ -3,9 +3,7 @@ M.ping_anwsered = 0 Loading @@ -9,7 +9,7 @@ index 49be442..1834566 100644 -local binary_path = vim.fn.fnamemodify( - vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":h:h") - .. "/target/release/sniprun" +local binary_path = "@sniprun_bin@/bin/sniprun" +local binary_path = "@sniprun@" local sniprun_path = vim.fn.fnamemodify(vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":p:h") .. "/.." Loading
pkgs/applications/editors/vim/plugins/non-generated/sniprun/default.nix +19 −11 Original line number Diff line number Diff line { lib, fetchFromGitHub, nix-update-script, # sniprun-bin rustPlatform, vimUtils, makeWrapper, bashInteractive, coreutils, Loading @@ -11,21 +11,26 @@ gnugrep, gnused, procps, # sniprun vimUtils, substituteAll, nix-update-script, }: let version = "1.3.16"; version = "1.3.17"; src = fetchFromGitHub { owner = "michaelb"; repo = "sniprun"; tag = "v${version}"; hash = "sha256-2rVeBUkdLXUiHkd8slyiLTYQBKwgMQvIi/uyCToVBYA="; hash = "sha256-o8U3GXg61dfEzQxrs9zCgRDWonhr628aSPd/l+HxS70="; }; sniprun-bin = rustPlatform.buildRustPackage { pname = "sniprun-bin"; inherit version src; useFetchCargoVendor = true; cargoHash = "sha256-j3i86I5Lmt0+fQONikHnxfeLEbiyFSairgjHXmjZfTk="; cargoHash = "sha256-HLPTt0JCmCM4SRmP8o435ilM1yxoxpAnf8hg3+8C54I="; nativeBuildInputs = [ makeWrapper ]; Loading @@ -44,17 +49,20 @@ let ''; doCheck = false; meta.mainProgram = "sniprun"; }; in vimUtils.buildVimPlugin { pname = "sniprun"; inherit version src; patches = [ ./fix-paths.patch ]; postPatch = '' substituteInPlace lua/sniprun.lua --replace '@sniprun_bin@' ${sniprun-bin} ''; patches = [ (substituteAll { src = ./fix-paths.patch; sniprun = lib.getExe sniprun-bin; }) ]; propagatedBuildInputs = [ sniprun-bin ]; Loading @@ -69,7 +77,7 @@ vimUtils.buildVimPlugin { meta = { homepage = "https://github.com/michaelb/sniprun/"; changelog = "https://github.com/michaelb/sniprun/blob/${src.tag}/CHANGELOG.md"; changelog = "https://github.com/michaelb/sniprun/blob/v${version}/CHANGELOG.md"; maintainers = with lib.maintainers; [ GaetanLepage ]; license = lib.licenses.mit; }; Loading
pkgs/applications/editors/vim/plugins/non-generated/sniprun/fix-paths.patch +2 −2 Original line number Diff line number Diff line diff --git a/lua/sniprun.lua b/lua/sniprun.lua index 49be442..1834566 100644 index 49be442..9342351 100644 --- a/lua/sniprun.lua +++ b/lua/sniprun.lua @@ -3,9 +3,7 @@ M.ping_anwsered = 0 Loading @@ -9,7 +9,7 @@ index 49be442..1834566 100644 -local binary_path = vim.fn.fnamemodify( - vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":h:h") - .. "/target/release/sniprun" +local binary_path = "@sniprun_bin@/bin/sniprun" +local binary_path = "@sniprun@" local sniprun_path = vim.fn.fnamemodify(vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":p:h") .. "/.."