summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Heiko Becker <heirecka@exherbo.org> 2017-02-06 22:38:16 +0100
committerAvatar Heiko Becker <heirecka@exherbo.org> 2017-08-26 13:51:23 +0200
commit9d1fc80d88058d956e673f39cc82639b8a48739b (patch)
treef38bd40641fc3e59e2beeee9b4e97bf840a7acfc
parent32d81d7e8a40eaf7bf97ab43329f600c24e85fc5 (diff)
downloadoffice-9d1fc80d88058d956e673f39cc82639b8a48739b.tar.gz
office-9d1fc80d88058d956e673f39cc82639b8a48739b.tar.xz
xmlsec: Fix build with libressl
-rw-r--r--packages/dev-libs/xmlsec/files/xmlsec-Fix-libressl-and-openssl-1.1.0-48.patch96
-rw-r--r--packages/dev-libs/xmlsec/xmlsec-1.2.23.exheres-04
-rw-r--r--packages/dev-libs/xmlsec/xmlsec.exlib2
3 files changed, 101 insertions, 1 deletions
diff --git a/packages/dev-libs/xmlsec/files/xmlsec-Fix-libressl-and-openssl-1.1.0-48.patch b/packages/dev-libs/xmlsec/files/xmlsec-Fix-libressl-and-openssl-1.1.0-48.patch
new file mode 100644
index 0000000..fd1f0e5
--- /dev/null
+++ b/packages/dev-libs/xmlsec/files/xmlsec-Fix-libressl-and-openssl-1.1.0-48.patch
@@ -0,0 +1,96 @@
+Upstream: under review, https://github.com/lsh123/xmlsec/pull/51
+
+From 359b8f49d3a265f86ddea2c21bf793e49a821da0 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 13 Oct 2016 12:36:17 +0200
+Subject: [PATCH] Fix libressl and openssl>=1.1.0 (#48)
+
+We cannot use pkg-config to detect libressl vs openssl>=1.1.0 since
+libressl's pkg-config reports version 2.x. So we simply remove the
+pkg-config based version detection and use the fallback compile test.
+
+We also fix a couple of related preprocessor tests to use the correct
+code with libressl.
+---
+ configure.ac | 30 ++++++------------------------
+ src/openssl/app.c | 2 +-
+ src/openssl/openssl11_wrapper.h | 2 +-
+ 3 files changed, 8 insertions(+), 26 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a118b29..e050bac 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -417,32 +417,14 @@ elif test "z$with_openssl" != "z" ; then
+ fi
+ OPENSSL_FOUND="yes"
+ elif test "z$PKGCONFIG_FOUND" = "zyes" ; then
+- if test "z$OPENSSL_VERSION" = "z" ; then
+- PKG_CHECK_MODULES(OPENSSL, openssl >= 1.1.0,
+- [OPENSSL_VERSION="1.1.0"],
+- [OPENSSL_VERSION=""])
+- fi
+-
+- if test "z$OPENSSL_VERSION" = "z" ; then
+- PKG_CHECK_MODULES(OPENSSL, openssl >= 1.0.0,
+- [OPENSSL_VERSION="1.0.0"],
+- [OPENSSL_VERSION=""])
+- fi
+-
+- if test "z$OPENSSL_VERSION" = "z" ; then
+- PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.8,
+- [OPENSSL_VERSION="0.9.8"],
+- [OPENSSL_VERSION=""])
+- fi
++ dnl we cannot use pkg-config to detect >= 1.1.0 due to libressl reports
++ dnl version 2.x. So we need to rely on the compile tests below to detect
++ dnl the exact version number
+
+ if test "z$OPENSSL_VERSION" = "z" ; then
+ PKG_CHECK_MODULES(OPENSSL, openssl >= $OPENSSL_MIN_VERSION,
+- [OPENSSL_VERSION="$OPENSSL_MIN_VERSION"],
+- [OPENSSL_VERSION=""])
+- fi
+-
+- if test "z$OPENSSL_VERSION" != "z" ; then
+- OPENSSL_FOUND="yes"
++ [OPENSSL_FOUND="yes"],
++ [OPENSSL_FOUND="no"])
+ fi
+ fi
+
+@@ -482,7 +464,7 @@ if test "z$OPENSSL_FOUND" = "zno" ; then
+ fi
+ fi
+
+-if test "z$OPENSSL_FOUND" = "zyes" -a "z$OPENSSL_VERSION" = "z" ; then
++if test "z$OPENSSL_FOUND" = "zyes" ; then
+ AC_MSG_CHECKING(for openssl libraries >= $OPENSSL_MIN_VERSION)
+
+ dnl Check the OpenSSL version
+diff --git a/src/openssl/app.c b/src/openssl/app.c
+index 67566e9..fcff924 100644
+--- a/src/openssl/app.c
++++ b/src/openssl/app.c
+@@ -61,7 +61,7 @@ XMLSEC_PTR_TO_FUNC_IMPL(pem_password_cb)
+ int
+ xmlSecOpenSSLAppInit(const char* config) {
+
+-#if (OPENSSL_VERSION_NUMBER < 0x10100000)
++#if (OPENSSL_VERSION_NUMBER < 0x10100000 || defined(LIBRESSL_VERSION_NUMBER))
+ ERR_load_crypto_strings();
+ OPENSSL_config(NULL);
+ OpenSSL_add_all_algorithms();
+diff --git a/src/openssl/openssl11_wrapper.h b/src/openssl/openssl11_wrapper.h
+index 7f900ff..baed8d6 100644
+--- a/src/openssl/openssl11_wrapper.h
++++ b/src/openssl/openssl11_wrapper.h
+@@ -9,7 +9,7 @@
+ * same syntax. This file won't be required once OpenSSL 1.1.0 is the minimum
+ * suported version.
+ */
+-#if (OPENSSL_VERSION_NUMBER < 0x10100000)
++#if (OPENSSL_VERSION_NUMBER < 0x10100000) || defined(LIBRESSL_VERSION_NUMBER)
+
+ #define EVP_PKEY_up_ref(pKey) CRYPTO_add(&((pKey)->references), 1, CRYPTO_LOCK_EVP_PKEY)
+
diff --git a/packages/dev-libs/xmlsec/xmlsec-1.2.23.exheres-0 b/packages/dev-libs/xmlsec/xmlsec-1.2.23.exheres-0
index 8c8dd29..5ff29d4 100644
--- a/packages/dev-libs/xmlsec/xmlsec-1.2.23.exheres-0
+++ b/packages/dev-libs/xmlsec/xmlsec-1.2.23.exheres-0
@@ -5,3 +5,7 @@ require xmlsec
PLATFORMS="~amd64"
+DEFAULT_SRC_PREPARE_PATCHES+=(
+ "${FILES}"/${PN}-Fix-libressl-and-openssl-1.1.0-48.patch
+)
+
diff --git a/packages/dev-libs/xmlsec/xmlsec.exlib b/packages/dev-libs/xmlsec/xmlsec.exlib
index 3840591..df682a3 100644
--- a/packages/dev-libs/xmlsec/xmlsec.exlib
+++ b/packages/dev-libs/xmlsec/xmlsec.exlib
@@ -74,7 +74,7 @@ DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( debug )
xmlsec_src_prepare() {
if option !doc ; then
edo sed -e '/^SUBDIRS/s/docs//' -i Makefile.am
- eautoreconf
fi
+ autotools_src_prepare
}