Skip to content

Commit

Permalink
dev-python/tpm2-pytss: Fix compile under gcc-15
Browse files Browse the repository at this point in the history
Added a patch to force "-std=c99" when preprocessing. As pcyparser only
supports completely C99, this shouldn't be an issue

Closes: https://bugs.gentoo.org/943997
Closes: https://bugs.gentoo.org/945056
Signed-off-by: Christopher Byrne <[email protected]>
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
salahcoronya authored and thesamesam committed Dec 2, 2024
1 parent 164a168 commit bd60fb0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/setup.py b/setup.py
index 1b5f513..0e6208f 100644
--- a/setup.py
+++ b/setup.py
@@ -184,7 +184,7 @@ class type_generator(build_ext):
f"unable to find tss2_tpm2_types.h in {pk['include_dirs']}"
)
pdata = preprocess_file(
- header_path, cpp_args=["-D__extension__=", "-D__attribute__(x)="]
+ header_path, cpp_args=["-std=c99", "-D__extension__=", "-D__attribute__(x)="]
)
parser = c_parser.CParser()
ast = parser.parse(pdata, "tss2_tpm2_types.h")
@@ -205,6 +205,7 @@ class type_generator(build_ext):
pdata = preprocess_file(
policy_header_path,
cpp_args=[
+ "-std=c99",
"-D__extension__=",
"-D__attribute__(x)=",
"-D__float128=long double",
4 changes: 4 additions & 0 deletions dev-python/tpm2-pytss/tpm2-pytss-2.3.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ BDEPEND="
dev-python/setuptools-scm[${PYTHON_USEDEP}]
"

PATCHES=(
"${FILESDIR}/${PN}-2.3.0-preprocess-as-C99.patch"
)

export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}

distutils_enable_tests pytest

0 comments on commit bd60fb0

Please sign in to comment.