Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/gcr/files/, app-crypt/gcr/
Date: Tue, 18 Aug 2020 07:51:42
Message-Id: 1597736523.a3f6c7f2781a7f14c8fc158dda15992a10b02564.leio@gentoo
1 commit: a3f6c7f2781a7f14c8fc158dda15992a10b02564
2 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 18 07:35:19 2020 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 18 07:42:03 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3f6c7f2
7
8 app-crypt/gcr: bump to 3.36.0
9
10 * Port to meson and EAPI-7
11 * The compatibility libgcr-3.so is now gone
12 * virtualx usage is gone, as that was needed only for dbus autolaunch,
13 which is now handled manually to not need autolaunch
14 * libtasn1 dep with subslot operator dep is gone, as I don't see any
15 direct linkages to it, probably only p11-kit private in modern days
16 * Added missing gnupg runtime dep, which hopefully doesn't cause
17 a build-time circular dep in the way it is done now (including an
18 upstream MR that is needed to avoid this at upstream level)
19 * Dropped unnecessary unconditional libxslt/libxml2 deps, which were
20 checked for in autotools (but apparently never used), but are not
21 used with meson. However libxml2 is still used as part of gresources
22 when ui (USE=gtk) is enabled
23
24 Package-Manager: Portage-2.3.103, Repoman-2.3.20
25 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
26
27 app-crypt/gcr/Manifest | 1 +
28 .../files/3.36.0-avoid-gnupg-circular-dep.patch | 52 +++++++++++++
29 app-crypt/gcr/files/3.36.0-fix-gck-slot-test.patch | 37 +++++++++
30 app-crypt/gcr/files/3.36.0-meson-enum-race.patch | 31 ++++++++
31 .../3.36.0-meson-fix-gtk-doc-without-ui.patch | 24 ++++++
32 app-crypt/gcr/files/3.36.0-meson-vapi-deps.patch | 48 ++++++++++++
33 app-crypt/gcr/files/3.36.0-optional-vapi.patch | 88 ++++++++++++++++++++++
34 app-crypt/gcr/gcr-3.36.0.ebuild | 85 +++++++++++++++++++++
35 8 files changed, 366 insertions(+)
36
37 diff --git a/app-crypt/gcr/Manifest b/app-crypt/gcr/Manifest
38 index 22bd9c6e136..669d8a20259 100644
39 --- a/app-crypt/gcr/Manifest
40 +++ b/app-crypt/gcr/Manifest
41 @@ -1 +1,2 @@
42 DIST gcr-3.34.0.tar.xz 1454244 BLAKE2B fc84e5eaa3b2822d1c04fff3b8b343de2655cce34317327a3594b506172c703a9d4b1d5562ed213bc1ae7df5d31ac1c5ab3c5733cfe8e5edf85e334ce7ff85f4 SHA512 9314b531ed46a42b2c8c1531c7d95003db04f2c8065e46f4e6a84ec26400ce6302ea71c4db42a8c7b98884a0b84d75a0ca65d988aa0fe6de6d897d772b070093
43 +DIST gcr-3.36.0.tar.xz 1025760 BLAKE2B 03f0d0ed40b600ed80e894111fedff3efcbbaaf6f261d6a44a3649a1acb50c4f35f3dc9a7ddb60f56cab241f68fef83aa5a02a94036e70a6556b35300f2c8fb5 SHA512 0431e7971b73accc62869c9497fcff7c111c453aa6a8ff25b42f19ceae1be0aec52e0e4eb504676f967c6e4f179198c15c521278690822e3457dbc5fe512fd5e
44
45 diff --git a/app-crypt/gcr/files/3.36.0-avoid-gnupg-circular-dep.patch b/app-crypt/gcr/files/3.36.0-avoid-gnupg-circular-dep.patch
46 new file mode 100644
47 index 00000000000..313b65628e4
48 --- /dev/null
49 +++ b/app-crypt/gcr/files/3.36.0-avoid-gnupg-circular-dep.patch
50 @@ -0,0 +1,52 @@
51 +From d3fd10fa3d3fe3e2e60a9ca5cfb401faa5e9c5bd Mon Sep 17 00:00:00 2001
52 +From: Rasmus Thomsen <oss@×××××××.dev>
53 +Date: Wed, 11 Mar 2020 11:49:08 +0100
54 +Subject: [PATCH 4/6] meson: allow building without gpg(2) installed
55 +
56 +This avoids circular dependencies, such as gcr -> gpg2 -> pinentry -> gcr
57 +---
58 + meson.build | 7 +++++--
59 + meson_options.txt | 5 +++++
60 + 2 files changed, 10 insertions(+), 2 deletions(-)
61 +
62 +diff --git a/meson.build b/meson.build
63 +index f19af0f..57b625b 100644
64 +--- a/meson.build
65 ++++ b/meson.build
66 +@@ -41,7 +41,10 @@ gobject_dep = dependency('gobject-2.0', version: '>=' + min_glib_version)
67 + gio_dep = dependency('gio-2.0', version: '>=' + min_glib_version)
68 + gio_unix_dep = dependency('gio-unix-2.0',version: '>=' + min_glib_version)
69 + glib_deps = [ glib_dep, gmodule_dep, gthread_dep, gobject_dep, gio_dep, gio_unix_dep, ]
70 +-gpg_bin = find_program('gpg2', 'gpg')
71 ++gpg_path = get_option('gpg_path')
72 ++if gpg_path == ''
73 ++ gpg_path = find_program('gpg2', 'gpg').path()
74 ++endif
75 + libgcrypt_dep = dependency('libgcrypt', version: '>= 1')
76 + p11kit_dep = dependency('p11-kit-1', version: '>= 0.19.0')
77 + p11_system_config_modules = p11kit_dep.get_pkgconfig_variable('p11_system_config_modules')
78 +@@ -65,7 +68,7 @@ conf.set('HAVE_GETTEXT', true)
79 + conf.set('HAVE_LOCALE_H', cc.has_header('locale.h'))
80 + conf.set('HAVE_TIMEGM', cc.has_function('timegm'))
81 + conf.set('HAVE_MLOCK', cc.has_function('mlock'))
82 +-conf.set_quoted('GPG_EXECUTABLE', gpg_bin.path())
83 ++conf.set_quoted('GPG_EXECUTABLE', gpg_path)
84 + conf.set_quoted('LIBGCRYPT_VERSION', libgcrypt_dep.version())
85 + config_file = configure_file(
86 + output: 'config.h',
87 +diff --git a/meson_options.txt b/meson_options.txt
88 +index bbdc8e3..ae0f524 100644
89 +--- a/meson_options.txt
90 ++++ b/meson_options.txt
91 +@@ -13,3 +13,8 @@ option('gtk_doc',
92 + value: true,
93 + description: 'Build the reference documentation (requires gtk-doc)',
94 + )
95 ++option('gpg_path',
96 ++ type: 'string',
97 ++ value: '',
98 ++ description: 'Path to gpg, autodetected if not set',
99 ++)
100 +--
101 +2.20.1
102 +
103
104 diff --git a/app-crypt/gcr/files/3.36.0-fix-gck-slot-test.patch b/app-crypt/gcr/files/3.36.0-fix-gck-slot-test.patch
105 new file mode 100644
106 index 00000000000..44a7919ea8d
107 --- /dev/null
108 +++ b/app-crypt/gcr/files/3.36.0-fix-gck-slot-test.patch
109 @@ -0,0 +1,37 @@
110 +From 4835310d233899f8b541e1c75c79f5c3a9ebf928 Mon Sep 17 00:00:00 2001
111 +From: Simon McVittie <smcv@××××××.org>
112 +Date: Sun, 15 Mar 2020 13:00:08 +0000
113 +Subject: [PATCH 1/6] gck-slot: Initialize struct tm to all-zeroes
114 +
115 +If the format string for strptime() doesn't include a time zone,
116 +then the tm_isdst member will be left uninitialized (see NOTES in
117 +Linux strptime(3)). This means we will be off by an hour from the
118 +intended time if whatever arbitrary junk is on the stack happens to
119 +include a positive value for tm.tm_isdst.
120 +
121 +Resolves: https://gitlab.gnome.org/GNOME/gcr/issues/42
122 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953981
123 +Signed-off-by: Simon McVittie <smcv@××××××.org>
124 +(cherry picked from commit b1c8213b64fdfcad8c4ae0ff33a31105c0a0a312)
125 +---
126 + gck/gck-slot.c | 4 +++-
127 + 1 file changed, 3 insertions(+), 1 deletion(-)
128 +
129 +diff --git a/gck/gck-slot.c b/gck/gck-slot.c
130 +index f3b2f97..f00857f 100644
131 +--- a/gck/gck-slot.c
132 ++++ b/gck/gck-slot.c
133 +@@ -607,7 +607,9 @@ _gck_token_info_from_pkcs11 (CK_TOKEN_INFO_PTR info)
134 + {
135 + GckTokenInfo *token_info;
136 + gchar *string;
137 +- struct tm tm;
138 ++ /* Must be zero-filled, because strptime will leave tm_isdst
139 ++ * unchanged */
140 ++ struct tm tm = { 0 };
141 +
142 + token_info = g_new0 (GckTokenInfo, 1);
143 + token_info->label = gck_string_from_chars (info->label, sizeof (info->label));
144 +--
145 +2.20.1
146 +
147
148 diff --git a/app-crypt/gcr/files/3.36.0-meson-enum-race.patch b/app-crypt/gcr/files/3.36.0-meson-enum-race.patch
149 new file mode 100644
150 index 00000000000..ef9d7a1bc3a
151 --- /dev/null
152 +++ b/app-crypt/gcr/files/3.36.0-meson-enum-race.patch
153 @@ -0,0 +1,31 @@
154 +From b04d117d5f8275a4c605743825faf2d5a28ae028 Mon Sep 17 00:00:00 2001
155 +From: Niels De Graef <nielsdegraef@×××××.com>
156 +Date: Fri, 19 Jun 2020 22:37:31 +0200
157 +Subject: [PATCH 3/6] meson: Make sure gcr-oids.h is built
158 +
159 +Fixes https://gitlab.gnome.org/GNOME/gcr/-/issues/48
160 +
161 +(cherry picked from commit 9fca6ae0aa7355c27d0922c561b9fbe18dde5b3d)
162 +---
163 + gcr/meson.build | 5 ++++-
164 + 1 file changed, 4 insertions(+), 1 deletion(-)
165 +
166 +diff --git a/gcr/meson.build b/gcr/meson.build
167 +index 199452f..06c3a63 100644
168 +--- a/gcr/meson.build
169 ++++ b/gcr/meson.build
170 +@@ -178,7 +178,10 @@ endif
171 + gcr_base_dep = declare_dependency(
172 + link_with: gcr_base_lib,
173 + include_directories: include_directories('..'),
174 +- sources: gcr_enums_gen[1], # Make sure gcr-enum-types-base.h can be included
175 ++ sources: [
176 ++ gcr_enums_gen[1],
177 ++ gcr_oids[1],
178 ++ ],
179 + )
180 +
181 + if get_option('introspection')
182 +--
183 +2.20.1
184 +
185
186 diff --git a/app-crypt/gcr/files/3.36.0-meson-fix-gtk-doc-without-ui.patch b/app-crypt/gcr/files/3.36.0-meson-fix-gtk-doc-without-ui.patch
187 new file mode 100644
188 index 00000000000..72950d381ea
189 --- /dev/null
190 +++ b/app-crypt/gcr/files/3.36.0-meson-fix-gtk-doc-without-ui.patch
191 @@ -0,0 +1,24 @@
192 +From 9343a5b0afb8265e02798c48ab52758d6cdfddf9 Mon Sep 17 00:00:00 2001
193 +From: Mart Raudsepp <leio@g.o>
194 +Date: Tue, 18 Aug 2020 09:53:38 +0300
195 +Subject: [PATCH 6/6] build: Don't build gcr gtk-doc without ui enabled
196 +
197 +gcr gtk-doc includes both gcr and gcr ui documentation, so we can't build
198 +it without ui enabled
199 +---
200 + docs/meson.build | 4 +++-
201 + 1 file changed, 3 insertions(+), 1 deletion(-)
202 +
203 +diff --git a/docs/meson.build b/docs/meson.build
204 +index f353516..8984ef2 100644
205 +--- a/docs/meson.build
206 ++++ b/docs/meson.build
207 +@@ -1,2 +1,4 @@
208 + subdir('reference/gck')
209 +-subdir('reference/gcr')
210 ++if get_option('gtk')
211 ++ subdir('reference/gcr')
212 ++endif
213 +--
214 +2.20.1
215 +
216
217 diff --git a/app-crypt/gcr/files/3.36.0-meson-vapi-deps.patch b/app-crypt/gcr/files/3.36.0-meson-vapi-deps.patch
218 new file mode 100644
219 index 00000000000..60d1058ee65
220 --- /dev/null
221 +++ b/app-crypt/gcr/files/3.36.0-meson-vapi-deps.patch
222 @@ -0,0 +1,48 @@
223 +From fc2bc7e230b745dbbd4f4b2cd82e1e5e0c7bf109 Mon Sep 17 00:00:00 2001
224 +From: Alexander Kanavin <alex.kanavin@×××××.com>
225 +Date: Mon, 11 May 2020 22:19:16 +0000
226 +Subject: [PATCH 2/6] meson.build: correctly set internal vapi dependencies
227 +
228 +If they are set as strings, meson will supply the right
229 +arguments to vapigen, but will not set the ninja dependencies
230 +to ensure they get built first, and so races will occur:
231 +https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/1881/steps/8/logs/step1b
232 +
233 +Signed-off-by: Alexander Kanavin <alex.kanavin@×××××.com>
234 +(cherry picked from commit 91712a2e131692fa727a0da2868bc23e8df1bf17)
235 +---
236 + gcr/meson.build | 2 +-
237 + ui/meson.build | 4 ++--
238 + 2 files changed, 3 insertions(+), 3 deletions(-)
239 +
240 +diff --git a/gcr/meson.build b/gcr/meson.build
241 +index 254a933..199452f 100644
242 +--- a/gcr/meson.build
243 ++++ b/gcr/meson.build
244 +@@ -203,7 +203,7 @@ if get_option('introspection')
245 +
246 + gcr_vapi = gnome.generate_vapi('gcr-@0@'.format(gcr_major_version),
247 + sources: gcr_gir[0],
248 +- packages: [ 'glib-2.0', 'gio-2.0', 'gck-@0@'.format(gck_major_version) ],
249 ++ packages: [ 'glib-2.0', 'gio-2.0', gck_vapi ],
250 + metadata_dirs: meson.current_source_dir(),
251 + vapi_dirs: [
252 + build_root / 'gck',
253 +diff --git a/ui/meson.build b/ui/meson.build
254 +index 5ca3753..477412d 100644
255 +--- a/ui/meson.build
256 ++++ b/ui/meson.build
257 +@@ -174,8 +174,8 @@ if get_option('introspection')
258 + packages: [
259 + 'glib-2.0',
260 + 'gio-2.0',
261 +- 'gck-@0@'.format(gck_major_version),
262 +- 'gcr-@0@'.format(gcr_major_version),
263 ++ gck_vapi,
264 ++ gcr_vapi,
265 + 'gtk+-3.0'
266 + ],
267 + metadata_dirs: meson.current_source_dir(),
268 +--
269 +2.20.1
270 +
271
272 diff --git a/app-crypt/gcr/files/3.36.0-optional-vapi.patch b/app-crypt/gcr/files/3.36.0-optional-vapi.patch
273 new file mode 100644
274 index 00000000000..50969fdae40
275 --- /dev/null
276 +++ b/app-crypt/gcr/files/3.36.0-optional-vapi.patch
277 @@ -0,0 +1,88 @@
278 +From 525f5c7dbfdff6c1b24510a22eeffa804836e1bf Mon Sep 17 00:00:00 2001
279 +From: Mart Raudsepp <leio@g.o>
280 +Date: Tue, 18 Aug 2020 09:36:19 +0300
281 +Subject: [PATCH 5/6] build: Make vapi optional
282 +
283 +---
284 + gck/meson.build | 2 ++
285 + gcr/meson.build | 2 ++
286 + meson_options.txt | 5 +++++
287 + ui/meson.build | 2 ++
288 + 4 files changed, 11 insertions(+)
289 +
290 +diff --git a/gck/meson.build b/gck/meson.build
291 +index 756b486..a15f4ed 100644
292 +--- a/gck/meson.build
293 ++++ b/gck/meson.build
294 +@@ -142,6 +142,7 @@ if get_option('introspection')
295 + install: true,
296 + )
297 +
298 ++if get_option('vapi')
299 + gck_vapi = gnome.generate_vapi('gck-@0@'.format(gck_major_version),
300 + sources: gck_gir[0],
301 + metadata_dirs: meson.current_source_dir(),
302 +@@ -153,6 +154,7 @@ if get_option('introspection')
303 + install_dir: get_option('datadir') / 'vala' / 'vapi',
304 + )
305 + endif
306 ++endif
307 +
308 + # pkg-config file
309 + pkgconfig.generate(gck_lib,
310 +diff --git a/gcr/meson.build b/gcr/meson.build
311 +index 06c3a63..cc642cf 100644
312 +--- a/gcr/meson.build
313 ++++ b/gcr/meson.build
314 +@@ -204,6 +204,7 @@ if get_option('introspection')
315 + install: true,
316 + )
317 +
318 ++if get_option('vapi')
319 + gcr_vapi = gnome.generate_vapi('gcr-@0@'.format(gcr_major_version),
320 + sources: gcr_gir[0],
321 + packages: [ 'glib-2.0', 'gio-2.0', gck_vapi ],
322 +@@ -217,6 +218,7 @@ if get_option('introspection')
323 + install: true,
324 + )
325 + endif
326 ++endif
327 +
328 + # pkg-config file
329 + pkgconfig.generate(gcr_base_lib,
330 +diff --git a/meson_options.txt b/meson_options.txt
331 +index ae0f524..f68cb95 100644
332 +--- a/meson_options.txt
333 ++++ b/meson_options.txt
334 +@@ -18,3 +18,8 @@ option('gpg_path',
335 + value: '',
336 + description: 'Path to gpg, autodetected if not set',
337 + )
338 ++option('vapi',
339 ++ type: 'boolean',
340 ++ value: true,
341 ++ description: 'Generate vapi data (requires vapigen and introspection option)',
342 ++)
343 +diff --git a/ui/meson.build b/ui/meson.build
344 +index 477412d..0b89b24 100644
345 +--- a/ui/meson.build
346 ++++ b/ui/meson.build
347 +@@ -169,6 +169,7 @@ if get_option('introspection')
348 + install: true,
349 + )
350 +
351 ++if get_option('vapi')
352 + gcr_ui_vapi = gnome.generate_vapi('gcr-ui-@0@'.format(gcr_major_version),
353 + sources: gcr_ui_gir[0],
354 + packages: [
355 +@@ -190,6 +191,7 @@ if get_option('introspection')
356 + install: true,
357 + )
358 + endif
359 ++endif
360 +
361 + # gcr-viewer
362 + gcr_viewer = executable('gcr-viewer',
363 +--
364 +2.20.1
365 +
366
367 diff --git a/app-crypt/gcr/gcr-3.36.0.ebuild b/app-crypt/gcr/gcr-3.36.0.ebuild
368 new file mode 100644
369 index 00000000000..c966f4aed3d
370 --- /dev/null
371 +++ b/app-crypt/gcr/gcr-3.36.0.ebuild
372 @@ -0,0 +1,85 @@
373 +# Copyright 1999-2020 Gentoo Authors
374 +# Distributed under the terms of the GNU General Public License v2
375 +
376 +EAPI=7
377 +VALA_USE_DEPEND="vapigen"
378 +PYTHON_COMPAT=( python3_{6,7,8} )
379 +
380 +inherit gnome.org gnome2-utils meson python-any-r1 vala xdg
381 +
382 +DESCRIPTION="Libraries for cryptographic UIs and accessing PKCS#11 modules"
383 +HOMEPAGE="https://gitlab.gnome.org/GNOME/gcr"
384 +
385 +LICENSE="GPL-2+ LGPL-2+"
386 +SLOT="0/1" # subslot = suffix of libgcr-base-3 and co
387 +
388 +IUSE="gtk gtk-doc +introspection +vala"
389 +REQUIRED_USE="vala? ( introspection )"
390 +
391 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x86-solaris"
392 +
393 +DEPEND="
394 + >=dev-libs/glib-2.44.0:2
395 + >=dev-libs/libgcrypt-1.2.2:0=
396 + >=app-crypt/p11-kit-0.19.0
397 + gtk? ( >=x11-libs/gtk+-3.12:3[X,introspection?] )
398 + >=sys-apps/dbus-1
399 + introspection? ( >=dev-libs/gobject-introspection-1.58:= )
400 +"
401 +RDEPEND="${DEPEND}
402 + app-crypt/gnupg
403 +"
404 +BDEPEND="
405 + ${PYTHON_DEPS}
406 + gtk? ( dev-libs/libxml2:2 )
407 + dev-util/gdbus-codegen
408 + dev-util/glib-utils
409 + gtk-doc? ( >=dev-util/gtk-doc-1.9
410 + app-text/docbook-xml-dtd:4.1.2 )
411 + >=sys-devel/gettext-0.19.8
412 + virtual/pkgconfig
413 + vala? ( $(vala_depend) )
414 +"
415 +
416 +PATCHES=(
417 + "${FILESDIR}"/${PV}-fix-gck-slot-test.patch
418 + "${FILESDIR}"/${PV}-meson-vapi-deps.patch
419 + "${FILESDIR}"/${PV}-meson-enum-race.patch
420 + "${FILESDIR}"/${PV}-avoid-gnupg-circular-dep.patch
421 + "${FILESDIR}"/${PV}-optional-vapi.patch
422 + "${FILESDIR}"/${PV}-meson-fix-gtk-doc-without-ui.patch
423 +)
424 +
425 +pkg_setup() {
426 + python-any-r1_pkg_setup
427 +}
428 +
429 +src_prepare() {
430 + use vala && vala_src_prepare
431 + xdg_src_prepare
432 +}
433 +
434 +src_configure() {
435 + local emesonargs=(
436 + $(meson_use introspection)
437 + $(meson_use gtk)
438 + $(meson_use gtk-doc gtk_doc)
439 + -Dgpg_path="${EPREFIX}"/usr/bin/gpg
440 + $(meson_use vala vapi)
441 + )
442 + meson_src_configure
443 +}
444 +
445 +src_test() {
446 + dbus-run-session meson test -C "${BUILD_DIR}" || die 'tests failed'
447 +}
448 +
449 +pkg_postinst() {
450 + xdg_pkg_postinst
451 + gnome2_schemas_update
452 +}
453 +
454 +pkg_postrm() {
455 + xdg_pkg_postrm
456 + gnome2_schemas_update
457 +}