23169134 Move json-c library to Userland
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Mon, 25 Apr 2016 23:38:13 -0700
changeset 5890 e3686c085735
parent 5889 d78a523a8925
child 5891 196a7310cc4d
23169134 Move json-c library to Userland 16908756 json-c package has wrong upstream-url
components/json-c/Makefile
components/json-c/json-c.p5m
components/json-c/patches/0001-Remove-unused-variable-size.patch
components/json-c/patches/0002-json_parse_int64.patch
components/json-c/test/results-all.master
components/meta-packages/incorporation-cache
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/json-c/Makefile	Mon Apr 25 23:38:13 2016 -0700
@@ -0,0 +1,58 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+COMPILER =		gcc
+BUILD_BITS =            32_and_64
+include ../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		json-c
+COMPONENT_VERSION=	0.12
+COMPONENT_PROJECT_URL=	https://github.com/json-c/json-c/wiki/
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH= \
+    sha256:000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f
+COMPONENT_ARCHIVE_URL=	https://s3.amazonaws.com/json-c_releases/releases/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	library/json-c
+
+TPNO=			21444
+
+include $(WS_MAKE_RULES)/common.mk
+
+COMPONENT_PREP_ACTION += (cd $(@D) ; autoreconf -fiv )
+
+# Tests can't find their headers or data files unless we clone the source tree
+COMPONENT_PRE_CONFIGURE_ACTION += ($(CLONEY) $(SOURCE_DIR) $(@D));
+
+# Needed for "gmake test" to work successfully.
+unexport SHELLOPTS
+
+# Standard automake test framework results transform
+COMPONENT_TEST_TRANSFORMS += \
+        '-n ' \
+        '-e "/TOTAL/p" ' \
+        '-e "/SKIP/p" ' \
+        '-e "/PASS/p" ' \
+        '-e "/FAIL/p" ' \
+        '-e "/ERROR/p" '
+
+COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/json-c/json-c.p5m	Mon Apr 25 23:38:13 2016 -0700
@@ -0,0 +1,59 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+#
+
+set name=pkg.fmri \
+    value=pkg:/library/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="JSON Implementation in C"
+set name=com.oracle.info.description value="JSON Implementation in C"
+set name=com.oracle.info.tpno value=$(TPNO)
+set name=info.classification \
+    value=org.opensolaris.category.2008:System/Libraries
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2015/095
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+#
+file path=usr/include/json-c/arraylist.h
+file path=usr/include/json-c/bits.h
+file path=usr/include/json-c/debug.h
+file path=usr/include/json-c/json.h
+file path=usr/include/json-c/json_c_version.h
+file path=usr/include/json-c/json_config.h
+file path=usr/include/json-c/json_inttypes.h
+file path=usr/include/json-c/json_object.h
+file path=usr/include/json-c/json_object_iterator.h
+file path=usr/include/json-c/json_object_private.h
+file path=usr/include/json-c/json_tokener.h
+file path=usr/include/json-c/json_util.h
+file path=usr/include/json-c/linkhash.h
+file path=usr/include/json-c/printbuf.h
+file path=usr/include/json-c/random_seed.h
+link path=usr/lib/$(MACH64)/libjson-c.so target=libjson-c.so.2.0.1
+link path=usr/lib/$(MACH64)/libjson-c.so.2 target=libjson-c.so.2.0.1
+file path=usr/lib/$(MACH64)/libjson-c.so.2.0.1
+file path=usr/lib/$(MACH64)/pkgconfig/json-c.pc
+link path=usr/lib/libjson-c.so target=libjson-c.so.2.0.1
+link path=usr/lib/libjson-c.so.2 target=libjson-c.so.2.0.1
+file path=usr/lib/libjson-c.so.2.0.1
+file path=usr/lib/pkgconfig/json-c.pc
+license COPYING license=MIT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/json-c/patches/0001-Remove-unused-variable-size.patch	Mon Apr 25 23:38:13 2016 -0700
@@ -0,0 +1,35 @@
+Patch from upstream git master branch to fix build failures due to
+newer gcc issuing a unused variable warning here that the -Werror
+hardcoded in the Makefiles makes fatal.
+
+https://github.com/json-c/json-c/issues/159
+
+From 3859e99f50abe11a8dade28efa9ea3d99dfaac11 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petar=20Koreti=C4=87?= <[email protected]>
+Date: Fri, 11 Apr 2014 10:03:40 +0200
+Subject: [PATCH] Remove unused variable 'size'
+
+---
+ json_tokener.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/json_tokener.c b/json_tokener.c
+index 19de8ef..9a76293 100644
+--- a/json_tokener.c
++++ b/json_tokener.c
[email protected]@ -352,12 +352,10 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
+ 
+     case json_tokener_state_inf: /* aka starts with 'i' */
+       {
+-	int size;
+ 	int size_inf;
+ 	int is_negative = 0;
+ 
+ 	printbuf_memappend_fast(tok->pb, &c, 1);
+-	size = json_min(tok->st_pos+1, json_null_str_len);
+ 	size_inf = json_min(tok->st_pos+1, json_inf_str_len);
+ 	char *infbuf = tok->pb->buf;
+ 	if (*infbuf == '-')
+-- 
+2.7.4
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/json-c/patches/0002-json_parse_int64.patch	Mon Apr 25 23:38:13 2016 -0700
@@ -0,0 +1,16 @@
+Patch from https://github.com/json-c/json-c/issues/173 to workaround sscanf
+compatibility issue that causes test failures with Solaris libc.
+
+Need to investigate if we should update our libc sscanf to be more compatible.
+
+--- json-c-0.12/json_util.c.~1~ 2014-04-11 04:41:08.000000000 +0400
++++ json-c-0.12/json_util.c     2015-03-15 14:49:17.934357502 +0300
[email protected]@ -221,7 +222,7 @@
+ 		// Skip leading zeros, but keep at least one digit
+ 		while (buf_sig_digits[0] == '0' && buf_sig_digits[1] != '\0')
+ 			buf_sig_digits++;
+-		if (num64 == 0) // assume all sscanf impl's will parse -0 to 0
++		if (buf_sig_digits[0] == '0' && buf_sig_digits[1] == '\0') 
+ 			orig_has_neg = 0; // "-0" is the same as just plain "0"
+ 
+ 		snprintf(buf_cmp_start, sizeof(buf_cmp), "%" PRId64, num64);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/json-c/test/results-all.master	Mon Apr 25 23:38:13 2016 -0700
@@ -0,0 +1,19 @@
+PASS: test1.test
+PASS: test2.test
+PASS: test4.test
+PASS: testReplaceExisting.test
+PASS: test_parse_int64.test
+PASS: test_null.test
+PASS: test_cast.test
+PASS: test_parse.test
+PASS: test_locale.test
+PASS: test_charcase.test
+PASS: test_printbuf.test
+PASS: test_set_serializer.test
+# TOTAL: 12
+# PASS:  12
+# SKIP:  0
+# XFAIL: 0
+# FAIL:  0
+# XPASS: 0
+# ERROR: 0
--- a/components/meta-packages/incorporation-cache	Wed Apr 27 22:34:47 2016 -0700
+++ b/components/meta-packages/incorporation-cache	Mon Apr 25 23:38:13 2016 -0700
@@ -188,7 +188,6 @@
 consolidation/userland/userland-incorporation:library/desktop/[email protected]
 consolidation/userland/userland-incorporation:library/[email protected]
 consolidation/userland/userland-incorporation:library/[email protected]
-consolidation/userland/userland-incorporation:library/[email protected]
 consolidation/userland/userland-incorporation:library/[email protected]
 consolidation/userland/userland-incorporation:library/[email protected]
 consolidation/userland/userland-incorporation:library/[email protected]