1 |
commit: 1ea198753e1e74d6627ef6412abb2990a851426b |
2 |
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 15 08:28:04 2018 +0000 |
4 |
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 15 08:28:49 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ea19875 |
7 |
|
8 |
dev-libs/opensc: fix implicit invocation |
9 |
|
10 |
fix implicit test, add missing upstream include. |
11 |
|
12 |
add notify USE. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=666268 |
15 |
Thanks: Toralf Förster |
16 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
17 |
|
18 |
.../files/opensc-0.19.0-p11test_common.h.patch | 108 +++++++++++++++++++++ |
19 |
dev-libs/opensc/metadata.xml | 3 +- |
20 |
...pensc-0.19.0.ebuild => opensc-0.19.0-r1.ebuild} | 25 +++-- |
21 |
3 files changed, 127 insertions(+), 9 deletions(-) |
22 |
|
23 |
diff --git a/dev-libs/opensc/files/opensc-0.19.0-p11test_common.h.patch b/dev-libs/opensc/files/opensc-0.19.0-p11test_common.h.patch |
24 |
new file mode 100644 |
25 |
index 00000000000..ca27c70245d |
26 |
--- /dev/null |
27 |
+++ b/dev-libs/opensc/files/opensc-0.19.0-p11test_common.h.patch |
28 |
@@ -0,0 +1,108 @@ |
29 |
+From d1e4f4879b8d0a7423afc1c9a3632da4763ee31c Mon Sep 17 00:00:00 2001 |
30 |
+From: Alon Bar-Lev <alon.barlev@×××××.com> |
31 |
+Date: Sat, 15 Sep 2018 11:04:13 +0300 |
32 |
+Subject: [PATCH] missing include |
33 |
+ |
34 |
+--- |
35 |
+ src/tests/p11test/p11test_common.h | 89 ++++++++++++++++++++++++++++++++++++++ |
36 |
+ 1 file changed, 89 insertions(+) |
37 |
+ create mode 100644 src/tests/p11test/p11test_common.h |
38 |
+ |
39 |
+diff --git a/src/tests/p11test/p11test_common.h b/src/tests/p11test/p11test_common.h |
40 |
+new file mode 100644 |
41 |
+index 0000000..d3ca304 |
42 |
+--- /dev/null |
43 |
++++ b/src/tests/p11test/p11test_common.h |
44 |
+@@ -0,0 +1,89 @@ |
45 |
++/* |
46 |
++ * p11test_common.h: Test suite shared declarations for PKCS#11 API |
47 |
++ * |
48 |
++ * Copyright (C) 2016 Martin Strhársky <strharsky.martin@×××××.com> |
49 |
++ * Copyright (C) 2016, 2017 Red Hat, Inc. |
50 |
++ * |
51 |
++ * Author: Jakub Jelen <jjelen@××××××.com> |
52 |
++ * |
53 |
++ * This library is free software; you can redistribute it and/or |
54 |
++ * modify it under the terms of the GNU Lesser General Public |
55 |
++ * License as published by the Free Software Foundation; either |
56 |
++ * version 2.1 of the License, or (at your option) any later version. |
57 |
++ * |
58 |
++ * This library is distributed in the hope that it will be useful, |
59 |
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
60 |
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
61 |
++ * Lesser General Public License for more details. |
62 |
++ * |
63 |
++ * You should have received a copy of the GNU General Public License |
64 |
++ * along with this program. If not, see <http://www.gnu.org/licenses/>. |
65 |
++ */ |
66 |
++ |
67 |
++#ifndef P11TEST_COMMON_H |
68 |
++#define P11TEST_COMMON_H |
69 |
++#include "config.h" |
70 |
++#include <stdio.h> |
71 |
++#include <stdlib.h> |
72 |
++#include <string.h> |
73 |
++#include <setjmp.h> |
74 |
++#include <cmocka.h> |
75 |
++#include "pkcs11/pkcs11.h" |
76 |
++#include "libopensc/sc-ossl-compat.h" |
77 |
++ |
78 |
++#define MAX_MECHS 200 |
79 |
++ |
80 |
++#ifndef NDEBUG |
81 |
++ #define debug_print(fmt, ...) \ |
82 |
++ { fprintf(stderr, fmt "\n", ##__VA_ARGS__); } while (0) |
83 |
++#else |
84 |
++ #define debug_print(fmt, ...) |
85 |
++#endif |
86 |
++ |
87 |
++#define FLAGS_SIGN 0x01 |
88 |
++#define FLAGS_SIGN_OPENSSL 0x02 |
89 |
++#define FLAGS_SIGN_ANY ( FLAGS_SIGN | FLAGS_SIGN_OPENSSL ) |
90 |
++#define FLAGS_DECRYPT 0x04 |
91 |
++#define FLAGS_DECRYPT_OPENSSL 0x08 |
92 |
++#define FLAGS_DECRYPT_ANY ( FLAGS_DECRYPT | FLAGS_DECRYPT_OPENSSL ) |
93 |
++ |
94 |
++typedef struct { |
95 |
++ char *outfile; |
96 |
++ FILE *fd; |
97 |
++ int in_test; |
98 |
++ int first; |
99 |
++ int in_data; |
100 |
++ int first_data; |
101 |
++} log_context_t; |
102 |
++ |
103 |
++typedef struct { |
104 |
++ CK_MECHANISM_TYPE mech; |
105 |
++ CK_MECHANISM_TYPE hash; |
106 |
++ CK_RSA_PKCS_MGF_TYPE mgf; |
107 |
++ int salt; |
108 |
++ int usage_flags; |
109 |
++ int result_flags; |
110 |
++} test_mech_t; |
111 |
++ |
112 |
++typedef struct { |
113 |
++ CK_FUNCTION_LIST_PTR function_pointer; |
114 |
++ CK_SLOT_ID slot_id; |
115 |
++ CK_SESSION_HANDLE session_handle; |
116 |
++ CK_UTF8CHAR* pin; |
117 |
++ size_t pin_length; |
118 |
++ char *library_path; |
119 |
++ unsigned int interactive; |
120 |
++ log_context_t log; |
121 |
++ |
122 |
++ test_mech_t rsa_mechs[MAX_MECHS]; |
123 |
++ size_t num_rsa_mechs; |
124 |
++ test_mech_t ec_mechs[MAX_MECHS]; |
125 |
++ size_t num_ec_mechs; |
126 |
++ test_mech_t keygen_mechs[MAX_MECHS]; |
127 |
++ size_t num_keygen_mechs; |
128 |
++} token_info_t; |
129 |
++ |
130 |
++token_info_t token; |
131 |
++ |
132 |
++#endif /* P11TEST_COMMON_H */ |
133 |
++ |
134 |
+-- |
135 |
+2.16.4 |
136 |
+ |
137 |
|
138 |
diff --git a/dev-libs/opensc/metadata.xml b/dev-libs/opensc/metadata.xml |
139 |
index 52bf7f8f7bb..7c8bf05b0e8 100644 |
140 |
--- a/dev-libs/opensc/metadata.xml |
141 |
+++ b/dev-libs/opensc/metadata.xml |
142 |
@@ -16,8 +16,9 @@ |
143 |
card. |
144 |
</longdescription> |
145 |
<use> |
146 |
- <flag name="openct">Use <pkg>dev-libs/openct</pkg> (and CT-API) for accessing Smartcard hardware</flag> |
147 |
<flag name="ctapi">Use CT-API for accessing Smartcard hardware</flag> |
148 |
+ <flag name="notify">Enable notifications</flag> |
149 |
+ <flag name="openct">Use <pkg>dev-libs/openct</pkg> (and CT-API) for accessing Smartcard hardware</flag> |
150 |
<flag name="pcsc-lite">Use <pkg>sys-apps/pcsc-lite</pkg> (and PC/SC API) for accessing Smartcard hardware</flag> |
151 |
<flag name="secure-messaging">Enable secure messaging</flag> |
152 |
</use> |
153 |
|
154 |
diff --git a/dev-libs/opensc/opensc-0.19.0.ebuild b/dev-libs/opensc/opensc-0.19.0-r1.ebuild |
155 |
similarity index 75% |
156 |
rename from dev-libs/opensc/opensc-0.19.0.ebuild |
157 |
rename to dev-libs/opensc/opensc-0.19.0-r1.ebuild |
158 |
index ed42b0d921d..10b9ad5a8db 100644 |
159 |
--- a/dev-libs/opensc/opensc-0.19.0.ebuild |
160 |
+++ b/dev-libs/opensc/opensc-0.19.0-r1.ebuild |
161 |
@@ -12,7 +12,7 @@ SRC_URI="https://github.com/OpenSC/OpenSC/releases/download/${PV}/${P}.tar.gz" |
162 |
LICENSE="LGPL-2.1" |
163 |
SLOT="0" |
164 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
165 |
-IUSE="doc +pcsc-lite secure-messaging openct ctapi readline libressl ssl zlib" |
166 |
+IUSE="ctapi doc libressl openct notify +pcsc-lite readline secure-messaging ssl test zlib" |
167 |
|
168 |
RDEPEND="zlib? ( sys-libs/zlib ) |
169 |
readline? ( sys-libs/readline:0= ) |
170 |
@@ -21,11 +21,13 @@ RDEPEND="zlib? ( sys-libs/zlib ) |
171 |
libressl? ( >=dev-libs/libressl-2.7.0:0= ) |
172 |
) |
173 |
openct? ( >=dev-libs/openct-0.5.0 ) |
174 |
- pcsc-lite? ( >=sys-apps/pcsc-lite-1.3.0 )" |
175 |
+ pcsc-lite? ( >=sys-apps/pcsc-lite-1.3.0 ) |
176 |
+ notify? ( dev-libs/glib:2= )" |
177 |
DEPEND="${RDEPEND} |
178 |
virtual/pkgconfig |
179 |
app-text/docbook-xsl-stylesheets |
180 |
- dev-libs/libxslt" |
181 |
+ dev-libs/libxslt |
182 |
+ test? ( dev-util/cmocka )" |
183 |
|
184 |
REQUIRED_USE=" |
185 |
pcsc-lite? ( !openct !ctapi ) |
186 |
@@ -33,19 +35,26 @@ REQUIRED_USE=" |
187 |
ctapi? ( !pcsc-lite !openct ) |
188 |
|| ( pcsc-lite openct ctapi )" |
189 |
|
190 |
+PATCHES=( |
191 |
+ "${FILESDIR}/${P}-p11test_common.h.patch" |
192 |
+) |
193 |
+ |
194 |
src_configure() { |
195 |
econf \ |
196 |
- --disable-static \ |
197 |
--disable-openpace \ |
198 |
+ --disable-static \ |
199 |
+ --enable-man \ |
200 |
+ $(use_enable ctapi) \ |
201 |
$(use_enable doc) \ |
202 |
+ $(use_enable notify ) \ |
203 |
+ $(use_enable openct) \ |
204 |
$(use_enable openct) \ |
205 |
+ $(use_enable pcsc-lite pcsc) \ |
206 |
$(use_enable readline) \ |
207 |
- $(use_enable zlib) \ |
208 |
$(use_enable secure-messaging sm) \ |
209 |
$(use_enable ssl openssl) \ |
210 |
- $(use_enable pcsc-lite pcsc) \ |
211 |
- $(use_enable openct) \ |
212 |
- $(use_enable ctapi) |
213 |
+ $(use_enable test tests) \ |
214 |
+ $(use_enable zlib) |
215 |
} |
216 |
|
217 |
src_install() { |