lua{54,Jit}Packages.lua-pam: mark as broken

Removes the roll-your-own-broken-attribute that `disabled` was. The
advantage of `meta.broken`: It can be caught and properly handled by CI,
while the custom `throw` can not.
This commit is contained in:
Wolfgang Walther 2025-07-18 22:03:52 +02:00
parent 9255558c37
commit 236cf1200e
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
2 changed files with 18 additions and 25 deletions

View File

@ -5,31 +5,27 @@
}:
{
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;
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;
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
];
}
)
propagatedBuildInputs = propagatedBuildInputs ++ [
lua # propagate it for its setup-hook
];
}
)
)

View File

@ -121,8 +121,6 @@ rec {
buildLuaPackage rec {
pname = "lua-pam";
version = "unstable-2015-07-03";
# Needed for `disabled`, overridden in buildLuaPackage
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "devurandom";
@ -147,10 +145,9 @@ rec {
runHook postInstall
'';
# The package does not build with lua 5.4 or luaJIT
disabled = luaAtLeast "5.4" || isLuaJIT;
meta = with lib; {
# The package does not build with lua 5.4 or luaJIT
broken = luaAtLeast "5.4" || isLuaJIT;
description = "Lua module for PAM authentication";
homepage = "https://github.com/devurandom/lua-pam";
license = licenses.mit;