1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, asn1crypto
6, cffi
7, cryptography
8, ibm-sw-tpm2
9, pkgconfig # see nativeBuildInputs
10, pkg-config # see nativeBuildInputs
11, pycparser
12, pytestCheckHook
13, python
14, pyyaml
15, setuptools-scm
16, tpm2-tss
17}:
18
19buildPythonPackage rec {
20 pname = "tpm2-pytss";
21 version = "1.2.0";
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 inherit pname version;
26 sha256 = "sha256-OgWWTjcj3Qd4dSaCwY+fuRQpLSFn4+9o11kPR9n8a54=";
27 };
28
29 nativeBuildInputs = [
30 cffi
31 pkgconfig # this is the python module
32 pkg-config # this is the actual pkg-config tool
33 setuptools-scm
34 ];
35
36 buildInputs = [
37 tpm2-tss
38 ];
39
40 propagatedBuildInputs = [
41 cffi
42 asn1crypto
43 cryptography
44 pyyaml
45 ];
46
47 # https://github.com/tpm2-software/tpm2-pytss/issues/341
48 doCheck = false;
49
50 checkInputs = [
51 ibm-sw-tpm2
52 pytestCheckHook
53 ];
54
55 pythonImportsCheck = [ "tpm2_pytss" ];
56
57 meta = with lib; {
58 homepage = "https://github.com/tpm2-software/tpm2-pytss";
59 description = "TPM2 TSS Python bindings for Enhanced System API (ESYS)";
60 license = licenses.bsd2;
61 maintainers = with maintainers; [ baloo ];
62 };
63}