summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Byrne <salah.coronya@gmail.com>2022-09-23 16:41:21 -0500
committerSam James <sam@gentoo.org>2022-09-25 02:27:18 +0100
commit33109fcf44710cd15532a07a28c013542a81b738 (patch)
tree9012cb5b50acd3c86f7d9c9bcd650c62cb342a1f /app-crypt
parentdev-db/mariadb-connector-c: enable tests (diff)
downloadgentoo-33109fcf44710cd15532a07a28c013542a81b738.tar.gz
gentoo-33109fcf44710cd15532a07a28c013542a81b738.tar.bz2
gentoo-33109fcf44710cd15532a07a28c013542a81b738.zip
app-crypt/tpm2-tss-engine: Allow tests to compile under musl
Closes: https://bugs.gentoo.org/833531 Signed-off-by: Christopher Byrne <salah.coronya@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/27416 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/tpm2-tss-engine/files/tpm2-tss-engine-1.1.0-tests-Allow-compilation-under-musl.patch35
-rw-r--r--app-crypt/tpm2-tss-engine/tpm2-tss-engine-1.1.0-r2.ebuild47
2 files changed, 82 insertions, 0 deletions
diff --git a/app-crypt/tpm2-tss-engine/files/tpm2-tss-engine-1.1.0-tests-Allow-compilation-under-musl.patch b/app-crypt/tpm2-tss-engine/files/tpm2-tss-engine-1.1.0-tests-Allow-compilation-under-musl.patch
new file mode 100644
index 000000000000..b8114b4c25c0
--- /dev/null
+++ b/app-crypt/tpm2-tss-engine/files/tpm2-tss-engine-1.1.0-tests-Allow-compilation-under-musl.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/833531
+--- a/configure.ac
++++ b/configure.ac
+@@ -174,6 +174,8 @@ AC_ARG_WITH([device],
+ [with_device_set=no])
+ AM_CONDITIONAL([TESTDEVICE],[test "x$with_device_set" = xyes])
+
++AC_CHECK_FUNC([backtrace_symbols_fd],[AC_DEFINE([HAVE_EXECINFO],[1], ['Define to 1 if you have the <execinfo.h> header file.'])])
++
+ # Integration test with simulator
+ AS_IF([test "x$enable_integration" = xyes && test "x$with_device_set" = xno],
+ [integration_args=""
+--- a/test/error_tpm2-tss-engine-common.c
++++ b/test/error_tpm2-tss-engine-common.c
+@@ -7,7 +7,9 @@
+ #include "tpm2-tss-engine.h"
+ #include "tpm2-tss-engine-common.h"
+
++#ifdef HAVE_EXECINFO
+ #include <execinfo.h>
++#endif
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <setjmp.h>
+@@ -17,8 +19,10 @@ TSS2_RC
+ __wrap_Esys_Initialize()
+ {
+ printf("Esys_Initialize called\n");
++#ifdef HAVE_EXECINFO
+ void* b[128];
+ backtrace_symbols_fd(b, backtrace(b, sizeof(b)/sizeof(b[0])), STDOUT_FILENO);
++#endif
+ return -1;
+ }
+
diff --git a/app-crypt/tpm2-tss-engine/tpm2-tss-engine-1.1.0-r2.ebuild b/app-crypt/tpm2-tss-engine/tpm2-tss-engine-1.1.0-r2.ebuild
new file mode 100644
index 000000000000..c320b9d81d6f
--- /dev/null
+++ b/app-crypt/tpm2-tss-engine/tpm2-tss-engine-1.1.0-r2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools bash-completion-r1
+
+DESCRIPTION="OpenSSL Engine for TPM2 devices"
+HOMEPAGE="https://github.com/tpm2-software/tpm2-tss-engine"
+SRC_URI="https://github.com/tpm2-software/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="app-crypt/tpm2-tss:=
+ >=dev-libs/openssl-1.1.1:=
+ <dev-libs/openssl-3.0.0:="
+DEPEND="${RDEPEND}
+ test? ( dev-util/cmocka )"
+BDEPEND="sys-devel/autoconf-archive
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.0-tests-Allow-compilation-under-musl.patch"
+ )
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable test unit) \
+ --disable-defaultflags \
+ --disable-static \
+ --with-completionsdir="$(get_bashcompdir)"
+}
+
+src_install () {
+ default
+ find "${ED}" -name '*.la' -delete || die
+ dobashcomp bash-completion/*
+}