`buildDotnetModule`: add support for installing pre-release tools (#374663)
[NixPkgs.git] / pkgs / applications / editors / vim / plugins / build-vim-plugin.nix
blobac5fb20e183b537885da17831e383b0bd4df58c8
2   lib,
3   stdenv,
4   rtpPath,
5   toVimPlugin,
6 }:
9   addRtp = drv: lib.warn "`addRtp` is deprecated, does nothing." drv;
11   buildVimPlugin =
12     {
13       name ? "${attrs.pname}-${attrs.version}",
14       src,
15       unpackPhase ? "",
16       configurePhase ? ":",
17       buildPhase ? ":",
18       preInstall ? "",
19       postInstall ? "",
20       path ? ".",
21       addonInfo ? null,
22       meta ? { },
23       ...
24     }@attrs:
25     let
26       drv = stdenv.mkDerivation (
27         attrs
28         // {
29           name = lib.warnIf (attrs ? vimprefix) "The 'vimprefix' is now hardcoded in toVimPlugin" name;
31           __structuredAttrs = true;
32           inherit
33             unpackPhase
34             configurePhase
35             buildPhase
36             addonInfo
37             preInstall
38             postInstall
39             ;
41           installPhase = ''
42             runHook preInstall
44             target=$out/${rtpPath}/${path}
45             mkdir -p $out/${rtpPath}
46             cp -r . $target
48             runHook postInstall
49           '';
51           meta = {
52             platforms = lib.platforms.all;
53           } // meta;
54         }
55       );
56     in
57     toVimPlugin drv;