From 5dd20fae7f621d0a786c511ec535ecaeb89a3c7daf578cbb05124ae32b78f2b3 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Wed, 12 Feb 2020 08:41:15 +0000 Subject: [PATCH] Accepting request 773600 from home:Guillaume_G:branches:devel:libraries:c_c++ - Fix build on non-x86 architectures - boo#1163385 * jsoncpp-f11611c8785082ead760494cba06196f14a06dcb.patch - From 1.9.1 to 1.9.2, features.h has been renamed json_features.h so, add a symlink for compatibility - boo#1163385 OBS-URL: https://build.opensuse.org/request/show/773600 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/jsoncpp?expand=0&rev=55 --- ...11c8785082ead760494cba06196f14a06dcb.patch | 45 +++++++++++++++++++ jsoncpp.changes | 8 ++++ jsoncpp.spec | 8 ++++ 3 files changed, 61 insertions(+) create mode 100644 jsoncpp-f11611c8785082ead760494cba06196f14a06dcb.patch diff --git a/jsoncpp-f11611c8785082ead760494cba06196f14a06dcb.patch b/jsoncpp-f11611c8785082ead760494cba06196f14a06dcb.patch new file mode 100644 index 0000000..93780c4 --- /dev/null +++ b/jsoncpp-f11611c8785082ead760494cba06196f14a06dcb.patch @@ -0,0 +1,45 @@ +From f11611c8785082ead760494cba06196f14a06dcb Mon Sep 17 00:00:00 2001 +From: Andrew Childs +Date: Sat, 28 Dec 2019 16:04:24 +0900 +Subject: [PATCH] json_writer: fix inverted sense in isAnyCharRequiredQuoting + (#1120) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This bug is only affects platforms where `char` is unsigned. + +When char is a signed type, values >= 0x80 are also considered < 0, +and hence require escaping due to the < ' ' condition. + +When char is an unsigned type, values >= 0x80 match none of the +conditions and are considered safe to emit without escaping. + +This shows up as a test failure: + +* Detail of EscapeSequenceTest/writeEscapeSequence test failure: +/build/source/src/test_lib_json/main.cpp(3370): expected == result + Expected: '["\"","\\","\b","\f","\n","\r","\t","\u0278","\ud852\udf62"] + ' + Actual : '["\"","\\","\b","\f","\n","\r","\t","ɸ","𤭢"] + ' +--- + src/lib_json/json_writer.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp +index 8e06cca2..56195dc1 100644 +--- a/src/lib_json/json_writer.cpp ++++ b/src/lib_json/json_writer.cpp +@@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) { + + char const* const end = s + n; + for (char const* cur = s; cur < end; ++cur) { +- if (*cur == '\\' || *cur == '\"' || *cur < ' ' || +- static_cast(*cur) < 0x80) ++ if (*cur == '\\' || *cur == '\"' || ++ static_cast(*cur) < ' ' || ++ static_cast(*cur) >= 0x80) + return true; + } + return false; diff --git a/jsoncpp.changes b/jsoncpp.changes index a582284..b7ff70d 100644 --- a/jsoncpp.changes +++ b/jsoncpp.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Feb 12 07:46:21 UTC 2020 - Guillaume GARDET + +- Fix build on non-x86 architectures - boo#1163385 + * jsoncpp-f11611c8785082ead760494cba06196f14a06dcb.patch +- From 1.9.1 to 1.9.2, features.h has been renamed json_features.h + so, add a symlink for compatibility - boo#1163385 + ------------------------------------------------------------------- Mon Feb 3 15:35:00 UTC 2020 - Martin Pluskal diff --git a/jsoncpp.spec b/jsoncpp.spec index 26c80df..f76a9ef 100644 --- a/jsoncpp.spec +++ b/jsoncpp.spec @@ -25,6 +25,8 @@ License: MIT Group: Development/Libraries/C and C++ URL: https://github.com/open-source-parsers/jsoncpp Source0: https://github.com/open-source-parsers/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM - https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb +Patch1: jsoncpp-f11611c8785082ead760494cba06196f14a06dcb.patch BuildRequires: gcc-c++ BuildRequires: meson >= 0.50.0 BuildRequires: pkgconfig @@ -68,6 +70,7 @@ format to store user input files. %prep %setup -q +%patch1 -p1 %build %meson \ @@ -75,6 +78,11 @@ format to store user input files. %install %meson_install +pushd %{buildroot}%{_includedir}/json/ +# From 1.9.1 to 1.9.2, features.h has been renamed json_features.h +# so, create a symlink for compatibility +ln -s json_features.h features.h +popd %check %meson_test