Skip to content

Commit

Permalink
net-libs/gsoap: compatibility patch for LibreSSL
Browse files Browse the repository at this point in the history
This patch fixes building with dev-libs/libressl-2.6.4.  This patch will
not be needed once dev-libs/libressl-2.7.x goes stable.  Additionally,
fix slot/subslot modifier to ensure rebuilds are trigged for API
changes.

Closes: https://bugs.gentoo.org/617264
Package-Manager: Portage-2.3.31, Repoman-2.3.9
  • Loading branch information
FuzzyGophers committed Apr 20, 2018
1 parent ddca072 commit c3de07e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
38 changes: 38 additions & 0 deletions net-libs/gsoap/files/gsoap-2.8.51-libressl-2.6-compatibility.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- a/gsoap/plugin/smdevp.c 2018-04-20 15:45:25.112658174 +0000
+++ b/gsoap/plugin/smdevp.c 2018-04-20 15:47:58.826360980 +0000
@@ -479,7 +479,7 @@
/* allocate and init the OpenSSL HMAC or EVP_MD context */
if ((alg & SOAP_SMD_ALGO) == SOAP_SMD_HMAC)
{
-#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
data->ctx = (void*)SOAP_MALLOC(soap, sizeof(HMAC_CTX));
if (data->ctx)
HMAC_CTX_init((HMAC_CTX*)data->ctx);
@@ -489,7 +489,7 @@
}
else
{
-#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
data->ctx = (void*)SOAP_MALLOC(soap, sizeof(EVP_MD_CTX));
if (data->ctx)
EVP_MD_CTX_init((EVP_MD_CTX*)data->ctx);
@@ -642,7 +642,7 @@
*len = (int)n;
}
/* cleanup */
-#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
if ((data->alg & SOAP_SMD_ALGO) == SOAP_SMD_HMAC)
HMAC_CTX_cleanup((HMAC_CTX*)data->ctx);
else
@@ -687,7 +687,7 @@
}
if (data->ctx)
{
-#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
if ((data->alg & SOAP_SMD_ALGO) == SOAP_SMD_HMAC)
HMAC_CTX_cleanup((HMAC_CTX*)data->ctx);
else
7 changes: 5 additions & 2 deletions net-libs/gsoap/gsoap-2.8.51.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6
Expand All @@ -21,7 +21,7 @@ RDEPEND="
gnutls? ( net-libs/gnutls )
ssl? (
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl )
libressl? ( dev-libs/libressl:0= )
)
"
DEPEND="${RDEPEND}
Expand All @@ -41,6 +41,9 @@ src_prepare() {
# enable shared libs https://bugs.gentoo.org/583398
eapply "${FILESDIR}/${PN}-2.7.40-shared_libs.patch"

# fix building with libressl-2.6.x. This will not be needed when 2.7.x goes stable
eapply "${FILESDIR}/${PN}-2.8.51-libressl-2.6-compatibility.patch"

eautoreconf
}

Expand Down

0 comments on commit c3de07e

Please sign in to comment.