1 { lib, stdenv, buildPackages, fetchurl
2 , flex, cracklib, db4, gettext, audit, libxcrypt
4 , autoreconfHook269, pkg-config-unwrapped
7 stdenv.mkDerivation rec {
12 url = "https://github.com/linux-pam/linux-pam/releases/download/v${version}/Linux-PAM-${version}.tar.xz";
13 hash = "sha256-+JI8dAFZBS1xnb/CovgZQtaN00/K9hxwagLJuA/u744=";
17 ./suid-wrapper-path.patch
20 # Case-insensitivity workaround for https://github.com/linux-pam/linux-pam/issues/569
21 postPatch = lib.optionalString (stdenv.buildPlatform.isDarwin && stdenv.buildPlatform != stdenv.hostPlatform) ''
26 outputs = [ "out" "doc" "man" /* "modules" */ ];
28 depsBuildBuild = [ buildPackages.stdenv.cc ];
29 # autoreconfHook269 is needed for `suid-wrapper-path.patch` above.
30 # pkg-config-unwrapped is needed for `AC_CHECK_LIB` and `AC_SEARCH_LIBS`
31 nativeBuildInputs = [ flex autoreconfHook269 pkg-config-unwrapped ]
32 ++ lib.optional stdenv.buildPlatform.isDarwin gettext;
34 buildInputs = [ cracklib db4 libxcrypt ]
35 ++ lib.optional stdenv.buildPlatform.isLinux audit;
37 enableParallelBuilding = true;
40 "--includedir=${placeholder "out"}/include/security"
41 "--enable-sconfigdir=/etc/security"
42 # The module is deprecated. We re-enable it explicitly until NixOS
43 # module stops using it.
48 "SCONFIGDIR=${placeholder "out"}/etc/security"
51 doCheck = false; # fails
54 inherit (nixosTests) pam-oath-login pam-u2f shadow sssd-ldap;
58 homepage = "http://www.linux-pam.org/";
59 description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
60 platforms = platforms.linux;
61 license = licenses.bsd3;