summaryrefslogtreecommitdiff
path: root/dev-python/tpm2-pytss
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-04-19 08:46:18 +0100
committerV3n3RiX <venerix@koprulu.sector>2025-04-19 08:46:18 +0100
commit9e65a38a260a44292ceb8a0bf4fea5f0b5666826 (patch)
tree40c907f5d72cda463e42d2ee5d5434b3790e06df /dev-python/tpm2-pytss
parentcf1a411e806b434c96329401a6ff0901ec7f0d5c (diff)
gentoo auto-resync : 19:04:2025 - 08:46:17edge
Diffstat (limited to 'dev-python/tpm2-pytss')
-rw-r--r--dev-python/tpm2-pytss/Manifest2
-rw-r--r--dev-python/tpm2-pytss/files/tpm2-pytss-2.3.0-use-CC-enviromental-variable.patch54
-rw-r--r--dev-python/tpm2-pytss/tpm2-pytss-2.3.0-r1.ebuild48
3 files changed, 104 insertions, 0 deletions
diff --git a/dev-python/tpm2-pytss/Manifest b/dev-python/tpm2-pytss/Manifest
index e91e59f29e10..9abc9458003d 100644
--- a/dev-python/tpm2-pytss/Manifest
+++ b/dev-python/tpm2-pytss/Manifest
@@ -1,4 +1,6 @@
AUX tpm2-pytss-2.3.0-preprocess-as-C99.patch 897 BLAKE2B 7be1b909b918ac4506ff9db90a2803b5a3f60c482785774a50c8647d11d3a3f871482a23dedcb9f0db0bd547aa15a60ca3178535230fd5a42153d79788ca87a3 SHA512 bf7a08edf2e18cdae0d2fa2d024b095c9880a941b09a00b2cd10c2a66d3cfc1c5db545ac54615b072d50c1da8eee4a3342f652e7bf219d9f0ef94195a7bd8601
+AUX tpm2-pytss-2.3.0-use-CC-enviromental-variable.patch 1891 BLAKE2B a53f63a48fed39a890c483592cf38e88fb995d227c9076e830d6adf6ce287e30f7cd64f264442b2a78ee7fc512a6ea2c60ea355171baa402b340707b4d852df3 SHA512 610b958340a7170ba1ac75c6a04bd92d49fcaaa2d2f7a5fdeecf750c51b2958d4d45ca7f7210842072a353f7e0c817cc3d66f4459fc8be1af7f9a436e95c27e1
DIST tpm2-pytss-2.3.0.tar.gz 213848 BLAKE2B 7e9264ab53cfe666991150fe2c0efdd973f7b58b4968b557d6494156ba4d362bd147f580f2ef50b85ac1b43cd9fc4921d71eea42d5a14b9379f82d45b6a6b536 SHA512 d0f76aec77afa773ec0ed7878a0ca4ef3b3475aa64f219d7a5afd89cbca795457536b0a9b5ffa14704200dcb35a89df36f9fc799694f7cc3cfbf98ea551628b1
+EBUILD tpm2-pytss-2.3.0-r1.ebuild 1066 BLAKE2B 8b730a79b3f0c1b37fb88b9d362f82ffa1a0f70d7a7dfcd14651a623905a254ee757bf5b00e91806129bb042331aac0c147ca5a600230fc02b0df3c760946516 SHA512 5b88420639c6f44318ad5c220037476b9db78f3eaa4fa629ccb8454c79bf190fc11fdc3d774df06f07cf29e0a5bce9c5a370a7e08f64ae2e4f73c633b2595689
EBUILD tpm2-pytss-2.3.0.ebuild 1004 BLAKE2B bea7c9d373d1076386a49756b4c6db831f922a514d8d35146eec5b2e9a7dac510fbdac5aa8b6ea37fce07598bff34fbd02aa93d0db2e9cddce57936dd6a8aaf6 SHA512 d6d046900dfaa88abb9fb92c4b9ae7579fe1b95a7156ee57b4a67988642a7bc8919a3f16ad0b138d21a00ccc9cd214244a3e2bafbaf6eea4c5c7e1c986de447d
MISC metadata.xml 648 BLAKE2B e4de9aae579210454f1a71043de7073c1aa7ead9c5acdea48ec2c8ebf5665ebb6837f198b6de49f7ae58bd1f5062ed4f8ca7092df56d8904aecd16bc226d95cd SHA512 dd87ec10b28530281c08d57d86a5004178e4eda729a43690ad4ab84effe246b34d777ec56c66d61a1e0335d2b9c1599366aa55bc58477f7c2dfa4eec5ab7d9ac
diff --git a/dev-python/tpm2-pytss/files/tpm2-pytss-2.3.0-use-CC-enviromental-variable.patch b/dev-python/tpm2-pytss/files/tpm2-pytss-2.3.0-use-CC-enviromental-variable.patch
new file mode 100644
index 000000000000..9e7de8ef7c03
--- /dev/null
+++ b/dev-python/tpm2-pytss/files/tpm2-pytss-2.3.0-use-CC-enviromental-variable.patch
@@ -0,0 +1,54 @@
+diff --git a/setup.py b/setup.py
+index 0e6208f..eec85ad 100644
+--- a/setup.py
++++ b/setup.py
+@@ -20,6 +20,14 @@ from textwrap import dedent
+ site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
+
+
++def cpp_path():
++ return os.environ.get("CC", "cc")
++
++
++def cpp_args(args=[]):
++ return ["-E"] + args
++
++
+ class type_generator(build_ext):
+ cares = set(
+ (
+@@ -184,7 +192,9 @@ class type_generator(build_ext):
+ f"unable to find tss2_tpm2_types.h in {pk['include_dirs']}"
+ )
+ pdata = preprocess_file(
+- header_path, cpp_args=["-std=c99", "-D__extension__=", "-D__attribute__(x)="]
++ header_path,
++ cpp_path=cpp_path(),
++ cpp_args=cpp_args(["-std=c99", "-D__extension__=", "-D__attribute__(x)="]),
+ )
+ parser = c_parser.CParser()
+ ast = parser.parse(pdata, "tss2_tpm2_types.h")
+@@ -204,13 +214,16 @@ class type_generator(build_ext):
+ if policy_header_path:
+ pdata = preprocess_file(
+ policy_header_path,
+- cpp_args=[
+- "-std=c99",
+- "-D__extension__=",
+- "-D__attribute__(x)=",
+- "-D__float128=long double",
+- "-D_FORTIFY_SOURCE=0",
+- ],
++ cpp_path=cpp_path(),
++ cpp_args=cpp_args(
++ [
++ "-std=c99",
++ "-D__extension__=",
++ "-D__attribute__(x)=",
++ "-D__float128=long double",
++ "-D_FORTIFY_SOURCE=0",
++ ]
++ ),
+ )
+ parser = c_parser.CParser()
+ past = parser.parse(pdata, "tss2_policy.h")
diff --git a/dev-python/tpm2-pytss/tpm2-pytss-2.3.0-r1.ebuild b/dev-python/tpm2-pytss/tpm2-pytss-2.3.0-r1.ebuild
new file mode 100644
index 000000000000..73f5f426f8af
--- /dev/null
+++ b/dev-python/tpm2-pytss/tpm2-pytss-2.3.0-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYPI_NO_NORMALIZE=1
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Python bindings for TSS"
+HOMEPAGE="
+ https://pypi.org/project/tpm2-pytss/
+ https://github.com/tpm2-software/tpm2-pytss/
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+fapi test"
+
+DEPEND="
+ app-crypt/tpm2-tss:=[fapi=]
+ fapi? ( >=app-crypt/tpm2-tss-3.0.3:= )
+ test? ( app-crypt/swtpm )
+"
+RDEPEND="${DEPEND}
+ dev-python/cffi[${PYTHON_USEDEP}]
+ dev-python/asn1crypto[${PYTHON_USEDEP}]
+ dev-python/cryptography[${PYTHON_USEDEP}]
+ dev-python/pycparser[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ dev-python/pkgconfig[${PYTHON_USEDEP}]
+ dev-python/setuptools-scm[${PYTHON_USEDEP}]
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.3.0-preprocess-as-C99.patch"
+ "${FILESDIR}/${PN}-2.3.0-use-CC-enviromental-variable.patch"
+ )
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+
+distutils_enable_tests pytest