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

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


    Date: Saturday, April 25, 2020 @ 15:02:14
  Author: foutrelis
Revision: 620837

upgpkg: libu2f-server 1.1.0-4: json-c 0.14 rebuild

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

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

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-25 15:02:12 UTC (rev 620836)
+++ PKGBUILD	2020-04-25 15:02:14 UTC (rev 620837)
@@ -3,7 +3,7 @@
 
 pkgname=libu2f-server
 pkgver=1.1.0
-pkgrel=3
+pkgrel=4
 pkgdesc='Yubico Universal 2nd Factor (U2F) Server C Library'
 arch=('x86_64')
 url='https://developers.yubico.com/libu2f-server'
@@ -10,11 +10,18 @@
 license=('BSD')
 depends=('openssl' 'json-c')
 makedepends=('check' 'gengetopt' 'help2man')
-source=("${url}/Releases/${pkgname}-${pkgver}.tar.xz"{,.sig})
+source=("${url}/Releases/${pkgname}-${pkgver}.tar.xz"{,.sig}
+        json-c-0.14.patch)
 sha256sums=('8dcd3caeacebef6e36a42462039fd035e45fa85653dcb2013f45e15aad49a277'
-            'SKIP')
+            'SKIP'
+            'cdeaf6387e8f4b49a32e272e9aa8c7f86305b6911e8d09084125f608af72492b')
 validpgpkeys=('B70D62AA6A31AD6B9E4F9F4BDC8888925D25CA7A') # Alessio Di Mauro <alessio at yubico.com>
 
+prepare() {
+    cd "${pkgname}-${pkgver}"
+    patch -Np1 -i ../json-c-0.14.patch
+}
+
 build() {
     cd "${pkgname}-${pkgver}"
 

Added: json-c-0.14.patch
===================================================================
--- json-c-0.14.patch	                        (rev 0)
+++ json-c-0.14.patch	2020-04-25 15:02:14 UTC (rev 620837)
@@ -0,0 +1,34 @@
+From f7c4983b31909299c47bf9b2627c84b6bfe225de 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:16:20 +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-server/core.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/u2f-server/core.c b/u2f-server/core.c
+index 2fb325e..895c004 100644
+--- a/u2f-server/core.c
++++ b/u2f-server/core.c
+@@ -44,6 +44,19 @@ typedef int json_bool;
+ #define u2fs_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 u2fs_rc encode_b64u(const char *data, size_t data_len, char *output)
+ {
+   base64_encodestate b64;



More information about the arch-commits mailing list