commit:     e448ded7b58f0ba6395468d98c932758310100b0
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Wed Dec 14 14:54:02 2022 +0000
Commit:     Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
CommitDate: Wed Dec 14 22:47:05 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=e448ded7

dev-libs/libressl: Add upstream patch

Adds an upstreamed patch that allows building the tests without
static-libs. Also removes the defined multilib_src_test() function since
the default is adequate.

Reference: 
https://devmanual.gentoo.org/ebuild-writing/functions/src_test/index.html

Upstream-Bug: https://github.com/libressl-portable/portable/issues/754
Upstream-Commit: 
https://github.com/libressl-portable/portable/commit/4f0f6ebd1aa1038923e08af6730a32cde3202f62
Upstream-PR: https://github.com/libressl-portable/portable/pull/806
Signed-off-by: orbea <orbea <AT> riseup.net>
Closes: https://github.com/gentoo/libressl/pull/483
Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>

 .../files/libressl-3.7.0-no-static-tests.patch     | 69 ++++++++++++++++++++++
 dev-libs/libressl/libressl-3.7.0.ebuild            | 10 ++--
 2 files changed, 74 insertions(+), 5 deletions(-)

diff --git a/dev-libs/libressl/files/libressl-3.7.0-no-static-tests.patch 
b/dev-libs/libressl/files/libressl-3.7.0-no-static-tests.patch
new file mode 100644
index 0000000..13eedd4
--- /dev/null
+++ b/dev-libs/libressl/files/libressl-3.7.0-no-static-tests.patch
@@ -0,0 +1,69 @@
+Upstream Bug: https://github.com/libressl-portable/portable/issues/754
+Upstream Commit: 
https://github.com/libressl-portable/portable/commit/4f0f6ebd1aa1038923e08af6730a32cde3202f62
+Upstream PR: https://github.com/libressl-portable/portable/pull/806
+
+From 4f0f6ebd1aa1038923e08af6730a32cde3202f62 Mon Sep 17 00:00:00 2001
+From: Brent Cook <bust...@gmail.com>
+Date: Tue, 13 Dec 2022 04:34:25 -0600
+Subject: [PATCH] Build a static test library with all symbols
+
+Build and link a special test library rather than assuming that the
+build has static libraries available.
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 6fea2ebc9..26f6b7d73 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -1,5 +1,9 @@
+ include $(top_srcdir)/Makefile.am.common
+ 
++-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
++-include $(abs_top_builddir)/ssl/libssl_la_objects.mk
++-include $(abs_top_builddir)/tls/libtls_la_objects.mk
++
+ AM_CPPFLAGS += -DLIBRESSL_CRYPTO_INTERNAL
+ 
+ AM_CPPFLAGS += -I $(top_srcdir)/crypto/asn1
+@@ -14,13 +18,15 @@ AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl
+ AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl/compat
+ AM_CPPFLAGS += -D_PATH_SSL_CA_FILE=\"$(top_srcdir)/cert.pem\"
+ 
+-LDADD = $(abs_top_builddir)/tls/.libs/libtls.a
+-LDADD += $(abs_top_builddir)/ssl/.libs/libssl.a
+-LDADD += $(abs_top_builddir)/crypto/.libs/libcrypto.a
+-LDADD += $(PLATFORM_LDADD) $(PROG_LDADD)
+-if HOST_ASM_MACOSX_X86_64
+-LDADD += $(abs_top_builddir)/crypto/.libs/libcrypto_la-cpuid-macosx-x86_64.o
+-endif
++noinst_LTLIBRARIES = libtest.la
++libtest_la_LIBADD = $(libcrypto_la_objects)
++libtest_la_LIBADD += $(libcompat_la_objects)
++libtest_la_LIBADD += $(libcompatnoopt_la_objects)
++libtest_la_LIBADD += $(libssl_la_objects)
++libtest_la_LIBADD += $(libtls_la_objects)
++libtest_la_SOURCES = empty.c
++
++LDADD = libtest.la $(PLATFORM_LDADD) $(PROG_LDADD)
+ 
+ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
+ 
+diff --git a/tls/Makefile.am b/tls/Makefile.am
+index 4d31c9282..160359c3f 100644
+--- a/tls/Makefile.am
++++ b/tls/Makefile.am
+@@ -9,6 +9,15 @@ EXTRA_DIST = VERSION
+ EXTRA_DIST += CMakeLists.txt
+ EXTRA_DIST += tls.sym
+ 
++CLEANFILES = libtls_la_objects.mk
++
++EXTRA_libtls_la_DEPENDENCIES = libtls_la_objects.mk
++
++libtls_la_objects.mk: Makefile
++      @echo "libtls_la_objects= $(libtls_la_OBJECTS)" \
++        | sed 's/  */ $$\(abs_top_builddir\)\/tls\//g' \
++        > libtls_la_objects.mk
++
+ libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined 
-export-symbols $(top_srcdir)/tls/tls.sym
+ libtls_la_LIBADD = $(libcrypto_la_objects)
+ libtls_la_LIBADD += $(libcompat_la_objects)

diff --git a/dev-libs/libressl/libressl-3.7.0.ebuild 
b/dev-libs/libressl/libressl-3.7.0.ebuild
index b4484a3..f5770bf 100644
--- a/dev-libs/libressl/libressl-3.7.0.ebuild
+++ b/dev-libs/libressl/libressl-3.7.0.ebuild
@@ -20,7 +20,6 @@ SLOT="0/54"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc 
~x86 ~amd64-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris 
~x64-solaris ~x86-solaris"
 IUSE="+asm static-libs test"
 RESTRICT="!test? ( test )"
-REQUIRED_USE="test? ( static-libs )"
 
 PDEPEND="app-misc/ca-certificates"
 BDEPEND="verify-sig? ( sec-keys/openpgp-keys-libressl )"
@@ -29,11 +28,16 @@ 
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/libressl.asc
 
 PATCHES=(
        "${FILESDIR}"/${PN}-2.8.3-solaris10.patch
+       # https://github.com/libressl-portable/portable/pull/806
+       "${FILESDIR}"/${P}-no-static-tests.patch
 )
 
 src_prepare() {
        default
 
+       # Required for the no-static-tests.patch
+       touch tests/empty.c || die
+
        eautoreconf
 }
 
@@ -47,10 +51,6 @@ multilib_src_configure() {
        econf "${args[@]}"
 }
 
-multilib_src_test() {
-       emake check
-}
-
 multilib_src_install_all() {
        einstalldocs
        find "${D}" -name '*.la' -exec rm -f {} + || die

Reply via email to