commit:     b239ccbe1e3cf5b397e1303fecb2ebf57bd35570
Author:     Christopher Byrne <salah.coronya <AT> gmail <DOT> com>
AuthorDate: Tue Mar 29 03:22:43 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Apr 14 08:54:34 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b239ccbe

app-crypt/swtpm: Fix conditional patching

Signed-off-by: Christopher Byrne <salah.coronya <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/24797
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../swtpm-0.5.0-disable-test-dependencies.patch    | 26 --------------
 ...pm-0.7.2-Conditionalize-test-dependencies.patch | 42 ++++++++++++++++++++++
 app-crypt/swtpm/swtpm-0.7.2.ebuild                 |  5 +--
 3 files changed, 45 insertions(+), 28 deletions(-)

diff --git a/app-crypt/swtpm/files/swtpm-0.5.0-disable-test-dependencies.patch 
b/app-crypt/swtpm/files/swtpm-0.5.0-disable-test-dependencies.patch
deleted file mode 100644
index 3880385256e3..000000000000
--- a/app-crypt/swtpm/files/swtpm-0.5.0-disable-test-dependencies.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index d035653..0728a2e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -325,21 +325,11 @@ fi
- AM_CONDITIONAL([WITH_GNUTLS], [test "x$with_gnutls" = "xyes"])
- AC_SUBST([GNUTLS_LIBS])
- 
--AC_PATH_PROG([EXPECT], expect)
--if test "x$EXPECT" = "x"; then
--      AC_MSG_ERROR([expect is required: expect package])
--fi
--
- AC_PATH_PROG([GAWK], gawk)
- if test "x$GAWK" = "x"; then
-       AC_MSG_ERROR([gawk is required: gawk package])
- fi
- 
--AC_PATH_PROG([SOCAT], socat)
--if test "x$SOCAT" = "x"; then
--      AC_MSG_ERROR([socat is required: socat package])
--fi
--
- AC_PATH_PROG([BASE64], base64)
- if test "x$BASE64" = "x"; then
-       AC_MSG_ERROR([base64 is required: base64 package])

diff --git 
a/app-crypt/swtpm/files/swtpm-0.7.2-Conditionalize-test-dependencies.patch 
b/app-crypt/swtpm/files/swtpm-0.7.2-Conditionalize-test-dependencies.patch
new file mode 100644
index 000000000000..b17e1c2470fc
--- /dev/null
+++ b/app-crypt/swtpm/files/swtpm-0.7.2-Conditionalize-test-dependencies.patch
@@ -0,0 +1,42 @@
+configure.ac: Conditionalize test dependencies
+
+Signed-off-by: Christopher Byrne <[email protected]>
+--- a/configure.ac
++++ b/configure.ac
+@@ -369,20 +369,25 @@ else
+ fi
+ AC_SUBST([DEFAULT_PCR_BANKS])
+ 
+-AC_PATH_PROG([EXPECT], expect)
+-if test "x$EXPECT" = "x"; then
+-      AC_MSG_ERROR([expect is required: expect package])
+-fi
++AC_ARG_ENABLE([test],
++      [AS_HELP_STRING([--enable-test],
++                      [enable tests (default is yes)])],
++      [enable_test=$enableval],
++      [enable_test=yes])
++
++AS_IF([test "x$enable_test" != xno],
++      [AC_PATH_PROG([EXPECT], expect)
++      AS_IF([test "x$EXPECT" = "x"],
++              AC_MSG_ERROR([expect is required: expect package]))
++      AC_PATH_PROG([SOCAT], socat)
++      AS_IF([test "x$SOCAT" = "x"],
++              AC_MSG_ERROR([socat is required: socat package]))])
+ 
+ AC_PATH_PROG([GAWK], gawk)
+ if test "x$GAWK" = "x"; then
+       AC_MSG_ERROR([gawk is required: gawk package])
+ fi
+ 
+-AC_PATH_PROG([SOCAT], socat)
+-if test "x$SOCAT" = "x"; then
+-      AC_MSG_ERROR([socat is required: socat package])
+-fi
+ 
+ AC_PATH_PROG([BASE64], base64)
+ if test "x$BASE64" = "x"; then
+-- 
+2.34.1
+

diff --git a/app-crypt/swtpm/swtpm-0.7.2.ebuild 
b/app-crypt/swtpm/swtpm-0.7.2.ebuild
index 445bd551d578..5563aa1b7f60 100644
--- a/app-crypt/swtpm/swtpm-0.7.2.ebuild
+++ b/app-crypt/swtpm/swtpm-0.7.2.ebuild
@@ -44,10 +44,10 @@ DEPEND="${RDEPEND}
 PATCHES=(
        "${FILESDIR}/${PN}-0.6.0-fix-localca-path.patch"
        "${FILESDIR}/${PN}-0.5.0-build-sys-Remove-WError.patch"
+       "${FILESDIR}/${PN}-0.7.2-Conditionalize-test-dependencies.patch"
 )
 
 src_prepare() {
-       use test || eapply 
"${FILESDIR}/${PN}-0.5.0-disable-test-dependencies.patch"
        default
        eautoreconf
 }
@@ -58,7 +58,8 @@ src_configure() {
                --without-selinux \
                $(use_with fuse cuse) \
                $(use_with gnutls) \
-               $(use_with seccomp)
+               $(use_with seccomp) \
+               $(use_enable test)
 }
 
 src_install() {

Reply via email to