commit:     d471fcc439ce9bf0e920d69de3680819a4986d89
Author:     Stefan Strogin <steils <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 26 03:42:41 2020 +0000
Commit:     Stefan Strogin <steils <AT> gentoo <DOT> org>
CommitDate: Wed Feb 26 03:42:49 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=d471fcc4

app-crypt/qca: add LibreSSL patch for 2.3.0

Bug: https://bugs.gentoo.org/657720
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Stefan Strogin <steils <AT> gentoo.org>

 app-crypt/qca/Manifest                       |  1 +
 app-crypt/qca/files/qca-2.3.0-libressl.patch | 68 +++++++++++++++++++++
 app-crypt/qca/qca-2.3.0.ebuild               | 91 ++++++++++++++++++++++++++++
 3 files changed, 160 insertions(+)

diff --git a/app-crypt/qca/Manifest b/app-crypt/qca/Manifest
index 20d0b5f..b72a547 100644
--- a/app-crypt/qca/Manifest
+++ b/app-crypt/qca/Manifest
@@ -1 +1,2 @@
 DIST qca-2.2.1.tar.xz 691676 BLAKE2B 
d5bcc0d6e791811e1efcdbf2e09916fe40ad682b0e59b2993c73a5bd79e09fc28facdec81259a982bee05223c8dfce78b9a6b729ca4e566c0901a13b91575379
 SHA512 
3a0e8aa7cf3ea9a7244facaf1d521ebca2753af37636e7bf5f21c57ae880ac9682ae7d6d9fa5ce41b73568ff9538214956b89cd41228c2cb828d9068c2031a9c
+DIST qca-2.3.0.tar.xz 729504 BLAKE2B 
71cf9dfae00066c14e1055da1fa1a8e1210f538b1addfde1b99a9b26b1e8f7dd61e289d0f505b5ec04d5f4745216d4fd0f8be8f8de9e9cbf74123907ba703d0e
 SHA512 
ca9251868e073834562fa62ffc64b3e7817c9ddadc6bc3fb99cf8b5c8d859969562170a98874be9590c617b2dd8e5590d2c83792554f54bb880c677902db22fe

