2019-01-30 14:13:15 +00:00
|
|
|
{ lua, writeText, toLuaModule }:
|
2014-09-19 19:40:37 +00:00
|
|
|
|
2021-01-03 13:03:30 +00:00
|
|
|
{ disabled ? false
|
|
|
|
, propagatedBuildInputs ? [ ]
|
2022-12-19 07:42:26 +00:00
|
|
|
, makeFlags ? [ ]
|
2021-01-03 13:03:30 +00:00
|
|
|
, ...
|
|
|
|
} @ attrs:
|
2014-09-19 19:40:37 +00:00
|
|
|
|
2014-09-23 10:09:36 +00:00
|
|
|
if disabled then
|
|
|
|
throw "${attrs.name} not supported by interpreter lua-${lua.luaversion}"
|
|
|
|
else
|
2021-01-03 13:03:30 +00:00
|
|
|
toLuaModule (lua.stdenv.mkDerivation (
|
2022-12-19 07:42:26 +00:00
|
|
|
attrs // {
|
|
|
|
name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version;
|
|
|
|
|
2017-09-30 14:36:10 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LUA_INC=-I${lua}/include"
|
2022-12-19 07:42:26 +00:00
|
|
|
"LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}"
|
|
|
|
"LUA_VERSION=${lua.luaversion}"
|
|
|
|
] ++ makeFlags;
|
|
|
|
|
2021-01-03 13:03:30 +00:00
|
|
|
propagatedBuildInputs = propagatedBuildInputs ++ [
|
2019-08-21 13:03:11 +00:00
|
|
|
lua # propagate it for its setup-hook
|
|
|
|
];
|
2014-09-23 10:09:36 +00:00
|
|
|
}
|
2021-01-03 13:03:30 +00:00
|
|
|
))
|