Gentoo Archives: gentoo-commits

From: "Jason A. Donenfeld" <zx2c4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/libu2f-host/files/, app-crypt/libu2f-host/
Date: Sat, 02 May 2020 06:15:33
Message-Id: 1588400115.156ccdd04fc7dc9403041a144d584a1140741e6e.zx2c4@gentoo
1 commit: 156ccdd04fc7dc9403041a144d584a1140741e6e
2 Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 2 06:12:39 2020 +0000
4 Commit: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
5 CommitDate: Sat May 2 06:15:15 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=156ccdd0
7
8 app-crypt/libu2f-host: account for c-json changes
9
10 Fixes: https://bugs.gentoo.org/720358
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org>
13
14 .../files/libu2f-host-1.1.10-json-boolean.patch | 34 ++++++++++++++++++++++
15 app-crypt/libu2f-host/libu2f-host-1.1.10.ebuild | 4 ++-
16 2 files changed, 37 insertions(+), 1 deletion(-)
17
18 diff --git a/app-crypt/libu2f-host/files/libu2f-host-1.1.10-json-boolean.patch b/app-crypt/libu2f-host/files/libu2f-host-1.1.10-json-boolean.patch
19 new file mode 100644
20 index 00000000000..cee17d5b0b0
21 --- /dev/null
22 +++ b/app-crypt/libu2f-host/files/libu2f-host-1.1.10-json-boolean.patch
23 @@ -0,0 +1,34 @@
24 +From 840f01135d2892f45e71b9e90405de587991bd03 Mon Sep 17 00:00:00 2001
25 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@×××××××××××××.org>
26 +Date: Mon, 13 Apr 2020 14:12:25 +0200
27 +Subject: [PATCH] Add support for upcoming json-c 0.14.0.
28 +
29 +TRUE/FALSE are not defined anymore. 1 and 0 are used instead.
30 +---
31 + u2f-host/u2fmisc.c | 13 +++++++++++++
32 + 1 file changed, 13 insertions(+)
33 +
34 +diff --git a/u2f-host/u2fmisc.c b/u2f-host/u2fmisc.c
35 +index e40ca3d..5a032ce 100644
36 +--- a/u2f-host/u2fmisc.c
37 ++++ b/u2f-host/u2fmisc.c
38 +@@ -33,6 +33,19 @@ typedef int json_bool;
39 + #define u2fh_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)FALSE : (json_bool)TRUE
40 + #endif
41 +
42 ++/* json-c 0.13.99 does not define TRUE/FALSE anymore
43 ++ * the json-c maintainers replaced them with pure 1/0
44 ++ * https://github.com/json-c/json-c/commit/0992aac61f8b
45 ++ */
46 ++#if defined JSON_C_VERSION_NUM && JSON_C_VERSION_NUM >= ((13 << 8) | 99)
47 ++#ifndef FALSE
48 ++#define FALSE 0
49 ++#endif
50 ++#ifndef TRUE
51 ++#define TRUE 1
52 ++#endif
53 ++#endif
54 ++
55 + static void
56 + dumpHex (unsigned char *data, int offs, int len)
57 + {
58
59 diff --git a/app-crypt/libu2f-host/libu2f-host-1.1.10.ebuild b/app-crypt/libu2f-host/libu2f-host-1.1.10.ebuild
60 index 0c27d050b29..3355f7bcc19 100644
61 --- a/app-crypt/libu2f-host/libu2f-host-1.1.10.ebuild
62 +++ b/app-crypt/libu2f-host/libu2f-host-1.1.10.ebuild
63 @@ -1,4 +1,4 @@
64 -# Copyright 1999-2019 Gentoo Authors
65 +# Copyright 1999-2020 Gentoo Authors
66 # Distributed under the terms of the GNU General Public License v2
67
68 EAPI=7
69 @@ -25,6 +25,8 @@ BDEPEND="virtual/pkgconfig"
70
71 CONFIG_CHECK="~HIDRAW"
72
73 +PATCHES=( "${FILESDIR}/${P}-json-boolean.patch" )
74 +
75 src_install() {
76 default
77 if use kernel_linux; then