After more than 2 years json-c received an update, which fixes quite
some issues. Most noticeable changes have been listed in
https://github.com/json-c/json-c/blob/master/ChangeLog

I bumped the major number of SHARED_LIB as functions have been added,
and removed. HOMEPAGE has been updated as the original one is not
reachable.

There is no need for patching in detection of
__sync_val_compare_and_swap as this has been resolved upstream:

https://github.com/json-c/json-c/commit/0539191d187050faad0ed2657cddfd411e4c7900#diff-b1c3915d42e849f17e1ddf2d95111063

Output 'make test':

# TOTAL: 21
# # PASS:  21
# # SKIP:  0
# # XFAIL: 0
# # FAIL:  0
# # XPASS: 0
# # ERROR: 0

Of the 23 victims of devel/json-c I only tested net/isc-bind
(rndc-confgen to be more precise), which seems to work ok. It would be
great if more people could check if this update works for them.

Comments?

-- 
Björn Ketelaars
GPG key: 0x4F0E5F21


diff --git Makefile Makefile
index f411b5cac55..1ebc6f666d3 100644
--- Makefile
+++ Makefile
@@ -2,19 +2,19 @@
 
 COMMENT=               JSON implementation in C
 
-DISTNAME=              json-c-0.12
-REVISION=              2
+DISTNAME=              json-c-0.13
 CATEGORIES=            devel
 
-SHARED_LIBS +=  json-c                    0.0 # 2.1
+SHARED_LIBS=           json-c  1.0     # 0.0   # 3.1
 
-HOMEPAGE=              http://oss.metaparadigm.com/json-c/
+HOMEPAGE=              https://github.com/json-c/json-c/wiki
 
 # MIT
 PERMIT_PACKAGE_CDROM=  Yes
 
 MASTER_SITES =         https://s3.amazonaws.com/json-c_releases/releases/
 
+SEPARATE_BUILD=                Yes
 CONFIGURE_STYLE=       autoconf
 AUTOCONF_VERSION=      2.69
 
@@ -23,8 +23,4 @@ AUTOCONF_VERSION=     2.69
 # (the cpuid code will probably break with PIE on i386 too).
 CONFIGURE_ARGS=                --disable-rdrand
 
-# wrong mtime in 0.12
-post-extract:
-       touch ${WRKSRC}/config.h.in
-
 .include <bsd.port.mk>
diff --git distinfo distinfo
index 47426a72a20..2f8036505f7 100644
--- distinfo
+++ distinfo
@@ -1,2 +1,2 @@
-SHA256 (json-c-0.12.tar.gz) = AAwBsrP4LctCYXUetx8bCEQE+31qKC8GB008FweLnz8=
-SIZE (json-c-0.12.tar.gz) = 501419
+SHA256 (json-c-0.13.tar.gz) = AxZ4C+mtFsQtfCawFaeE/V30sJCf7wq6Uc+xPkkqwk0=
+SIZE (json-c-0.13.tar.gz) = 634720
diff --git patches/patch-configure_ac patches/patch-configure_ac
index 0ea180e3301..3d0147d32be 100644
--- patches/patch-configure_ac
+++ patches/patch-configure_ac
@@ -2,37 +2,15 @@ $OpenBSD: patch-configure_ac,v 1.3 2017/09/25 10:09:40 sthen 
Exp $
 Index: configure.ac
 --- configure.ac.orig
 +++ configure.ac
-@@ -43,6 +43,7 @@ AC_FUNC_MEMCMP
- AC_FUNC_MALLOC
- AC_FUNC_REALLOC
+@@ -76,6 +76,7 @@ AC_FUNC_VPRINTF
+ AC_FUNC_MEMCMP
+ AC_CHECK_FUNCS([realloc])
  AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open 
