1{ lua, writeText, toLuaModule }:
2
3{ disabled ? false
4, propagatedBuildInputs ? [ ]
5, ...
6} @ attrs:
7
8if disabled then
9 throw "${attrs.name} not supported by interpreter lua-${lua.luaversion}"
10else
11 toLuaModule (lua.stdenv.mkDerivation (
12 {
13 makeFlags = [
14 "PREFIX=$(out)"
15 "LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}"
16 "LUA_INC=-I${lua}/include"
17 ];
18 }
19 //
20 attrs
21 //
22 {
23 name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version;
24 propagatedBuildInputs = propagatedBuildInputs ++ [
25 lua # propagate it for its setup-hook
26 ];
27 }
28 ))