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