mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-21 20:49:52 +03:00
Merge pull request #245962 from baloo/baloo/tpm2-pytss/enable-tests
python3Packages.tpm2-pytss: enable tests
This commit is contained in:
commit
fbacd47118
@ -6,7 +6,6 @@
|
||||
, asn1crypto
|
||||
, cffi
|
||||
, cryptography
|
||||
, ibm-sw-tpm2
|
||||
, pkgconfig # see nativeBuildInputs
|
||||
, pkg-config # see nativeBuildInputs
|
||||
, pycparser
|
||||
@ -15,6 +14,8 @@
|
||||
, pyyaml
|
||||
, setuptools-scm
|
||||
, tpm2-tss
|
||||
, tpm2-tools
|
||||
, swtpm
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@ -40,8 +41,22 @@ buildPythonPackage rec {
|
||||
url = "https://github.com/baloo/tpm2-pytss/commit/099c069f28cfcd0a3019adebfeafa976f9395221.patch";
|
||||
sha256 = "sha256-wU2WfLYFDmkhGzYornZ386tB3zb3GYfGOTc+/QOFb1o=";
|
||||
})
|
||||
|
||||
# Lookup tcti via getinfo not system's ld_library_path
|
||||
# https://github.com/tpm2-software/tpm2-pytss/pull/525
|
||||
(fetchpatch {
|
||||
url = "https://github.com/tpm2-software/tpm2-pytss/commit/97289a08ddf44f7bdccdd122d6055c69e12dc584.patch";
|
||||
sha256 = "sha256-VFq3Hv4I8U8ifP/aSjyu0BiW/4jfPlRDKqRcqUGw6UQ=";
|
||||
})
|
||||
|
||||
# Fix hardcoded `fapi-config.json` configuration path
|
||||
./fapi-config.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i "s#@TPM2_TSS@#${tpm2-tss.out}#" src/tpm2_pytss/FAPI.py
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cffi
|
||||
pkgconfig # this is the Python module
|
||||
@ -60,12 +75,12 @@ buildPythonPackage rec {
|
||||
pyyaml
|
||||
];
|
||||
|
||||
# https://github.com/tpm2-software/tpm2-pytss/issues/341
|
||||
doCheck = false;
|
||||
doCheck = true;
|
||||
|
||||
nativeCheckInputs = [
|
||||
ibm-sw-tpm2
|
||||
pytestCheckHook
|
||||
tpm2-tools
|
||||
swtpm
|
||||
];
|
||||
|
||||
pythonImportsCheck = [
|
||||
|
12
pkgs/development/python-modules/tpm2-pytss/fapi-config.patch
Normal file
12
pkgs/development/python-modules/tpm2-pytss/fapi-config.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/src/tpm2_pytss/FAPI.py b/src/tpm2_pytss/FAPI.py
|
||||
index 916eda6..1afba3f 100644
|
||||
--- a/src/tpm2_pytss/FAPI.py
|
||||
+++ b/src/tpm2_pytss/FAPI.py
|
||||
@@ -23,6 +23,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
FAPI_CONFIG_ENV = "TSS2_FAPICONF"
|
||||
FAPI_CONFIG_PATHS = [
|
||||
+ "@TPM2_TSS@/etc/tpm2-tss/fapi-config.json",
|
||||
"/etc/tpm2-tss/fapi-config.json",
|
||||
"/usr/local/etc/tpm2-tss/fapi-config.json",
|
||||
]
|
Loading…
Reference in New Issue
Block a user