depot/third_party/nixpkgs/pkgs/development/lua-modules/generic/default.nix
Default email 6d4aeb4377 Project import generated by Copybara.
GitOrigin-RevId: 0f213d0fee84280d8c3a97f7469b988d6fe5fcdf
2023-01-11 08:51:40 +01:00

27 lines
666 B
Nix

{ lua, writeText, toLuaModule }:
{ disabled ? false
, propagatedBuildInputs ? [ ]
, makeFlags ? [ ]
, ...
} @ attrs:
if disabled then
throw "${attrs.name} not supported by interpreter lua-${lua.luaversion}"
else
toLuaModule (lua.stdenv.mkDerivation (
attrs // {
name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version;
makeFlags = [
"PREFIX=$(out)"
"LUA_INC=-I${lua}/include"
"LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}"
"LUA_VERSION=${lua.luaversion}"
] ++ makeFlags;
propagatedBuildInputs = propagatedBuildInputs ++ [
lua # propagate it for its setup-hook
];
}
))