diff --git a/python-tpm2-pytss-2.1.0-i686.patch b/python-tpm2-pytss-2.1.0-i686.patch new file mode 100644 index 0000000..963384b --- /dev/null +++ b/python-tpm2-pytss-2.1.0-i686.patch @@ -0,0 +1,36 @@ +From 916c47ef6c30c2c6688f207bb780a2f4e6ef5384 Mon Sep 17 00:00:00 2001 +From: Alberto Planas +Date: Fri, 17 Feb 2023 13:58:18 +0100 +Subject: [PATCH] setup: define __float128 for pycparse + +When compiling in 32bit stddef.h makes use of the __float128 type, that +pycparse cannot recognize. + +This patch define the type as "long double", fixing the issue in 32bits +platforms. + +Fix #497 + +Signed-off-by: Alberto Planas +--- + setup.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 17736597..4554db0b 100644 +--- a/setup.py ++++ b/setup.py +@@ -204,7 +204,11 @@ def get_mappings(self): + if policy_header_path: + pdata = preprocess_file( + policy_header_path, +- cpp_args=["-D__extension__=", "-D__attribute__(x)="], ++ cpp_args=[ ++ "-D__extension__=", ++ "-D__attribute__(x)=", ++ "-D__float128=long double", ++ ], + ) + parser = c_parser.CParser() + past = parser.parse(pdata, "tss2_policy.h") + diff --git a/python-tpm2-pytss.spec b/python-tpm2-pytss.spec index 933d54a..138eaf4 100644 --- a/python-tpm2-pytss.spec +++ b/python-tpm2-pytss.spec @@ -10,8 +10,8 @@ License: BSD-2-Clause URL: https://github.com/tpm2-software/tpm2-pytss Source: %{pypi_source %{pypi_name}} Patch0: python-tpm2-pytss-1.2.0-openssl.patch - -ExcludeArch: i686 +# https://github.com/tpm2-software/tpm2-pytss/commit/916c47ef6c30c2c6688f207bb780a2f4e6ef5384 +Patch1: python-tpm2-pytss-2.1.0-i686.patch BuildRequires: python3-devel BuildRequires: python3-pytest