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 = "2.1.0";
22 format = "setuptools";
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchPypi {
27 inherit pname version;
28 hash = "sha256-W1tLFFb9wa7vPSw5cL6qB4yPfyZIyXppvPYMWi+VyJc=";
29 };
30
31 nativeBuildInputs = [
32 cffi
33 pkgconfig # this is the Python module
34 pkg-config # this is the actual pkg-config tool
35 setuptools-scm
36 ];
37
38 buildInputs = [
39 tpm2-tss
40 ];
41
42 propagatedBuildInputs = [
43 cffi
44 asn1crypto
45 cryptography
46 pyyaml
47 ];
48
49 # https://github.com/tpm2-software/tpm2-pytss/issues/341
50 doCheck = false;
51
52 nativeCheckInputs = [
53 ibm-sw-tpm2
54 pytestCheckHook
55 ];
56
57 pythonImportsCheck = [
58 "tpm2_pytss"
59 ];
60
61 meta = with lib; {
62 homepage = "https://github.com/tpm2-software/tpm2-pytss";
63 changelog = "https://github.com/tpm2-software/tpm2-pytss/blob/${version}/CHANGELOG.md";
64 description = "TPM2 TSS Python bindings for Enhanced System API (ESYS)";
65 license = licenses.bsd2;
66 maintainers = with maintainers; [ baloo ];
67 };
68}