1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, setuptools
5, pam
6, six
7, toml
8}:
9
10buildPythonPackage rec {
11 pname = "python-pam";
12 version = "2.0.2";
13 format = "pyproject";
14
15 src = fetchFromGitHub {
16 owner = "FirefighterBlu3";
17 repo = pname;
18 rev = "refs/tags/v${version}";
19 sha256 = "sha256-MR9LYXtkbltAmn7yoyyKZn4yMHyh3rj/i/pA8nJy2xU=";
20 };
21
22 postPatch = ''
23 substituteInPlace src/pam/__internals.py \
24 --replace 'find_library("pam")' '"${pam}/lib/libpam.so"' \
25 --replace 'find_library("pam_misc")' '"${pam}/lib/libpam_misc.so"'
26 '';
27
28 nativeBuildInputs = [
29 setuptools
30 ];
31
32 buildInputs = [
33 pam
34 ];
35
36 propagatedBuildInputs = [
37 six
38 toml
39 ];
40
41 pythonImportsCheck = [ "pam" ];
42
43 meta = with lib; {
44 description = "Python pam module";
45 homepage = "https://github.com/FirefighterBlu3/python-pam";
46 license = licenses.mit;
47 maintainers = with maintainers; [ abbradar mkg20001 ];
48 };
49}