summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-pam/default.nix
blob: b19d2c623d0c40065442c35138754a2d9cb2f419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, pam
, six
, toml
}:

buildPythonPackage rec {
  pname = "python-pam";
  version = "2.0.2";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "FirefighterBlu3";
    repo = pname;
    rev = "refs/tags/v${version}";
    sha256 = "sha256-MR9LYXtkbltAmn7yoyyKZn4yMHyh3rj/i/pA8nJy2xU=";
  };

  postPatch = ''
    substituteInPlace src/pam/__internals.py \
      --replace 'find_library("pam")' '"${pam}/lib/libpam.so"' \
      --replace 'find_library("pam_misc")' '"${pam}/lib/libpam_misc.so"'
  '';

  nativeBuildInputs = [
    setuptools
  ];

  buildInputs = [
    pam
  ];

  propagatedBuildInputs = [
    six
    toml
  ];

  pythonImportsCheck = [ "pam" ];

  meta = with lib; {
    description = "Python pam module";
    homepage = "https://github.com/FirefighterBlu3/python-pam";
    license = licenses.mit;
    maintainers = with maintainers; [ abbradar mkg20001 ];
  };
}