Update jsoncpp to 1.9.4

This version includes all CVS patches and fixes some security related bugs.
There is no longer any reason why we should install jsoncpp headers not in the
default path (include/json). Now we follow the "default" again.

Tested with all consumers and also with possible consumers. Thanks sthen@

OK jca@
This commit is contained in:
rsadowski 2020-11-09 05:22:52 +00:00
parent fb00ac9917
commit 4cb77fc6be
7 changed files with 24 additions and 221 deletions

View File

@ -1,14 +1,13 @@
# $OpenBSD: Makefile,v 1.29 2019/07/12 20:44:36 sthen Exp $
# $OpenBSD: Makefile,v 1.30 2020/11/09 05:22:52 rsadowski Exp $
COMMENT = JSON parsing C++ API
GH_ACCOUNT = open-source-parsers
GH_PROJECT = jsoncpp
GH_TAGNAME = 1.8.4
REVISION = 2
GH_TAGNAME = 1.9.4
# no upstream revision
SHARED_LIBS = jsoncpp 4.0
SHARED_LIBS = jsoncpp 5.0
CATEGORIES = devel
@ -21,7 +20,13 @@ WANTLIB = m ${COMPILER_LIBCXX}
COMPILER = base-clang ports-gcc base-gcc
MODULES = devel/meson
MODULES = devel/meson \
lang/python
CONFIGURE_STYLE = meson
MODPY_RUNDEP = No
MODPY_VERSION = ${MODPY_DEFAULT_VERSION_3}
TEST_ENV += LD_PRELOAD=${WRKBUILD}/libjsoncpp.so.${LIBjsoncpp_VERSION}

View File

@ -1,2 +1,2 @@
SHA256 (jsoncpp-1.8.4.tar.gz) = xJ3qyeCTO8twRPCFFoYaLVYJiFQLI94qwa1EOyGa/bY=
SIZE (jsoncpp-1.8.4.tar.gz) = 200226
SHA256 (jsoncpp-1.9.4.tar.gz) = 40piioFCZDuXbHIz7zgUV++teUaMZ8sa4Lg6M9dJOZk=
SIZE (jsoncpp-1.9.4.tar.gz) = 214057

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-include_json_config_h,v 1.4 2018/02/18 20:50:25 jca Exp $
"explicit" on non-constructors are a C++11 feature
https://github.com/open-source-parsers/jsoncpp/commit/04abe38148d99b2a5270521935115d769a714adc
Index: include/json/config.h
--- include/json/config.h.orig
+++ include/json/config.h
@@ -84,15 +84,23 @@
#if __cplusplus >= 201103L
# define JSONCPP_OVERRIDE override
# define JSONCPP_NOEXCEPT noexcept
+# define JSONCPP_OP_EXPLICIT explicit
#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
# define JSONCPP_OVERRIDE override
# define JSONCPP_NOEXCEPT throw()
+# if _MSC_VER >= 1800 // MSVC 2013
+# define JSONCPP_OP_EXPLICIT explicit
+# else
+# define JSONCPP_OP_EXPLICIT
+# endif
#elif defined(_MSC_VER) && _MSC_VER >= 1900
# define JSONCPP_OVERRIDE override
# define JSONCPP_NOEXCEPT noexcept
+# define JSONCPP_OP_EXPLICIT explicit
#else
# define JSONCPP_OVERRIDE
# define JSONCPP_NOEXCEPT throw()
+# define JSONCPP_OP_EXPLICIT
#endif
#ifndef JSON_HAS_RVALUE_REFERENCES

View File

@ -1,48 +0,0 @@
$OpenBSD: patch-include_json_value_h,v 1.3 2018/02/18 20:50:25 jca Exp $
"explicit" on non-constructors are a C++11 feature
https://github.com/open-source-parsers/jsoncpp/commit/04abe38148d99b2a5270521935115d769a714adc
XXX Revert commit 23c44d9f9eed8a7ff95daca9bd44526067c144c0 to avoid
undefined references when linking cmake.
commit 23c44d9f9eed8a7ff95daca9bd44526067c144c0
Author: Dhruv Paranjape <lord.dhruv@gmail.com>
Date: Sat Jul 8 12:00:47 2017
overload append function for R value references.
Index: include/json/value.h
--- include/json/value.h.orig
+++ include/json/value.h
@@ -322,10 +322,6 @@ Json::Value obj_value(Json::objectValue); // {}
Value(bool value);
/// Deep copy.
Value(const Value& other);
-#if JSON_HAS_RVALUE_REFERENCES
- /// Move constructor
- Value(Value&& other);
-#endif
~Value();
/// Deep copy, then swap(other).
@@ -401,7 +397,7 @@ Json::Value obj_value(Json::objectValue); // {}
bool empty() const;
/// Return !isNull()
- explicit operator bool() const;
+ JSONCPP_OP_EXPLICIT operator bool() const;
/// Remove all object members and array elements.
/// \pre type() is arrayValue, objectValue, or nullValue
@@ -451,10 +447,6 @@ Json::Value obj_value(Json::objectValue); // {}
///
/// Equivalent to jsonvalue[jsonvalue.size()] = value;
Value& append(const Value& value);
-
-#if JSON_HAS_RVALUE_REFERENCES
- Value& append(Value&& value);
-#endif
/// Access an object value by name, create a null member if it does not exist.
/// \note Because of our implementation, keys are limited to 2^30 -1 chars.

