File tree Expand file tree Collapse file tree 2 files changed +21
-13
lines changed
pkgs/applications/editors/vim/plugins/non-generated/sniprun Expand file tree Collapse file tree 2 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 11{
22 lib ,
33 fetchFromGitHub ,
4- nix-update-script ,
4+
5+ # sniprun-bin
56 rustPlatform ,
6- vimUtils ,
77 makeWrapper ,
88 bashInteractive ,
99 coreutils ,
1010 curl ,
1111 gnugrep ,
1212 gnused ,
1313 procps ,
14+
15+ # sniprun
16+ vimUtils ,
17+ substituteAll ,
18+ nix-update-script ,
1419} :
1520let
16- version = "1.3.16 " ;
21+ version = "1.3.17 " ;
1722 src = fetchFromGitHub {
1823 owner = "michaelb" ;
1924 repo = "sniprun" ;
2025 tag = "v${ version } " ;
21- hash = "sha256-2rVeBUkdLXUiHkd8slyiLTYQBKwgMQvIi/uyCToVBYA =" ;
26+ hash = "sha256-o8U3GXg61dfEzQxrs9zCgRDWonhr628aSPd/l+HxS70 =" ;
2227 } ;
2328 sniprun-bin = rustPlatform . buildRustPackage {
2429 pname = "sniprun-bin" ;
2530 inherit version src ;
2631
2732 useFetchCargoVendor = true ;
28- cargoHash = "sha256-j3i86I5Lmt0+fQONikHnxfeLEbiyFSairgjHXmjZfTk =" ;
33+ cargoHash = "sha256-HLPTt0JCmCM4SRmP8o435ilM1yxoxpAnf8hg3+8C54I =" ;
2934
3035 nativeBuildInputs = [ makeWrapper ] ;
3136
4449 '' ;
4550
4651 doCheck = false ;
52+
53+ meta . mainProgram = "sniprun" ;
4754 } ;
4855in
4956vimUtils . buildVimPlugin {
5057 pname = "sniprun" ;
5158 inherit version src ;
5259
53- patches = [ ./fix-paths.patch ] ;
54-
55- postPatch = ''
56- substituteInPlace lua/sniprun.lua --replace '@sniprun_bin@' ${ sniprun-bin }
57- '' ;
60+ patches = [
61+ ( substituteAll {
62+ src = ./fix-paths.patch ;
63+ sniprun = lib . getExe sniprun-bin ;
64+ } )
65+ ] ;
5866
5967 propagatedBuildInputs = [ sniprun-bin ] ;
6068
@@ -69,7 +77,7 @@ vimUtils.buildVimPlugin {
6977
7078 meta = {
7179 homepage = "https://github.com/michaelb/sniprun/" ;
72- changelog = "https://github.com/michaelb/sniprun/blob/${ src . tag } /CHANGELOG.md" ;
80+ changelog = "https://github.com/michaelb/sniprun/blob/v ${ version } /CHANGELOG.md" ;
7381 maintainers = with lib . maintainers ; [ GaetanLepage ] ;
7482 license = lib . licenses . mit ;
7583 } ;
Original file line number Diff line number Diff line change 11diff --git a/lua/sniprun.lua b/lua/sniprun.lua
2- index 49be442..1834566 100644
2+ index 49be442..9342351 100644
33--- a/lua/sniprun.lua
44+++ b/lua/sniprun.lua
55@@ -3,9 +3,7 @@ M.ping_anwsered = 0
@@ -9,7 +9,7 @@ index 49be442..1834566 100644
99- local binary_path = vim.fn.fnamemodify(
1010- vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":h:h")
1111- .. "/target/release/sniprun"
12- + local binary_path = "@sniprun_bin@/bin/ sniprun"
12+ + local binary_path = "@sniprun@ "
1313
1414 local sniprun_path = vim.fn.fnamemodify(vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":p:h") .. "/.."
1515
You can’t perform that action at this time.
0 commit comments