From 80fca9e122f2053ddd5d22db437240d8f981129f Mon Sep 17 00:00:00 2001 From: Johannes Kliemann Date: Fri, 2 Feb 2018 22:55:37 +0100 Subject: [PATCH] port of json-c library --- lib/import/import-jsonc.mk | 3 + lib/mk/jsonc.mk | 23 +++ ports/jsonc.hash | 1 + ports/jsonc.port | 14 ++ src/lib/jsonc/jsonc_config.patch | 201 ++++++++++++++++++++++++++ src/lib/jsonc/jsonc_json_config.patch | 9 ++ 6 files changed, 251 insertions(+) create mode 100644 lib/import/import-jsonc.mk create mode 100644 lib/mk/jsonc.mk create mode 100644 ports/jsonc.hash create mode 100644 ports/jsonc.port create mode 100644 src/lib/jsonc/jsonc_config.patch create mode 100644 src/lib/jsonc/jsonc_json_config.patch diff --git a/lib/import/import-jsonc.mk b/lib/import/import-jsonc.mk new file mode 100644 index 0000000..26dd4ac --- /dev/null +++ b/lib/import/import-jsonc.mk @@ -0,0 +1,3 @@ +JSONC_PORT_DIR := $(call select_from_ports,jsonc) + +INC_DIR += $(JSONC_PORT_DIR)/include/jsonc diff --git a/lib/mk/jsonc.mk b/lib/mk/jsonc.mk new file mode 100644 index 0000000..f167536 --- /dev/null +++ b/lib/mk/jsonc.mk @@ -0,0 +1,23 @@ +JSONC_DIR := $(call select_from_ports,jsonc)/src/lib/jsonc + +include $(REP_DIR)/lib/import/import-jsonc.mk + +SRC_C = arraylist.c \ + debug.c \ + json_c_version.c \ + json_object.c \ + json_object_iterator.c \ + json_pointer.c \ + json_tokener.c \ + json_util.c \ + json_visit.c \ + linkhash.c \ + printbuf.c \ + random_seed.c \ + strerror_override.c + +vpath %.c $(JSONC_DIR) + +INC_DIR += $(JSONC_DIR) + +LIBS += libc diff --git a/ports/jsonc.hash b/ports/jsonc.hash new file mode 100644 index 0000000..bb17c98 --- /dev/null +++ b/ports/jsonc.hash @@ -0,0 +1 @@ +dd87c15fcc3ebf95995928e8e12e2121b24ca5ed diff --git a/ports/jsonc.port b/ports/jsonc.port new file mode 100644 index 0000000..57ece37 --- /dev/null +++ b/ports/jsonc.port @@ -0,0 +1,14 @@ +LICENSE := MIT +VERSION := git +DOWNLOADS := jsonc.git + +URL(jsonc) := https://github.com/json-c/json-c.git +REV(jsonc) := f8eb1dec64440d68149ce6ac70756af18a90bfb9 +DIR(jsonc) := src/lib/jsonc + +DIRS += include/jsonc +DIR_CONTENT(include/jsonc) := src/lib/jsonc/*.h + +PATCHES += src/lib/jsonc/jsonc_config.patch +PATCHES += src/lib/jsonc/jsonc_json_config.patch + diff --git a/src/lib/jsonc/jsonc_config.patch b/src/lib/jsonc/jsonc_config.patch new file mode 100644 index 0000000..5f587b0 --- /dev/null +++ b/src/lib/jsonc/jsonc_config.patch @@ -0,0 +1,201 @@ +diff --git src/lib/jsonc/config.h src/lib/jsonc/config.h +index e69de29..034d98b 100644 +--- src/lib/jsonc/config.h ++++ src/lib/jsonc/config.h +@@ -0,0 +1,196 @@ ++/* config.h. Generated from config.h.in by configure. */ ++/* config.h.in. Generated from configure.ac by autoheader. */ ++ ++/* Enable RDRAND Hardware RNG Hash Seed */ ++/* #undef ENABLE_RDRAND */ ++ ++/* Enable partial threading support */ ++/* #undef ENABLE_THREADING */ ++ ++/* Define if .gnu.warning accepts long strings. */ ++/* #undef HAS_GNU_WARNING_LONG */ ++ ++/* Has atomic builtins */ ++#define HAVE_ATOMIC_BUILTINS 1 ++ ++/* Define to 1 if you have the declaration of `INFINITY', and to 0 if you ++ don't. */ ++#define HAVE_DECL_INFINITY 1 ++ ++/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. ++ */ ++#define HAVE_DECL_ISINF 1 ++ ++/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. ++ */ ++#define HAVE_DECL_ISNAN 1 ++ ++/* Define to 1 if you have the declaration of `nan', and to 0 if you don't. */ ++#define HAVE_DECL_NAN 1 ++ ++/* Define to 1 if you have the declaration of `_finite', and to 0 if you ++ don't. */ ++#define HAVE_DECL__FINITE 0 ++ ++/* Define to 1 if you have the declaration of `_isnan', and to 0 if you don't. ++ */ ++#define HAVE_DECL__ISNAN 0 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_DLFCN_H 1 ++ ++/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ ++/* #undef HAVE_DOPRNT */ ++ ++/* Define to 1 if you have the header file. */ ++/* #undef HAVE_ENDIAN_H */ ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_FCNTL_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_INTTYPES_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_LIMITS_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_LOCALE_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_MEMORY_H 1 ++ ++/* Define to 1 if you have the `open' function. */ ++#define HAVE_OPEN 1 ++ ++/* Define to 1 if you have the `realloc' function. */ ++#define HAVE_REALLOC 1 ++ ++/* Define to 1 if you have the `setlocale' function. */ ++#define HAVE_SETLOCALE 1 ++ ++/* Define to 1 if you have the `snprintf' function. */ ++#define HAVE_SNPRINTF 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STDARG_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STDINT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STDLIB_H 1 ++ ++/* Define to 1 if you have the `strcasecmp' function. */ ++#define HAVE_STRCASECMP 1 ++ ++/* Define to 1 if you have the `strdup' function. */ ++#define HAVE_STRDUP 1 ++ ++/* Define to 1 if you have the `strerror' function. */ ++#define HAVE_STRERROR 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STRINGS_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_STRING_H 1 ++ ++/* Define to 1 if you have the `strncasecmp' function. */ ++#define HAVE_STRNCASECMP 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYSLOG_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_CDEFS_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_PARAM_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_STAT_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_SYS_TYPES_H 1 ++ ++/* Define to 1 if you have the header file. */ ++#define HAVE_UNISTD_H 1 ++ ++/* Define to 1 if you have the `uselocale' function. */ ++/* #undef HAVE_USELOCALE */ ++ ++/* Define to 1 if you have the `vasprintf' function. */ ++#define HAVE_VASPRINTF 1 ++ ++/* Define to 1 if you have the `vprintf' function. */ ++#define HAVE_VPRINTF 1 ++ ++/* Define to 1 if you have the `vsnprintf' function. */ ++#define HAVE_VSNPRINTF 1 ++ ++/* Define to 1 if you have the `vsyslog' function. */ ++#define HAVE_VSYSLOG 1 ++ ++/* Define to 1 if you have the header file. */ ++/* #undef HAVE_XLOCALE_H */ ++ ++/* Have __thread */ ++#define HAVE___THREAD 1 ++ ++/* Public define for json_inttypes.h */ ++#define JSON_C_HAVE_INTTYPES_H 1 ++ ++/* Define to the sub-directory where libtool stores uninstalled libraries. */ ++#define LT_OBJDIR ".libs/" ++ ++/* Name of package */ ++#define PACKAGE "json-c" ++ ++/* Define to the address where bug reports for this package should be sent. */ ++#define PACKAGE_BUGREPORT "json-c@googlegroups.com" ++ ++/* Define to the full name of this package. */ ++#define PACKAGE_NAME "json-c" ++ ++/* Define to the full name and version of this package. */ ++#define PACKAGE_STRING "json-c 0.13.99" ++ ++/* Define to the one symbol short name of this package. */ ++#define PACKAGE_TARNAME "json-c" ++ ++/* Define to the home page for this package. */ ++#define PACKAGE_URL "" ++ ++/* Define to the version of this package. */ ++#define PACKAGE_VERSION "0.13.99" ++ ++/* The number of bytes in type int */ ++#define SIZEOF_INT 4 ++ ++/* The number of bytes in type int64_t */ ++#define SIZEOF_INT64_T 8 ++ ++/* The number of bytes in type long */ ++#define SIZEOF_LONG 8 ++ ++/* The number of bytes in type long long */ ++#define SIZEOF_LONG_LONG 8 ++ ++/* The number of bytes in type size_t */ ++#define SIZEOF_SIZE_T 8 ++ ++/* Specifier for __thread */ ++#define SPEC___THREAD __thread ++ ++/* Define to 1 if you have the ANSI C header files. */ ++#define STDC_HEADERS 1 ++ ++/* Version number of package */ ++#define VERSION "0.13.99" ++ ++/* Define to empty if `const' does not conform to ANSI C. */ ++/* #undef const */ ++ ++/* Define to `unsigned int' if does not define. */ ++/* #undef size_t */ diff --git a/src/lib/jsonc/jsonc_json_config.patch b/src/lib/jsonc/jsonc_json_config.patch new file mode 100644 index 0000000..c882428 --- /dev/null +++ b/src/lib/jsonc/jsonc_json_config.patch @@ -0,0 +1,9 @@ +diff --git src/lib/jsonc/json_config.h src/lib/jsonc/json_config.h +index e69de29..965ff1c 100644 +--- src/lib/jsonc/json_config.h ++++ src/lib/jsonc/json_config.h +@@ -0,0 +1,4 @@ ++/* json_config.h. Generated from json_config.h.in by configure. */ ++ ++/* Define to 1 if you have the header file. */ ++#define JSON_C_HAVE_INTTYPES_H 1