View File

@ -1,80 +0,0 @@
$OpenBSD: patch-meson_build,v 1.6 2019/06/11 11:15:04 naddy Exp $
implicit_include_directories : false
Prevent libc++ headers from picking up <version> file; the header
files are under include/
Index: meson.build
--- meson.build.orig
+++ meson.build
@@ -25,7 +25,7 @@ jsoncpp_gen_sources = configure_file(
output : 'version.h',
configuration : jsoncpp_cdata,
install : true,
- install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'json')
+ install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'jsoncpp', 'json')
)
jsoncpp_headers = [
@@ -43,8 +43,11 @@ jsoncpp_include_directories = include_directories('inc
install_headers(
jsoncpp_headers,
- subdir : 'json')
+ subdir : 'jsoncpp/json')
+thread_dep = dependency('threads')
+no_asneeded = '-Wl,--no-as-needed'
+
jsoncpp_lib = library(
'jsoncpp',
[ jsoncpp_gen_sources,
@@ -55,12 +58,16 @@ jsoncpp_lib = library(
'src/lib_json/json_writer.cpp'],
soversion : 20,
install : true,
+ dependencies : thread_dep,
+ link_args : no_asneeded,
+ implicit_include_directories : false,
include_directories : jsoncpp_include_directories)
import('pkgconfig').generate(
libraries : jsoncpp_lib,
version : meson.project_version(),
name : 'jsoncpp',
+ subdirs : 'jsoncpp',
filebase : 'jsoncpp',
description : 'A C++ library for interacting with JSON')
@@ -68,6 +75,8 @@ import('pkgconfig').generate(
jsoncpp_dep = declare_dependency(
include_directories : jsoncpp_include_directories,
link_with : jsoncpp_lib,
+ dependencies : thread_dep,
+ link_args : no_asneeded,
version : meson.project_version(),
sources : jsoncpp_gen_sources)
@@ -79,8 +88,11 @@ jsoncpp_test = executable(
[ 'src/test_lib_json/jsontest.cpp',
'src/test_lib_json/jsontest.h',
'src/test_lib_json/main.cpp'],
+ implicit_include_directories : false,
include_directories : jsoncpp_include_directories,
link_with : jsoncpp_lib,
+ dependencies : thread_dep,
+ link_args : no_asneeded,
install : false)
test(
'unittest_jsoncpp_test',
@@ -89,7 +101,10 @@ test(
jsontestrunner = executable(
'jsontestrunner',
'src/jsontestrunner/main.cpp',
+ implicit_include_directories : false,
include_directories : jsoncpp_include_directories,
+ dependencies : thread_dep,
+ link_args : no_asneeded,
link_with : jsoncpp_lib,
install : false)
test(

View File

@ -1,40 +0,0 @@
$OpenBSD: patch-src_lib_json_json_value_cpp,v 1.2 2018/02/11 09:05:59 rsadowski Exp $
XXX Revert commit 23c44d9f9eed8a7ff95daca9bd44526067c144c0 to avoid
undefined references when linking cmake.
commit 23c44d9f9eed8a7ff95daca9bd44526067c144c0
Author: Dhruv Paranjape <lord.dhruv@gmail.com>
Date: Sat Jul 8 12:00:47 2017
overload append function for R value references.
Index: src/lib_json/json_value.cpp
--- src/lib_json/json_value.cpp.orig
+++ src/lib_json/json_value.cpp
@@ -485,14 +485,6 @@ Value::Value(Value const& other)
}
}
-#if JSON_HAS_RVALUE_REFERENCES
-// Move constructor
-Value::Value(Value&& other) {
- initBasic(nullValue);
- swap(other);
-}
-#endif
-
Value::~Value() {
switch (type_) {
case nullValue:
@@ -1146,10 +1138,6 @@ Value const& Value::operator[](CppTL::ConstString cons
#endif
Value& Value::append(const Value& value) { return (*this)[size()] = value; }
-
-#if JSON_HAS_RVALUE_REFERENCES
- Value& Value::append(Value&& value) { return (*this)[size()] = std::move(value); }
-#endif
Value Value::get(char const* key, char const* cend, Value const& defaultValue) const
{

View File

@ -1,17 +1,15 @@
@comment $OpenBSD: PLIST,v 1.3 2017/08/29 09:14:16 dcoppa Exp $
include/jsoncpp/
include/jsoncpp/json/
include/jsoncpp/json/allocator.h
include/jsoncpp/json/assertions.h
include/jsoncpp/json/autolink.h
include/jsoncpp/json/config.h
include/jsoncpp/json/features.h
include/jsoncpp/json/forwards.h
include/jsoncpp/json/json.h
include/jsoncpp/json/reader.h
include/jsoncpp/json/value.h
include/jsoncpp/json/version.h
include/jsoncpp/json/writer.h
@comment $OpenBSD: PLIST,v 1.4 2020/11/09 05:22:53 rsadowski Exp $
include/json/
include/json/allocator.h
include/json/assertions.h
include/json/config.h
include/json/forwards.h
include/json/json.h
include/json/json_features.h
include/json/reader.h
include/json/value.h
include/json/version.h
include/json/writer.h
@lib lib/libjsoncpp.so.${LIBjsoncpp_VERSION}
lib/pkgconfig/jsoncpp.pc
share/doc/jsoncpp/