vsyslog strncasecmp setlocale)
 +AC_SEARCH_LIBS(arc4random, bsd, [AC_DEFINE(HAVE_ARC4RANDOM, [1], [Define to 1 
if you have the `arc4random' function.])])
  AC_CHECK_DECLS([INFINITY], [], [], [[#include <math.h>]])
  AC_CHECK_DECLS([nan], [], [], [[#include <math.h>]])
  AC_CHECK_DECLS([isnan], [], [], [[#include <math.h>]])
-@@ -66,6 +67,21 @@ int main(int c,char* v) {return 0;}
-    AC_MSG_RESULT(no)
- ])
- 
-+AC_MSG_CHECKING([if compiler supports __sync_val_compare_and_swap with int 
objects])
-+AC_LINK_IFELSE([AC_LANG_SOURCE([[
-+int
-+main(void) {
-+    int r = 0;
-+    __sync_val_compare_and_swap(&r, 0, 1);
-+    return 0;
-+}
-+]])], [
-+    AC_DEFINE(HAS___SYNC_VAL_COMPARE_AND_SWAP_INT, 1, [Define if compiler 
supports __sync_val_compare_and_swap.])
-+    AC_MSG_RESULT(yes)
-+], [
-+   AC_MSG_RESULT(no)
-+])
-+
- AC_LANG_POP([C])
- 
- AM_PROG_LIBTOOL
-@@ -81,7 +97,7 @@ AS_IF([test "x$enable_Bsymbolic" = "xcheck"],
+@@ -150,7 +151,7 @@ AS_IF([test "x$enable_Bsymbolic" = "xcheck"],
          saved_LDFLAGS="${LDFLAGS}"
          AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
          LDFLAGS=-Wl,-Bsymbolic-functions
diff --git patches/patch-linkhash_c patches/patch-linkhash_c
deleted file mode 100644
index 230a0f5178b..00000000000
--- patches/patch-linkhash_c
+++ /dev/null
@@ -1,25 +0,0 @@
-$OpenBSD: patch-linkhash_c,v 1.1 2015/08/25 11:37:02 jca Exp $
---- linkhash.c.orig    Fri Apr 11 02:41:08 2014
-+++ linkhash.c Mon Aug 24 20:41:34 2015
-@@ -23,6 +23,7 @@
- 
- #include "random_seed.h"
- #include "linkhash.h"
-+#include "config.h"
- 
- void lh_abort(const char *msg, ...)
- {
-@@ -405,12 +406,11 @@ unsigned long lh_char_hash(const void *k)
-               int seed;
-               /* we can't use -1 as it is the unitialized sentinel */
-               while ((seed = json_c_get_random_seed()) == -1);
--#if defined __GNUC__
-+#if defined HAS___SYNC_VAL_COMPARE_AND_SWAP_INT
-               __sync_val_compare_and_swap(&random_seed, -1, seed);
- #elif defined _MSC_VER
-               InterlockedCompareExchange(&random_seed, seed, -1);
- #else
--#warning "racy random seed initializtion if used by multiple threads"
-               random_seed = seed; /* potentially racy */
- #endif
-       }
diff --git patches/patch-random_seed_c patches/patch-random_seed_c
index 3c5c2d18307..246bf06e971 100644
--- patches/patch-random_seed_c
+++ patches/patch-random_seed_c
@@ -1,7 +1,8 @@
 $OpenBSD: patch-random_seed_c,v 1.1 2016/05/17 16:59:23 jca Exp $
---- random_seed.c.orig Fri Apr 11 02:41:08 2014
-+++ random_seed.c      Mon May  9 20:43:17 2016
-@@ -227,6 +227,9 @@ int json_c_get_random_seed()
+Index: random_seed.c
+--- random_seed.c.orig
++++ random_seed.c
+@@ -228,6 +228,9 @@ int json_c_get_random_seed()
  #if HAVE_RDRAND
      if (has_rdrand()) return get_rdrand_seed();
  #endif
diff --git pkg/PLIST pkg/PLIST
index e07cdbe038a..42c7730ca56 100644
--- pkg/PLIST
+++ pkg/PLIST
@@ -9,12 +9,12 @@ include/json-c/json_config.h
 include/json-c/json_inttypes.h
 include/json-c/json_object.h
 include/json-c/json_object_iterator.h
-include/json-c/json_object_private.h
+include/json-c/json_pointer.h
 include/json-c/json_tokener.h
 include/json-c/json_util.h
+include/json-c/json_visit.h
 include/json-c/linkhash.h
 include/json-c/printbuf.h
-include/json-c/random_seed.h
 lib/libjson-c.a
 lib/libjson-c.la
 @lib lib/libjson-c.so.${LIBjson-c_VERSION}

Reply via email to