1 |
commit: 19114816f2468b127302df95af1ba3ec1f577136 |
2 |
Author: Stefan Strogin <stefan.strogin <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Apr 7 21:15:02 2019 +0000 |
4 |
Commit: Stefan Strogin <stefan.strogin <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Apr 7 21:15:02 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=19114816 |
7 |
|
8 |
app-crypt/qca: add package from gentoo.git; patch for LibreSSL |
9 |
|
10 |
Bug: https://bugs.gentoo.org/657720 |
11 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
12 |
Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com> |
13 |
|
14 |
app-crypt/qca/Manifest | 1 + |
15 |
.../qca/files/qca-2.2.0_pre20180606-libressl.patch | 81 +++++++++++++++++++ |
16 |
app-crypt/qca/files/qca-disable-pgp-test.patch | 13 ++++ |
17 |
app-crypt/qca/metadata.xml | 26 +++++++ |
18 |
app-crypt/qca/qca-2.2.0_pre20180606.ebuild | 90 ++++++++++++++++++++++ |
19 |
5 files changed, 211 insertions(+) |
20 |
|
21 |
diff --git a/app-crypt/qca/Manifest b/app-crypt/qca/Manifest |
22 |
new file mode 100644 |
23 |
index 0000000..f525059 |
24 |
--- /dev/null |
25 |
+++ b/app-crypt/qca/Manifest |
26 |
@@ -0,0 +1 @@ |
27 |
+DIST qca-2.2.0_pre20180606.tar.xz 700756 BLAKE2B 0204854a664f211e9289cd4609938fd21e62de5bec5d7f5a99843a12483c960b6f8cc7392dc84bcf0676220411106bf7f23c5059d4f7031791fe9a3259d21d2c SHA512 78f9f8ebc726e95768034c580d5ac30933f7c06e026b7daad04f11477dc623e4267895e409f7830c5149e620876dcc524278ef569956d03820b0864d629c4df8 |
28 |
|
29 |
diff --git a/app-crypt/qca/files/qca-2.2.0_pre20180606-libressl.patch b/app-crypt/qca/files/qca-2.2.0_pre20180606-libressl.patch |
30 |
new file mode 100644 |
31 |
index 0000000..2f6d461 |
32 |
--- /dev/null |
33 |
+++ b/app-crypt/qca/files/qca-2.2.0_pre20180606-libressl.patch |
34 |
@@ -0,0 +1,81 @@ |
35 |
+From 32e4f55732e42103cd7ba5e84ddd086bf8103948 Mon Sep 17 00:00:00 2001 |
36 |
+From: Stefan Strogin <stefan.strogin@×××××.com> |
37 |
+Date: Fri, 5 Apr 2019 09:57:14 +0300 |
38 |
+Subject: [PATCH] Fix build with LibreSSL |
39 |
+ |
40 |
+Provide RSA_meth_set_{sign,verify} for LibreSSL. |
41 |
+Do not redefine M_ASN1_IA5STRING_new and RSA_F_RSA_EAY_PRIVATE_DECRYPT. |
42 |
+ |
43 |
+Upstream-Status: Submitted [https://phabricator.kde.org/D20259] |
44 |
+Signed-off-by: Stefan Strogin <stefan.strogin@×××××.com> |
45 |
+--- |
46 |
+ plugins/qca-ossl/ossl110-compat.h | 34 ++++++++++++++++--------------- |
47 |
+ plugins/qca-ossl/qca-ossl.cpp | 2 +- |
48 |
+ 2 files changed, 19 insertions(+), 17 deletions(-) |
49 |
+ |
50 |
+diff --git a/plugins/qca-ossl/ossl110-compat.h b/plugins/qca-ossl/ossl110-compat.h |
51 |
+index ec15475..2d47835 100644 |
52 |
+--- a/plugins/qca-ossl/ossl110-compat.h |
53 |
++++ b/plugins/qca-ossl/ossl110-compat.h |
54 |
+@@ -213,22 +213,6 @@ static int RSA_meth_set_priv_dec(RSA_METHOD *rsa, int (*priv_dec) (int flen, con |
55 |
+ return 1; |
56 |
+ } |
57 |
+ |
58 |
+-static int RSA_meth_set_sign(RSA_METHOD *meth, int (*sign) (int type, const unsigned char *m, |
59 |
+- unsigned int m_length, unsigned char *sigret, unsigned int *siglen, const RSA *rsa)) |
60 |
+-{ |
61 |
+- if (!meth) return 0; |
62 |
+- meth->rsa_sign = sign; |
63 |
+- return 1; |
64 |
+-} |
65 |
+- |
66 |
+-static int RSA_meth_set_verify(RSA_METHOD *meth, int (*verify) (int dtype, const unsigned char *m, |
67 |
+- unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa)) |
68 |
+-{ |
69 |
+- if (!meth) return 0; |
70 |
+- meth->rsa_verify = verify; |
71 |
+- return 1; |
72 |
+-} |
73 |
+- |
74 |
+ static int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa)) |
75 |
+ { |
76 |
+ if (!meth) return 0; |
77 |
+@@ -280,4 +264,22 @@ static void HMAC_CTX_free(HMAC_CTX *ctx) |
78 |
+ |
79 |
+ #endif // OPENSSL_VERSION_NUMBER < 0x10100000L |
80 |
+ |
81 |
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) |
82 |
++static int RSA_meth_set_sign(RSA_METHOD *meth, int (*sign) (int type, const unsigned char *m, |
83 |
++ unsigned int m_length, unsigned char *sigret, unsigned int *siglen, const RSA *rsa)) |
84 |
++{ |
85 |
++ if (!meth) return 0; |
86 |
++ meth->rsa_sign = sign; |
87 |
++ return 1; |
88 |
++} |
89 |
++ |
90 |
++static int RSA_meth_set_verify(RSA_METHOD *meth, int (*verify) (int dtype, const unsigned char *m, |
91 |
++ unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa)) |
92 |
++{ |
93 |
++ if (!meth) return 0; |
94 |
++ meth->rsa_verify = verify; |
95 |
++ return 1; |
96 |
++} |
97 |
++#endif // (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) |
98 |
++ |
99 |
+ #endif // OSSL110COMPAT_H |
100 |
+diff --git a/plugins/qca-ossl/qca-ossl.cpp b/plugins/qca-ossl/qca-ossl.cpp |
101 |
+index 39dbc2b..1216bef 100644 |
102 |
+--- a/plugins/qca-ossl/qca-ossl.cpp |
103 |
++++ b/plugins/qca-ossl/qca-ossl.cpp |
104 |
+@@ -61,7 +61,7 @@ |
105 |
+ #endif |
106 |
+ |
107 |
+ // OpenSSL 1.1.0 compatibility macros |
108 |
+-#ifdef OSSL_110 |
109 |
++#if defined(OSSL_110) && !defined(LIBRESSL_VERSION_NUMBER) |
110 |
+ #define M_ASN1_IA5STRING_new() ASN1_IA5STRING_new() |
111 |
+ #define RSA_F_RSA_EAY_PRIVATE_DECRYPT RSA_F_RSA_OSSL_PRIVATE_DECRYPT |
112 |
+ #endif |
113 |
+-- |
114 |
+2.21.0 |
115 |
+ |
116 |
|
117 |
diff --git a/app-crypt/qca/files/qca-disable-pgp-test.patch b/app-crypt/qca/files/qca-disable-pgp-test.patch |
118 |
new file mode 100644 |
119 |
index 0000000..7944e3c |
120 |
--- /dev/null |
121 |
+++ b/app-crypt/qca/files/qca-disable-pgp-test.patch |
122 |
@@ -0,0 +1,13 @@ |
123 |
+diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt |
124 |
+index f4d9eb9..67ef281 100644 |
125 |
+--- a/unittest/CMakeLists.txt |
126 |
++++ b/unittest/CMakeLists.txt |
127 |
+@@ -23,7 +23,7 @@ add_subdirectory(keylengthunittest) |
128 |
+ add_subdirectory(keystore) |
129 |
+ add_subdirectory(macunittest) |
130 |
+ add_subdirectory(metatype) |
131 |
+-add_subdirectory(pgpunittest) |
132 |
++# add_subdirectory(pgpunittest) |
133 |
+ add_subdirectory(pipeunittest) |
134 |
+ add_subdirectory(pkits) |
135 |
+ add_subdirectory(rsaunittest) |
136 |
|
137 |
diff --git a/app-crypt/qca/metadata.xml b/app-crypt/qca/metadata.xml |
138 |
new file mode 100644 |
139 |
index 0000000..dff1320 |
140 |
--- /dev/null |
141 |
+++ b/app-crypt/qca/metadata.xml |
142 |
@@ -0,0 +1,26 @@ |
143 |
+<?xml version="1.0" encoding="UTF-8"?> |
144 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
145 |
+<pkgmetadata> |
146 |
+<maintainer type="project"> |
147 |
+ <email>crypto@g.o</email> |
148 |
+ <name>Crypto</name> |
149 |
+</maintainer> |
150 |
+<maintainer type="project"> |
151 |
+ <email>qt@g.o</email> |
152 |
+ <name>Gentoo Qt Project</name> |
153 |
+</maintainer> |
154 |
+<maintainer type="project"> |
155 |
+ <email>kde@g.o</email> |
156 |
+ <name>Gentoo KDE Project</name> |
157 |
+</maintainer> |
158 |
+<use> |
159 |
+ <flag name="botan">Enable botan plugin</flag> |
160 |
+ <flag name="gcrypt">Enable gcrypt plugin</flag> |
161 |
+ <flag name="gpg">Enable GnuPG plugin</flag> |
162 |
+ <flag name="logger">Enable logger plugin</flag> |
163 |
+ <flag name="nss">Enable NSS plugin</flag> |
164 |
+ <flag name="pkcs11">Enable PKCS#11 plugin</flag> |
165 |
+ <flag name="sasl">Enable SASL plugin</flag> |
166 |
+ <flag name="softstore">Enable softstore plugin</flag> |
167 |
+</use> |
168 |
+</pkgmetadata> |
169 |
|
170 |
diff --git a/app-crypt/qca/qca-2.2.0_pre20180606.ebuild b/app-crypt/qca/qca-2.2.0_pre20180606.ebuild |
171 |
new file mode 100644 |
172 |
index 0000000..9aaf988 |
173 |
--- /dev/null |
174 |
+++ b/app-crypt/qca/qca-2.2.0_pre20180606.ebuild |
175 |
@@ -0,0 +1,90 @@ |
176 |
+# Copyright 1999-2019 Gentoo Authors |
177 |
+# Distributed under the terms of the GNU General Public License v2 |
178 |
+ |
179 |
+EAPI=7 |
180 |
+ |
181 |
+inherit cmake-utils qmake-utils |
182 |
+ |
183 |
+DESCRIPTION="Qt Cryptographic Architecture (QCA)" |
184 |
+HOMEPAGE="https://userbase.kde.org/QCA" |
185 |
+SRC_URI="https://dev.gentoo.org/~asturm/distfiles/${P}.tar.xz" |
186 |
+ |
187 |
+LICENSE="LGPL-2.1" |
188 |
+SLOT="2" |
189 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris" |
190 |
+ |
191 |
+IUSE="botan debug doc examples gcrypt gpg libressl logger nss pkcs11 sasl softstore +ssl test" |
192 |
+ |
193 |
+BDEPEND=" |
194 |
+ doc? ( app-doc/doxygen ) |
195 |
+" |
196 |
+RDEPEND=" |
197 |
+ dev-qt/qtcore:5 |
198 |
+ botan? ( dev-libs/botan:= ) |
199 |
+ gcrypt? ( dev-libs/libgcrypt:= ) |
200 |
+ gpg? ( app-crypt/gnupg ) |
201 |
+ nss? ( dev-libs/nss ) |
202 |
+ pkcs11? ( |
203 |
+ !libressl? ( dev-libs/openssl:0 ) |
204 |
+ libressl? ( dev-libs/libressl ) |
205 |
+ dev-libs/pkcs11-helper |
206 |
+ ) |
207 |
+ sasl? ( dev-libs/cyrus-sasl:2 ) |
208 |
+ ssl? ( |
209 |
+ !libressl? ( >=dev-libs/openssl-1.0.1:0= ) |
210 |
+ libressl? ( dev-libs/libressl:= ) |
211 |
+ ) |
212 |
+" |
213 |
+DEPEND="${RDEPEND} |
214 |
+ test? ( |
215 |
+ dev-qt/qtnetwork:5 |
216 |
+ dev-qt/qttest:5 |
217 |
+ ) |
218 |
+" |
219 |
+ |
220 |
+PATCHES=( |
221 |
+ "${FILESDIR}/${PN}-disable-pgp-test.patch" |
222 |
+ "${FILESDIR}/${P}-libressl.patch" |
223 |
+) |
224 |
+ |
225 |
+qca_plugin_use() { |
226 |
+ echo -DWITH_${2:-$1}_PLUGIN=$(usex "$1") |
227 |
+} |
228 |
+ |
229 |
+src_configure() { |
230 |
+ local mycmakeargs=( |
231 |
+ -DQCA_FEATURE_INSTALL_DIR="${EPREFIX}$(qt5_get_mkspecsdir)/features" |
232 |
+ -DQCA_PLUGINS_INSTALL_DIR="${EPREFIX}$(qt5_get_plugindir)" |
233 |
+ $(qca_plugin_use botan) |
234 |
+ $(qca_plugin_use gcrypt) |
235 |
+ $(qca_plugin_use gpg gnupg) |
236 |
+ $(qca_plugin_use logger) |
237 |
+ $(qca_plugin_use nss) |
238 |
+ $(qca_plugin_use pkcs11) |
239 |
+ $(qca_plugin_use sasl cyrus-sasl) |
240 |
+ $(qca_plugin_use softstore) |
241 |
+ $(qca_plugin_use ssl ossl) |
242 |
+ -DBUILD_TESTS=$(usex test) |
243 |
+ ) |
244 |
+ cmake-utils_src_configure |
245 |
+} |
246 |
+ |
247 |
+src_test() { |
248 |
+ local -x QCA_PLUGIN_PATH="${BUILD_DIR}/lib/qca" |
249 |
+ cmake-utils_src_test |
250 |
+} |
251 |
+ |
252 |
+src_install() { |
253 |
+ cmake-utils_src_install |
254 |
+ |
255 |
+ if use doc; then |
256 |
+ pushd "${BUILD_DIR}" >/dev/null || die |
257 |
+ doxygen Doxyfile || die |
258 |
+ dodoc -r apidocs/html |
259 |
+ popd >/dev/null || die |
260 |
+ fi |
261 |
+ |
262 |
+ if use examples; then |
263 |
+ dodoc -r "${S}"/examples |
264 |
+ fi |
265 |
+} |