2020-04-24 23:36:52 +00:00
|
|
|
{ lua, writeText, toLuaModule }:
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
{ disabled ? false
|
|
|
|
, propagatedBuildInputs ? [ ]
|
2023-01-11 07:51:40 +00:00
|
|
|
, makeFlags ? [ ]
|
2021-01-05 17:05:55 +00:00
|
|
|
, ...
|
|
|
|
} @ 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 (
|
2023-01-11 07:51:40 +00:00
|
|
|
attrs // {
|
|
|
|
name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LUA_INC=-I${lua}/include"
|
2023-01-11 07:51:40 +00:00
|
|
|
"LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}"
|
|
|
|
"LUA_VERSION=${lua.luaversion}"
|
|
|
|
] ++ makeFlags;
|
|
|
|
|
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
|
|
|
))
|