kakounePlugins: add buildKakounePlugin helper

Same as buildVimPlugin but for Kakoune
This commit is contained in:
Flakebi 2021-01-04 00:35:24 +01:00
parent 3ad7ba46c5
commit 9ca73dd13f
No known key found for this signature in database
GPG Key ID: 38E7ED984D7DCD02
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,33 @@
{ lib, stdenv, rtpPath ? "share/kak/autoload/plugins" }:
rec {
buildKakounePlugin = attrs@{
name ? "${attrs.pname}-${attrs.version}",
namePrefix ? "kakplugin-",
src,
unpackPhase ? "",
configurePhase ? "",
buildPhase ? "",
preInstall ? "",
postInstall ? "",
path ? lib.getName name,
...
}:
stdenv.mkDerivation ((builtins.removeAttrs attrs [ "namePrefix" "path" ]) // {
name = namePrefix + name;
installPhase = ''
runHook preInstall
target=$out/${rtpPath}/${path}
mkdir -p $out/${rtpPath}
cp -r . $target
runHook postInstall
'';
});
buildKakounePluginFrom2Nix = attrs: buildKakounePlugin ({
buildPhase = ":";
configurePhase = ":";
} // attrs);
}

View File

@ -0,0 +1,4 @@
{ lib, stdenv }:
{
inherit (import ./build-kakoune-plugin.nix { inherit lib stdenv; }) buildKakounePlugin buildKakounePluginFrom2Nix;
}

View File

@ -5533,6 +5533,7 @@ in
kakoune = wrapKakoune kakoune-unwrapped {
plugins = [ ]; # override with the list of desired plugins
};
kakouneUtils = callPackage ../applications/editors/kakoune/plugins/kakoune-utils.nix { };
kak-lsp = callPackage ../tools/misc/kak-lsp {
inherit (darwin.apple_sdk.frameworks) Security;