shadow: disable libbsd when unavailable

libbsd is not supported on all architectures, e.g. microblaze.

Changed files
+5 -2
pkgs
os-specific
linux
shadow
+5 -2
pkgs/os-specific/linux/shadow/default.nix
···
, runtimeShell, nixosTests
, autoreconfHook, bison, flex
, docbook_xml_dtd_45, docbook_xsl
-
, itstool, libbsd, libxml2, libxslt
+
, itstool, libxml2, libxslt
, libxcrypt, pkg-config
, glibcCross ? null
, pam ? null
+
, withLibbsd ? lib.meta.availableOn stdenv.hostPlatform libbsd, libbsd
, withTcb ? lib.meta.availableOn stdenv.hostPlatform tcb, tcb
}:
let
···
pkg-config
];
-
buildInputs = [ libbsd libxcrypt ]
+
buildInputs = [ libxcrypt ]
++ lib.optional (pam != null && stdenv.isLinux) pam
+
++ lib.optional withLibbsd libbsd
++ lib.optional withTcb tcb;
patches = [
···
"--with-group-name-max-length=32"
"--with-bcrypt"
"--with-yescrypt"
+
(lib.withFeature withLibbsd "libbsd")
] ++ lib.optional (stdenv.hostPlatform.libc != "glibc") "--disable-nscd"
++ lib.optional withTcb "--with-tcb";