diff --git a/app-crypt/qca/files/qca-2.3.0-libressl.patch 
b/app-crypt/qca/files/qca-2.3.0-libressl.patch
new file mode 100644
index 0000000..c06ba60
--- /dev/null
+++ b/app-crypt/qca/files/qca-2.3.0-libressl.patch
@@ -0,0 +1,68 @@
+From c3001c187f91a6eccfcb75828876f03f5310d283 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <[email protected]>
+Date: Wed, 26 Feb 2020 04:41:28 +0200
+Subject: [PATCH] Fix build with LibreSSL
+
+Signed-off-by: Stefan Strogin <[email protected]>
+---
+ plugins/qca-ossl/qca-ossl.cpp | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/plugins/qca-ossl/qca-ossl.cpp b/plugins/qca-ossl/qca-ossl.cpp
+index 559dc3f6..5ba9f1e7 100644
+--- a/plugins/qca-ossl/qca-ossl.cpp
++++ b/plugins/qca-ossl/qca-ossl.cpp
+@@ -41,7 +41,13 @@
+ #include <openssl/pkcs12.h>
+ #include <openssl/ssl.h>
+ 
++#ifndef RSA_F_RSA_OSSL_PRIVATE_DECRYPT
++#define RSA_F_RSA_OSSL_PRIVATE_DECRYPT RSA_F_RSA_EAY_PRIVATE_DECRYPT
++#endif
++
++#ifndef LIBRESSL_VERSION_NUMBER
+ #include <openssl/kdf.h>
++#endif
+ 
+ using namespace QCA;
+ 
+@@ -1255,6 +1261,7 @@ public:
+ protected:
+ };
+ 
++#ifndef LIBRESSL_VERSION_NUMBER
+ class opensslHkdfContext : public HKDFContext
+ {
+     Q_OBJECT
+@@ -1284,6 +1291,7 @@ public:
+               return out;
+       }
+ };
++#endif // LIBRESSL_VERSION_NUMBER
+ 
+ class opensslHMACContext : public MACContext
+ {
+@@ -7268,7 +7276,9 @@ public:
+ #endif
+               list += QStringLiteral("pbkdf1(sha1)");
+               list += QStringLiteral("pbkdf2(sha1)");
++#ifndef LIBRESSL_VERSION_NUMBER
+               list += QStringLiteral("hkdf(sha256)");
++#endif
+               list += QStringLiteral("pkey");
+               list += QStringLiteral("dlgroup");
+               list += QStringLiteral("rsa");
+@@ -7337,8 +7347,10 @@ public:
+ #endif
+               else if ( type == QLatin1String("pbkdf2(sha1)") )
+                       return new opensslPbkdf2Context( this, type );
++#ifndef LIBRESSL_VERSION_NUMBER
+               else if ( type == QLatin1String("hkdf(sha256)") )
+                       return new opensslHkdfContext( this, type );
++#endif
+               else if ( type == QLatin1String("hmac(md5)") )
+                       return new opensslHMACContext( EVP_md5(), this, type );
+               else if ( type == QLatin1String("hmac(sha1)") )
+-- 
+2.25.1
+

diff --git a/app-crypt/qca/qca-2.3.0.ebuild b/app-crypt/qca/qca-2.3.0.ebuild
new file mode 100644
index 0000000..ebe13eb
--- /dev/null
+++ b/app-crypt/qca/qca-2.3.0.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit kde.org cmake qmake-utils
+
+DESCRIPTION="Qt Cryptographic Architecture (QCA)"
+HOMEPAGE="https://userbase.kde.org/QCA";
+SRC_URI="mirror://kde/stable/${PN}/${PV}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="2"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux 
~x86-linux ~ppc-macos ~sparc-solaris"
+IUSE="botan debug doc examples gcrypt gpg libressl logger nss pkcs11 sasl 
softstore +ssl test"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       doc? ( app-doc/doxygen )
+"
+RDEPEND="
+       dev-qt/qtcore:5
+       botan? ( dev-libs/botan:= )
+       gcrypt? ( dev-libs/libgcrypt:= )
+       gpg? ( app-crypt/gnupg )
+       nss? ( dev-libs/nss )
+       pkcs11? (
+               !libressl? ( >=dev-libs/openssl-1.1 )
+               libressl? ( dev-libs/libressl:0= )
+               dev-libs/pkcs11-helper
+       )
+       sasl? ( dev-libs/cyrus-sasl:2 )
+       ssl? (
+               !libressl? ( >=dev-libs/openssl-1.1:0= )
+               libressl? ( dev-libs/libressl:= )
+       )
+"
+DEPEND="${RDEPEND}
+       test? (
+               dev-qt/qtnetwork:5
+               dev-qt/qttest:5
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-disable-pgp-test.patch"
+       "${FILESDIR}/${P}-libressl.patch"
+)
+
+qca_plugin_use() {
+       echo -DWITH_${2:-$1}_PLUGIN=$(usex "$1")
+}
+
+src_configure() {
+       local mycmakeargs=(
+               
-DQCA_FEATURE_INSTALL_DIR="${EPREFIX}$(qt5_get_mkspecsdir)/features"
+               -DQCA_PLUGINS_INSTALL_DIR="${EPREFIX}$(qt5_get_plugindir)"
+               $(qca_plugin_use botan)
+               $(qca_plugin_use gcrypt)
+               $(qca_plugin_use gpg gnupg)
+               $(qca_plugin_use logger)
+               $(qca_plugin_use nss)
+               $(qca_plugin_use pkcs11)
+               $(qca_plugin_use sasl cyrus-sasl)
+               $(qca_plugin_use softstore)
+               $(qca_plugin_use ssl ossl)
+               -DBUILD_TESTS=$(usex test)
+       )
+       cmake_src_configure
+}
+
+src_test() {
+       local -x QCA_PLUGIN_PATH="${BUILD_DIR}/lib/qca"
+       cmake_src_test
+}
+
+src_install() {
+       cmake_src_install
+
+       if use doc; then
+               pushd "${BUILD_DIR}" >/dev/null || die
+               doxygen Doxyfile || die
+               dodoc -r apidocs/html
+               popd >/dev/null || die
+       fi
+
+       if use examples; then
+               dodoc -r "${S}"/examples
+       fi
+}

Reply via email to