Accepting request 1066386 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1066386
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-tpm2-pytss?expand=0&rev=4
This commit is contained in:
Dominique Leuenberger 2023-02-17 15:45:47 +00:00 committed by Git OBS Bridge
commit 7b13058015
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,35 @@
From 9bcd83905e5b7e718fe3787600f3ecf957c66430 Mon Sep 17 00:00:00 2001
From: Alberto Planas <aplanas@suse.com>
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 <aplanas@suse.com>
---
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")

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Feb 17 13:17:22 UTC 2023 - Alberto Planas Dominguez <aplanas@suse.com>
- Add fix_pycparse_float128.patch to fix issue in 32bits platforms
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Feb 16 15:30:10 UTC 2023 - aplanas@suse.com Thu Feb 16 15:30:10 UTC 2023 - aplanas@suse.com

View File

@ -27,6 +27,8 @@ Summary: Python bindings for TSS
License: BSD-2-Clause License: BSD-2-Clause
URL: https://github.com/tpm2-software/tpm2-pkcs11 URL: https://github.com/tpm2-software/tpm2-pkcs11
Source: %{srcname}-%{version}.tar.gz Source: %{srcname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix_pycparse_float128.patch gh#tpm2-software/tpm2-pytss#497
Patch0: fix_pycparse_float128.patch
BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module asn1crypto} BuildRequires: %{python_module asn1crypto}
BuildRequires: %{python_module cffi} BuildRequires: %{python_module cffi}