biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / editors / neovim / build-neovim-plugin.nix
blob9d9778c1fe3b5ab7747f38c40fc5138910e7304a
1 { lib
2 , stdenv
3 , lua
4 , toVimPlugin
5 }:
6 let
7   # sanitizeDerivationName
8   normalizeName = lib.replaceStrings [ "." ] [ "-" ];
9 in
11   # function to create vim plugin from lua packages that are already packaged in
12   # luaPackages
13   {
14     # the lua attribute name that matches this vim plugin. Both should be equal
15     # in the majority of cases but we make it possible to have different attribute names
16     luaAttr ? (normalizeName attrs.pname)
17     , ...
18   }@attrs:
19     let
20       originalLuaDrv = lua.pkgs.${luaAttr};
22       luaDrv = originalLuaDrv.overrideAttrs (oa: {
23         version = attrs.version or oa.version;
24         rockspecVersion = oa.rockspecVersion;
26         extraConfig = ''
27           -- to create a flat hierarchy
28           lua_modules_path = "lua"
29         '';
30       });
32       finalDrv = toVimPlugin (luaDrv.overrideAttrs(oa: attrs // {
33           nativeBuildInputs = oa.nativeBuildInputs or [] ++ [
34             lua.pkgs.luarocksMoveDataFolder
35           ];
36           version = "${originalLuaDrv.version}-unstable-${oa.version}";
37         }));
38     in
39       finalDrv