git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #29773 from Ma27/vim/install-hooks

vim-plugins: add install hooks

commitaea73202a43ee7c49f529fb84b5e686518a3b338 authorJörg Thalheim <Mic92@users.noreply.github.com> dateTue 26 Sep 2017, 07:48 (9 years ago) parent95f3e6c67a42ae
2 files changed+8−2
pkgs/misc/vim-plugins/default.nix+1−1 pkgs/misc/vim-plugins/vim-utils.nix+7−1
pkgs/misc/vim-plugins/default.nix+1−1
@@ -16,7 +16,7 @@ in
1616
1717# TL;DR
1818# Add your plugin to ./vim-plugin-names
19−# Regenerate via `nix-shell -p vimPlugins.pluginnames2nix --command "vim-plugin-names-to-nix"`
19+# Regenerate via `nix-shell -I nixpkgs=/path/to/your/local/fork -p vimPlugins.pluginnames2nix --command "vim-plugin-names-to-nix"`
2020# Copy the generated expression(s) into this file.
2121# If plugin is complicated then make changes to ./vim2nix/additional-nix-code
2222
pkgs/misc/vim-plugins/vim-utils.nix+7−1
@@ -383,6 +383,8 @@ rec {
383383 unpackPhase ? "",
384384 configurePhase ? "",
385385 buildPhase ? "",
386+ preInstall ? "",
387+ postInstall ? "",
386388 path ? (builtins.parseDrvName name).name,
387389 addonInfo ? null,
388390 ...
@@ -390,9 +392,11 @@ rec {
390392 addRtp "${rtpPath}/${path}" (stdenv.mkDerivation (a // {
391393 name = namePrefix + name;
392394
393− inherit unpackPhase configurePhase buildPhase addonInfo;
395+ inherit unpackPhase configurePhase buildPhase addonInfo preInstall postInstall;
394396
395397 installPhase = ''
398+ runHook preInstall
399+
396400 target=$out/${rtpPath}/${path}
397401 mkdir -p $out/${rtpPath}
398402 cp -r . $target
@@ -401,6 +405,8 @@ rec {
401405 if [ -n "$addonInfo" ]; then
402406 echo "$addonInfo" > $target/addon-info.json
403407 fi
408+
409+ runHook postInstall
404410 '';
405411 }));
406412