Skip to content

Commit

Permalink
vimPlugins.sniprun: 1.3.16 -> 1.3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Feb 10, 2025
1 parent 123ab7d commit 94af5ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
{
lib,
fetchFromGitHub,
nix-update-script,

# sniprun-bin
rustPlatform,
vimUtils,
makeWrapper,
bashInteractive,
coreutils,
curl,
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 ];

Expand All @@ -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 ];

Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
Expand All @@ -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") .. "/.."

0 comments on commit 94af5ee

Please sign in to comment.