1{
2 lib,
3 stdenv,
4 fetchgit,
5 cmake,
6 linux-pam,
7 replaceVars,
8 enablePython ? false,
9 python ? null,
10}:
11
12assert enablePython -> python != null;
13
14stdenv.mkDerivation rec {
15 pname = "libpam-wrapper";
16 version = "1.1.5";
17
18 src = fetchgit {
19 url = "git://git.samba.org/pam_wrapper.git";
20 rev = "pam_wrapper-${version}";
21 hash = "sha256-AtfkiCUvCxUfll6lOlbMyy5AhS5R2BGF1+ecC1VuwzM=";
22 };
23
24 patches = [
25 (replaceVars ./python.patch {
26 siteDir = lib.optionalString enablePython python.sitePackages;
27 includeDir = lib.optionalString enablePython "include/${python.libPrefix}";
28 })
29 ];
30
31 nativeBuildInputs = [ cmake ] ++ lib.optionals enablePython [ python ];
32
33 # We must use linux-pam, using openpam will result in broken fprintd.
34 buildInputs = [ linux-pam ];
35
36 meta = with lib; {
37 description = "Wrapper for testing PAM modules";
38 homepage = "https://cwrap.org/pam_wrapper.html";
39 license = licenses.gpl3Plus;
40 maintainers = [ ];
41 platforms = platforms.linux;
42 };
43}