forked from mirrors/nixpkgs
Merge pull request #29773 from Ma27/vim/install-hooks
vim-plugins: add install hooks
This commit is contained in:
commit
aea73202a4
|
@ -16,7 +16,7 @@ in
|
||||||
|
|
||||||
# TL;DR
|
# TL;DR
|
||||||
# Add your plugin to ./vim-plugin-names
|
# Add your plugin to ./vim-plugin-names
|
||||||
# Regenerate via `nix-shell -p vimPlugins.pluginnames2nix --command "vim-plugin-names-to-nix"`
|
# Regenerate via `nix-shell -I nixpkgs=/path/to/your/local/fork -p vimPlugins.pluginnames2nix --command "vim-plugin-names-to-nix"`
|
||||||
# Copy the generated expression(s) into this file.
|
# Copy the generated expression(s) into this file.
|
||||||
# If plugin is complicated then make changes to ./vim2nix/additional-nix-code
|
# If plugin is complicated then make changes to ./vim2nix/additional-nix-code
|
||||||
|
|
||||||
|
|
|
@ -383,6 +383,8 @@ rec {
|
||||||
unpackPhase ? "",
|
unpackPhase ? "",
|
||||||
configurePhase ? "",
|
configurePhase ? "",
|
||||||
buildPhase ? "",
|
buildPhase ? "",
|
||||||
|
preInstall ? "",
|
||||||
|
postInstall ? "",
|
||||||
path ? (builtins.parseDrvName name).name,
|
path ? (builtins.parseDrvName name).name,
|
||||||
addonInfo ? null,
|
addonInfo ? null,
|
||||||
...
|
...
|
||||||
|
@ -390,9 +392,11 @@ rec {
|
||||||
addRtp "${rtpPath}/${path}" (stdenv.mkDerivation (a // {
|
addRtp "${rtpPath}/${path}" (stdenv.mkDerivation (a // {
|
||||||
name = namePrefix + name;
|
name = namePrefix + name;
|
||||||
|
|
||||||
inherit unpackPhase configurePhase buildPhase addonInfo;
|
inherit unpackPhase configurePhase buildPhase addonInfo preInstall postInstall;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
target=$out/${rtpPath}/${path}
|
target=$out/${rtpPath}/${path}
|
||||||
mkdir -p $out/${rtpPath}
|
mkdir -p $out/${rtpPath}
|
||||||
cp -r . $target
|
cp -r . $target
|
||||||
|
@ -401,6 +405,8 @@ rec {
|
||||||
if [ -n "$addonInfo" ]; then
|
if [ -n "$addonInfo" ]; then
|
||||||
echo "$addonInfo" > $target/addon-info.json
|
echo "$addonInfo" > $target/addon-info.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue