From 7710eed6d0a55f79bc28922a7aa7924b135a70a4 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Tue, 23 Feb 2021 04:50:13 +0000 Subject: [PATCH] pythonPackages.tpm2-pytss: init at 0.2.4 Signed-off-by: Arthur Gautier --- .../python-modules/tpm2-pytss/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/tpm2-pytss/default.nix diff --git a/pkgs/development/python-modules/tpm2-pytss/default.nix b/pkgs/development/python-modules/tpm2-pytss/default.nix new file mode 100644 index 000000000000..544c1a3084a6 --- /dev/null +++ b/pkgs/development/python-modules/tpm2-pytss/default.nix @@ -0,0 +1,41 @@ +{ lib, buildPythonPackage, fetchPypi, pythonOlder +, pkg-config, swig +, tpm2-tss +, cryptography, ibm-sw-tpm2 +}: + +buildPythonPackage rec { + pname = "tpm2-pytss"; + + # Last version on github is 0.2.4, but it looks + # like a mistake (it's missing commits from 0.1.9) + version = "0.1.9"; + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-v5Xth0A3tFnLFg54nvWYL2TD201e/GWv+2y5Qc60CmU="; + }; + postPatch = '' + substituteInPlace tpm2_pytss/config.py --replace \ + 'SYSCONFDIR = CONFIG.get("sysconfdir", "/etc")' \ + 'SYSCONFDIR = "${tpm2-tss}/etc"' + ''; + + nativeBuildInputs = [ pkg-config swig ]; + # The TCTI is dynamically loaded from tpm2-tss, we have to provide the library to the end-user + propagatedBuildInputs = [ tpm2-tss ]; + + checkInputs = [ + cryptography + # provide tpm_server used as simulator for the tests + ibm-sw-tpm2 + ]; + + meta = with lib; { + homepage = "https://github.com/tpm2-software/tpm2-pytss"; + description = "TPM2 TSS Python bindings for Enhanced System API (ESYS)"; + license = licenses.bsd2; + maintainers = with maintainers; [ baloo ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4ae605e1d3df..d00039c9e5c1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7944,6 +7944,8 @@ in { tox = callPackage ../development/python-modules/tox { }; + tpm2-pytss = callPackage ../development/python-modules/tpm2-pytss { }; + tqdm = callPackage ../development/python-modules/tqdm { }; traceback2 = callPackage ../development/python-modules/traceback2 { };