[arch-commits] Commit in libu2f-host/trunk (PKGBUILD json-c-0.14.patch)

Evangelos Foutras foutrelis at archlinux.org
Sat Apr 25 15:01:22 UTC 2020


    Date: Saturday, April 25, 2020 @ 15:01:21
  Author: foutrelis
Revision: 620823

upgpkg: libu2f-host 1.1.10-3: json-c 0.14 rebuild

Added:
  libu2f-host/trunk/json-c-0.14.patch
Modified:
  libu2f-host/trunk/PKGBUILD

-------------------+
 PKGBUILD          |    9 ++++++---
 json-c-0.14.patch |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-25 15:01:19 UTC (rev 620822)
+++ PKGBUILD	2020-04-25 15:01:21 UTC (rev 620823)
@@ -2,7 +2,7 @@
 
 pkgname=libu2f-host
 pkgver=1.1.10
-pkgrel=2
+pkgrel=3
 pkgdesc="Yubico Universal 2nd Factor (U2F) Host C Library"
 arch=('x86_64')
 url='https://github.com/Yubico/libu2f-host'
@@ -10,13 +10,16 @@
 depends=('json-c' 'hidapi')
 makedepends=('git' 'help2man' 'gengetopt')
 validpgpkeys=('0A3B0262BCA1705307D5FF06BCA00FD4B2168C0A') # Klas Lindfors <klas at yubico.com>
-source=("https://developers.yubico.com/${pkgname}/Releases/${pkgname}-${pkgver}.tar.xz"{,.sig})
+source=("https://developers.yubico.com/${pkgname}/Releases/${pkgname}-${pkgver}.tar.xz"{,.sig}           json-c-0.14.patch)
 sha256sums=('4265789ec59555a1f383ea2d75da085f78ee4cf1cd7c44a2b38662de02dd316f'
-            'SKIP')
+            'SKIP'
+            '47a662c1a2bc33232bda68059025fc17e33db06107495a7e9067777c39663387')
 
 prepare() {
 	cd "${pkgname}-${pkgver}"
 
+	patch -Np1 -i ../json-c-0.14.patch
+
 	sed -i 's/, GROUP="plugdev", MODE="0660"//' 70-u2f.rules
 }
 

Added: json-c-0.14.patch
===================================================================
--- json-c-0.14.patch	                        (rev 0)
+++ json-c-0.14.patch	2020-04-25 15:01:21 UTC (rev 620823)
@@ -0,0 +1,34 @@
+From 840f01135d2892f45e71b9e90405de587991bd03 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82 at fedoraproject.org>
+Date: Mon, 13 Apr 2020 14:12:25 +0200
+Subject: [PATCH] Add support for upcoming json-c 0.14.0.
+
+TRUE/FALSE are not defined anymore.  1 and 0 are used instead.
+---
+ u2f-host/u2fmisc.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/u2f-host/u2fmisc.c b/u2f-host/u2fmisc.c
+index e40ca3d..5a032ce 100644
+--- a/u2f-host/u2fmisc.c
++++ b/u2f-host/u2fmisc.c
+@@ -33,6 +33,19 @@ typedef int json_bool;
+ #define u2fh_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)FALSE : (json_bool)TRUE
+ #endif
+ 
++/* json-c 0.13.99 does not define TRUE/FALSE anymore
++ * the json-c maintainers replaced them with pure 1/0
++ * https://github.com/json-c/json-c/commit/0992aac61f8b
++ */
++#if defined JSON_C_VERSION_NUM && JSON_C_VERSION_NUM >= ((13 << 8) | 99)
++#ifndef FALSE
++#define FALSE 0
++#endif
++#ifndef TRUE
++#define TRUE  1
++#endif
++#endif
++
+ static void
+ dumpHex (unsigned char *data, int offs, int len)
+ {


More information about the arch-commits mailing list