2020-04-24 23:36:52 +00:00
|
|
|
{ lua, writeText, toLuaModule }:
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
{ disabled ? false
|
|
|
|
, propagatedBuildInputs ? [ ]
|
|
|
|
, ...
|
|
|
|
} @ attrs:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
if disabled then
|
|
|
|
throw "${attrs.name} not supported by interpreter lua-${lua.luaversion}"
|
|
|
|
else
|
2021-01-05 17:05:55 +00:00
|
|
|
toLuaModule (lua.stdenv.mkDerivation (
|
2020-04-24 23:36:52 +00:00
|
|
|
{
|
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}"
|
|
|
|
"LUA_INC=-I${lua}/include"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
//
|
|
|
|
attrs
|
|
|
|
//
|
|
|
|
{
|
|
|
|
name = "lua${lua.luaversion}-" + attrs.name;
|
2021-01-05 17:05:55 +00:00
|
|
|
propagatedBuildInputs = propagatedBuildInputs ++ [
|
2020-04-24 23:36:52 +00:00
|
|
|
lua # propagate it for its setup-hook
|
|
|
|
];
|
|
|
|
}
|
2021-01-05 17:05:55 +00:00
|
|
|
))
|