buildLuarocksPackage: ability to self reference extraConfig (#288253)

makes overrideAttrs for lua packages even more powerful.
As a consequence, it simplifies the implementation of buildNeovimPlugin.
This commit is contained in:
Matthieu Coudron
2024-02-12 18:11:24 +01:00
committed by GitHub
parent f9874c4b8c
commit 000b7bfd47
2 changed files with 6 additions and 6 deletions
@@ -19,14 +19,14 @@ in
let
originalLuaDrv = lua.pkgs.${luaAttr};
luaDrv = (lua.pkgs.luaLib.overrideLuarocks originalLuaDrv (drv: {
luaDrv = originalLuaDrv.overrideAttrs (oa: {
version = attrs.version or oa.version;
rockspecVersion = oa.rockspecVersion;
extraConfig = ''
-- to create a flat hierarchy
lua_modules_path = "lua"
'';
})).overrideAttrs (drv: {
version = attrs.version or drv.version;
rockspecVersion = drv.rockspecVersion;
});
finalDrv = toVimPlugin (luaDrv.overrideAttrs(oa: attrs // {
@@ -92,7 +92,7 @@ let
luarocks
];
inherit doCheck extraVariables rockspecFilename knownRockspec externalDeps nativeCheckInputs;
inherit doCheck extraConfig extraVariables rockspecFilename knownRockspec externalDeps nativeCheckInputs;
buildInputs = let
# example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ]
@@ -131,7 +131,7 @@ let
in
''
${generatedConfig}
${extraConfig}
${self.extraConfig}
'';
configurePhase = ''