From 1ac098f00d1f6d9c7850429d37abcbb03b17cc41 Mon Sep 17 00:00:00 2001 From: Mingli Yu Date: Mon, 4 Mar 2024 14:14:27 +0800 Subject: nlohmann-json: Upgrade to 3.11.3 Remove two backported patches and the ptest output as below. # ./run-ptest PASS: test-algorithms_cpp11 PASS: test-allocator_cpp11 PASS: test-alt-string_cpp11 PASS: test-assert_macro_cpp11 PASS: test-binary_formats_cpp11 PASS: test-bjdata_cpp11 PASS: test-bson_cpp11 PASS: test-byte_container_with_subtype_cpp11 PASS: test-capacity_cpp11 PASS: test-cbor_cpp11 PASS: test-class_const_iterator_cpp11 PASS: test-class_iterator_cpp11 PASS: test-class_lexer_cpp11 PASS: test-class_parser_cpp11 PASS: test-comparison_cpp11 PASS: test-comparison_cpp20 PASS: test-comparison_legacy_cpp11 PASS: test-comparison_legacy_cpp20 PASS: test-concepts_cpp11 PASS: test-constructor1_cpp11 PASS: test-constructor2_cpp11 PASS: test-convenience_cpp11 PASS: test-conversions_cpp11 PASS: test-conversions_cpp17 PASS: test-custom-base-class_cpp11 [snip] Signed-off-by: Mingli Yu Signed-off-by: Khem Raj --- ...llocators-define-missing-rebind-type-3895.patch | 61 ---------------------- ...iterators2-use-std-ranges-equals-for-rang.patch | 31 ----------- .../nlohmann-json/nlohmann-json_3.11.2.bb | 47 ----------------- .../nlohmann-json/nlohmann-json_3.11.3.bb | 45 ++++++++++++++++ 4 files changed, 45 insertions(+), 139 deletions(-) delete mode 100644 meta-oe/recipes-devtools/nlohmann-json/files/0001-custom-allocators-define-missing-rebind-type-3895.patch delete mode 100644 meta-oe/recipes-devtools/nlohmann-json/files/0001-tests-unit-iterators2-use-std-ranges-equals-for-rang.patch delete mode 100644 meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.2.bb create mode 100644 meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.3.bb (limited to 'meta-oe/recipes-devtools/nlohmann-json') diff --git a/meta-oe/recipes-devtools/nlohmann-json/files/0001-custom-allocators-define-missing-rebind-type-3895.patch b/meta-oe/recipes-devtools/nlohmann-json/files/0001-custom-allocators-define-missing-rebind-type-3895.patch deleted file mode 100644 index d964586c1c..0000000000 --- a/meta-oe/recipes-devtools/nlohmann-json/files/0001-custom-allocators-define-missing-rebind-type-3895.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 6cec5aefc97ad219b6fd5a4132f88f7c8f6800ee Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich -Date: Wed, 8 Mar 2023 11:31:56 +0000 -Subject: [PATCH] custom allocators: define missing 'rebind' type (#3895) - -Upstream-Status: Backport [https://github.com/nlohmann/json/commit/6cec5aefc97ad219b6fd5a4132f88f7c8f6800ee] - -Signed-off-by: Mingli Yu ---- - tests/src/unit-allocator.cpp | 9 +++++++++ - tests/src/unit-regression2.cpp | 9 +++++++++ - 2 files changed, 18 insertions(+) - -diff --git a/tests/src/unit-allocator.cpp b/tests/src/unit-allocator.cpp -index 76e3b03f..f2e63552 100644 ---- a/tests/src/unit-allocator.cpp -+++ b/tests/src/unit-allocator.cpp -@@ -20,11 +20,20 @@ struct bad_allocator : std::allocator - { - using std::allocator::allocator; - -+ bad_allocator() = default; -+ template bad_allocator(const bad_allocator& /*unused*/) { } -+ - template - void construct(T* /*unused*/, Args&& ... /*unused*/) - { - throw std::bad_alloc(); - } -+ -+ template -+ struct rebind -+ { -+ using other = bad_allocator; -+ }; - }; - } // namespace - -diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp -index 2bb9b32e..dbafb436 100644 ---- a/tests/src/unit-regression2.cpp -+++ b/tests/src/unit-regression2.cpp -@@ -189,6 +189,15 @@ class my_allocator : public std::allocator - { - public: - using std::allocator::allocator; -+ -+ my_allocator() = default; -+ template my_allocator(const my_allocator& /*unused*/) { } -+ -+ template -+ struct rebind -+ { -+ using other = my_allocator; -+ }; - }; - - ///////////////////////////////////////////////////////////////////// --- -2.25.1 - diff --git a/meta-oe/recipes-devtools/nlohmann-json/files/0001-tests-unit-iterators2-use-std-ranges-equals-for-rang.patch b/meta-oe/recipes-devtools/nlohmann-json/files/0001-tests-unit-iterators2-use-std-ranges-equals-for-rang.patch deleted file mode 100644 index 463912e4b6..0000000000 --- a/meta-oe/recipes-devtools/nlohmann-json/files/0001-tests-unit-iterators2-use-std-ranges-equals-for-rang.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 660d0b58565073975d6f5d94365d6cbf150a4cf8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= -Date: Sun, 5 Mar 2023 14:11:22 +0100 -Subject: [PATCH] tests/unit-iterators2: use std::ranges::equals for range - comparisons (#3950) - -Closes https://github.com/nlohmann/json/issues/3927 - -Upstream-Status: Backport [https://github.com/nlohmann/json/commit/660d0b58565073975d6f5d94365d6cbf150a4cf8] - -Signed-off-by: Mingli Yu ---- - tests/src/unit-iterators2.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/src/unit-iterators2.cpp b/tests/src/unit-iterators2.cpp -index 27926084..72a5d9dc 100644 ---- a/tests/src/unit-iterators2.cpp -+++ b/tests/src/unit-iterators2.cpp -@@ -943,7 +943,7 @@ TEST_CASE("iterators 2") - json j_expected{5, 4, 3, 2, 1}; - - auto reversed = j | std::views::reverse; -- CHECK(reversed == j_expected); -+ CHECK(std::ranges::equal(reversed, j_expected)); - } - - SECTION("transform") --- -2.25.1 - diff --git a/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.2.bb b/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.2.bb deleted file mode 100644 index 350932388c..0000000000 --- a/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.2.bb +++ /dev/null @@ -1,47 +0,0 @@ -SUMMARY = "JSON for modern C++" -HOMEPAGE = "https://nlohmann.github.io/json/" -SECTION = "libs" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588" - -CVE_PRODUCT = "json-for-modern-cpp" - -SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \ - git://github.com/nlohmann/json_test_data.git;destsuffix=git/json_test_data;name=json-test-data;branch=master;protocol=https \ - file://0001-custom-allocators-define-missing-rebind-type-3895.patch \ - file://0001-tests-unit-iterators2-use-std-ranges-equals-for-rang.patch \ - file://run-ptest \ -" - -SRCREV = "bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d" -SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37" - -SRCREV_FORMAT .= "_json-test-data" - -S = "${WORKDIR}/git" - -inherit cmake ptest - -EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSON_BuildTests=ON -DJSON_TestDataDirectory=${PTEST_PATH}/json_test_data', '-DJSON_BuildTests=OFF', d)}" - -# nlohmann-json is a header only C++ library, so the main package will be empty. -ALLOW_EMPTY:${PN} = "1" -RDEPENDS:${PN}-dev = "" -RDEPENDS:${PN}-ptest = "perl" - -BBCLASSEXTEND = "native nativesdk" - - -do_install_ptest () { - install -d ${D}${PTEST_PATH}/tests - cp -r ${S}/json_test_data/ ${D}${PTEST_PATH}/ - cp -r ${B}/tests/test-* ${D}${PTEST_PATH}/tests - rm -rf ${D}${PTEST_PATH}/json_test_data/.git -} - - -# other packages commonly reference the file directly as "json.hpp" -# create symlink to allow this usage -do_install:append() { - ln -s nlohmann/json.hpp ${D}${includedir}/json.hpp -} diff --git a/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.3.bb b/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.3.bb new file mode 100644 index 0000000000..194e80546e --- /dev/null +++ b/meta-oe/recipes-devtools/nlohmann-json/nlohmann-json_3.11.3.bb @@ -0,0 +1,45 @@ +SUMMARY = "JSON for modern C++" +HOMEPAGE = "https://nlohmann.github.io/json/" +SECTION = "libs" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588" + +CVE_PRODUCT = "json-for-modern-cpp" + +SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \ + git://github.com/nlohmann/json_test_data.git;destsuffix=git/json_test_data;name=json-test-data;branch=master;protocol=https \ + file://run-ptest \ +" + +SRCREV = "9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03" +SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37" + +SRCREV_FORMAT .= "_json-test-data" + +S = "${WORKDIR}/git" + +inherit cmake ptest + +EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSON_BuildTests=ON -DJSON_TestDataDirectory=${PTEST_PATH}/json_test_data', '-DJSON_BuildTests=OFF', d)}" + +# nlohmann-json is a header only C++ library, so the main package will be empty. +ALLOW_EMPTY:${PN} = "1" +RDEPENDS:${PN}-dev = "" +RDEPENDS:${PN}-ptest = "perl" + +BBCLASSEXTEND = "native nativesdk" + + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/tests + cp -r ${S}/json_test_data/ ${D}${PTEST_PATH}/ + cp -r ${B}/tests/test-* ${D}${PTEST_PATH}/tests + rm -rf ${D}${PTEST_PATH}/json_test_data/.git +} + + +# other packages commonly reference the file directly as "json.hpp" +# create symlink to allow this usage +do_install:append() { + ln -s nlohmann/json.hpp ${D}${includedir}/json.hpp +} -- cgit v1.2.3-54-g00ecf