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