vimPlugins.sniprun: move to separate folder (#366711)
This commit is contained in:
@@ -2803,62 +2803,7 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
sniprun =
|
||||
let
|
||||
version = "1.3.16";
|
||||
src = fetchFromGitHub {
|
||||
owner = "michaelb";
|
||||
repo = "sniprun";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-2rVeBUkdLXUiHkd8slyiLTYQBKwgMQvIi/uyCToVBYA=";
|
||||
};
|
||||
sniprun-bin = rustPlatform.buildRustPackage {
|
||||
pname = "sniprun-bin";
|
||||
inherit version src;
|
||||
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
];
|
||||
|
||||
cargoHash = "sha256-eZcWS+DWec0V9G6hBnZRUNcb3uZeSiBhn4Ed9KodFV8=";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/sniprun \
|
||||
--prefix PATH ${
|
||||
lib.makeBinPath [
|
||||
bashInteractive
|
||||
coreutils
|
||||
curl
|
||||
gnugrep
|
||||
gnused
|
||||
procps
|
||||
]
|
||||
}
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
};
|
||||
in
|
||||
buildVimPlugin {
|
||||
pname = "sniprun";
|
||||
inherit version src;
|
||||
|
||||
patches = [ ./patches/sniprun/fix-paths.patch ];
|
||||
postPatch = ''
|
||||
substituteInPlace lua/sniprun.lua --replace '@sniprun_bin@' ${sniprun-bin}
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [ sniprun-bin ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/michaelb/sniprun/";
|
||||
changelog = "https://github.com/michaelb/sniprun/blob/v${version}/CHANGELOG.md";
|
||||
maintainers = with lib.maintainers; [ GaetanLepage ];
|
||||
};
|
||||
nvimRequireCheck = "sniprun";
|
||||
};
|
||||
sniprun = callPackage ./sniprun { };
|
||||
|
||||
# The GitHub repository returns 404, which breaks the update script
|
||||
Spacegray-vim = buildVimPlugin {
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
rustPlatform,
|
||||
vimUtils,
|
||||
makeWrapper,
|
||||
bashInteractive,
|
||||
coreutils,
|
||||
curl,
|
||||
gnugrep,
|
||||
gnused,
|
||||
procps,
|
||||
}:
|
||||
let
|
||||
version = "1.3.16";
|
||||
src = fetchFromGitHub {
|
||||
owner = "michaelb";
|
||||
repo = "sniprun";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-2rVeBUkdLXUiHkd8slyiLTYQBKwgMQvIi/uyCToVBYA=";
|
||||
};
|
||||
sniprun-bin = rustPlatform.buildRustPackage {
|
||||
pname = "sniprun-bin";
|
||||
inherit version src;
|
||||
|
||||
cargoHash = "sha256-eZcWS+DWec0V9G6hBnZRUNcb3uZeSiBhn4Ed9KodFV8=";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/sniprun \
|
||||
--prefix PATH ${
|
||||
lib.makeBinPath [
|
||||
bashInteractive
|
||||
coreutils
|
||||
curl
|
||||
gnugrep
|
||||
gnused
|
||||
procps
|
||||
]
|
||||
}
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
};
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "sniprun";
|
||||
inherit version src;
|
||||
|
||||
patches = [ ./fix-paths.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace lua/sniprun.lua --replace '@sniprun_bin@' ${sniprun-bin}
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [ sniprun-bin ];
|
||||
|
||||
nvimRequireCheck = "sniprun";
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script {
|
||||
attrPath = "vimPlugins.sniprun.sniprun-bin";
|
||||
};
|
||||
|
||||
# needed for the update script
|
||||
inherit sniprun-bin;
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/michaelb/sniprun/";
|
||||
changelog = "https://github.com/michaelb/sniprun/blob/${src.tag}/CHANGELOG.md";
|
||||
maintainers = with lib.maintainers; [ GaetanLepage ];
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user