2021-01-03 23:35:24 +00:00
|
|
|
{ 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 ({
|
2021-07-18 22:42:48 +01:00
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
2021-01-03 23:35:24 +00:00
|
|
|
} // attrs);
|
|
|
|
}
|