pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/textproc/nlohmann-json



Module Name:    pkgsrc
Committed By:   wiz
Date:           Sun Apr 27 20:07:25 UTC 2025

Modified Files:
        pkgsrc/textproc/nlohmann-json: Makefile distinfo
Added Files:
        pkgsrc/textproc/nlohmann-json/patches:
            patch-include_nlohmann_detail_conversions_from__json.hpp
            patch-include_nlohmann_detail_conversions_to__json.hpp
            patch-single__include_nlohmann_json.hpp
            patch-tests_src_unit-deserialization.cpp
            patch-tests_src_unit-regression2.cpp
            patch-tests_src_unit-user__defined__input.cpp

Log Message:
nlohmann-json: add post-release patches from upstream

Fixes build of openrct2.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/textproc/nlohmann-json/Makefile \
    pkgsrc/textproc/nlohmann-json/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_from__json.hpp \
    pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_to__json.hpp \
    pkgsrc/textproc/nlohmann-json/patches/patch-single__include_nlohmann_json.hpp \
    pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-deserialization.cpp \
    pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-regression2.cpp \
    pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-user__defined__input.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/textproc/nlohmann-json/Makefile
diff -u pkgsrc/textproc/nlohmann-json/Makefile:1.4 pkgsrc/textproc/nlohmann-json/Makefile:1.5
--- pkgsrc/textproc/nlohmann-json/Makefile:1.4  Sun Apr 20 19:26:10 2025
+++ pkgsrc/textproc/nlohmann-json/Makefile      Sun Apr 27 20:07:25 2025
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2025/04/20 19:26:10 wiz Exp $
+# $NetBSD: Makefile,v 1.5 2025/04/27 20:07:25 wiz Exp $
 
 DISTNAME=      nlohmann-json-3.12.0
+PKGREVISION=   1
 CATEGORIES=    textproc
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=nlohmann/}
 GITHUB_PROJECT=        json
@@ -13,6 +14,9 @@ LICENSE=      mit
 
 USE_LANGUAGES= c c++
 
+post-install:
+       ${RM} ${DESTDIR}${PREFIX}/include/nlohmann/detail/conversions/*.orig
+
 .include "options.mk"
 .include "../../devel/cmake/build.mk"
 .include "../../mk/bsd.pkg.mk"
Index: pkgsrc/textproc/nlohmann-json/distinfo
diff -u pkgsrc/textproc/nlohmann-json/distinfo:1.4 pkgsrc/textproc/nlohmann-json/distinfo:1.5
--- pkgsrc/textproc/nlohmann-json/distinfo:1.4  Sun Apr 20 19:26:10 2025
+++ pkgsrc/textproc/nlohmann-json/distinfo      Sun Apr 27 20:07:25 2025
@@ -1,5 +1,11 @@
-$NetBSD: distinfo,v 1.4 2025/04/20 19:26:10 wiz Exp $
+$NetBSD: distinfo,v 1.5 2025/04/27 20:07:25 wiz Exp $
 
 BLAKE2s (nlohmann-json-3.12.0.tar.gz) = 4a8f71416d89ed4e5442197e5705db4d3c1c5658e753400b2a65996623dbd0bc
 SHA512 (nlohmann-json-3.12.0.tar.gz) = 6cc1e86261f8fac21cc17a33da3b6b3c3cd5c116755651642af3c9e99bb3538fd42c1bd50397a77c8fb6821bc62d90e6b91bcdde77a78f58f2416c62fc53b97d
 Size (nlohmann-json-3.12.0.tar.gz) = 9678593 bytes
+SHA1 (patch-include_nlohmann_detail_conversions_from__json.hpp) = 3193edc36ab326a1de3bac7215dd530f2b867182
+SHA1 (patch-include_nlohmann_detail_conversions_to__json.hpp) = b5d141e11b3f92c29ca70cd087cf376df166bb92
+SHA1 (patch-single__include_nlohmann_json.hpp) = cf15a296dc9ddb85608ba1644721ec30143096e9
+SHA1 (patch-tests_src_unit-deserialization.cpp) = 2fbec98b3b13b5a135bea5659f7fff78b8b0bcb3
+SHA1 (patch-tests_src_unit-regression2.cpp) = 973156a2b09d3df8a2696272f532e1b66680ec37
+SHA1 (patch-tests_src_unit-user__defined__input.cpp) = be8fed57b7c87507064f9b2d4f2d568ad79cfb00

Added files:

Index: pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_from__json.hpp
diff -u /dev/null pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_from__json.hpp:1.1
--- /dev/null   Sun Apr 27 20:07:25 2025
+++ pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_from__json.hpp      Sun Apr 27 20:07:25 2025
@@ -0,0 +1,30 @@
+$NetBSD: patch-include_nlohmann_detail_conversions_from__json.hpp,v 1.1 2025/04/27 20:07:25 wiz Exp $
+
+https://github.com/nlohmann/json/pull/4736
+https://github.com/nlohmann/json/pull/4763
+
+--- include/nlohmann/detail/conversions/from_json.hpp.orig     2025-04-11 08:42:28.000000000 +0000
++++ include/nlohmann/detail/conversions/from_json.hpp
+@@ -32,6 +32,10 @@
+ #include <nlohmann/detail/string_concat.hpp>
+ #include <nlohmann/detail/value_t.hpp>
+ 
++#if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM
++    #include <string_view> // u8string_view
++#endif
++
+ NLOHMANN_JSON_NAMESPACE_BEGIN
+ namespace detail
+ {
+@@ -540,7 +544,10 @@ inline void from_json(const BasicJsonTyp
+         JSON_THROW(type_error::create(302, concat("type must be string, but is ", j.type_name()), &j));
+     }
+     const auto& s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
+-#ifdef JSON_HAS_CPP_20
++    // Checking for C++20 standard or later can be insufficient in case the
++    // library support for char8_t is either incomplete or was disabled
++    // altogether. Use the __cpp_lib_char8_t feature test instead.
++#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201907L)
+     p = std_fs::path(std::u8string_view(reinterpret_cast<const char8_t*>(s.data()), s.size()));
+ #else
+     p = std_fs::u8path(s); // accepts UTF-8 encoded std::string in C++17, deprecated in C++20
Index: pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_to__json.hpp
diff -u /dev/null pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_to__json.hpp:1.1
--- /dev/null   Sun Apr 27 20:07:25 2025
+++ pkgsrc/textproc/nlohmann-json/patches/patch-include_nlohmann_detail_conversions_to__json.hpp        Sun Apr 27 20:07:25 2025
@@ -0,0 +1,44 @@
+$NetBSD: patch-include_nlohmann_detail_conversions_to__json.hpp,v 1.1 2025/04/27 20:07:25 wiz Exp $
+
+https://github.com/nlohmann/json/pull/4736
+
+--- include/nlohmann/detail/conversions/to_json.hpp.orig       2025-04-11 08:42:28.000000000 +0000
++++ include/nlohmann/detail/conversions/to_json.hpp
+@@ -15,7 +15,8 @@
+ 
+ #include <algorithm> // copy
+ #include <iterator> // begin, end
+-#include <string> // string
++#include <memory> // allocator_traits
++#include <string> //  basic_string, char_traits
+ #include <tuple> // tuple, get
+ #include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
+ #include <utility> // move, forward, declval, pair
+@@ -440,15 +441,21 @@ inline void to_json(BasicJsonType& j, co
+ }
+ 
+ #if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM
++#if defined(__cpp_lib_char8_t)
++template<typename BasicJsonType, typename Tr, typename Allocator>
++inline void to_json(BasicJsonType& j, const std::basic_string<char8_t, Tr, Allocator>& s)
++{
++    using OtherAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<char>;
++    j = std::basic_string<char, std::char_traits<char>, OtherAllocator>(s.begin(), s.end(), s.get_allocator());
++}
++#endif
++
+ template<typename BasicJsonType>
+ inline void to_json(BasicJsonType& j, const std_fs::path& p)
+ {
+-#ifdef JSON_HAS_CPP_20
+-    const std::u8string s = p.u8string();
+-    j = std::string(s.begin(), s.end());
+-#else
+-    j = p.u8string(); // returns std::string in C++17
+-#endif
++    // Returns either a std::string or a std::u8string depending whether library
++    // support for char8_t is enabled.
++    j = p.u8string();
+ }
+ #endif
+ 
Index: pkgsrc/textproc/nlohmann-json/patches/patch-single__include_nlohmann_json.hpp
diff -u /dev/null pkgsrc/textproc/nlohmann-json/patches/patch-single__include_nlohmann_json.hpp:1.1
--- /dev/null   Sun Apr 27 20:07:25 2025
+++ pkgsrc/textproc/nlohmann-json/patches/patch-single__include_nlohmann_json.hpp       Sun Apr 27 20:07:25 2025
@@ -0,0 +1,68 @@
+$NetBSD: patch-single__include_nlohmann_json.hpp,v 1.1 2025/04/27 20:07:25 wiz Exp $
+
+https://github.com/nlohmann/json/pull/4736
+https://github.com/nlohmann/json/pull/4763
+
+--- single_include/nlohmann/json.hpp.orig      2025-04-11 08:42:28.000000000 +0000
++++ single_include/nlohmann/json.hpp
+@@ -4497,6 +4497,10 @@ NLOHMANN_JSON_NAMESPACE_END
+     #pragma clang diagnostic ignored "-Wweak-vtables"
+ #endif
+ 
++#if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM
++    #include <string_view> // u8string_view
++#endif
++
+ NLOHMANN_JSON_NAMESPACE_BEGIN
+ namespace detail
+ {
+@@ -5325,7 +5329,10 @@ inline void from_json(const BasicJsonTyp
+         JSON_THROW(type_error::create(302, concat("type must be string, but is ", j.type_name()), &j));
+     }
+     const auto& s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
+-#ifdef JSON_HAS_CPP_20
++    // Checking for C++20 standard or later can be insufficient in case the
++    // library support for char8_t is either incomplete or was disabled
++    // altogether. Use the __cpp_lib_char8_t feature test instead.
++#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201907L)
+     p = std_fs::path(std::u8string_view(reinterpret_cast<const char8_t*>(s.data()), s.size()));
+ #else
+     p = std_fs::u8path(s); // accepts UTF-8 encoded std::string in C++17, deprecated in C++20
+@@ -5380,7 +5387,8 @@ NLOHMANN_JSON_NAMESPACE_END
+ 
+ #include <algorithm> // copy
+ #include <iterator> // begin, end
+-#include <string> // string
++#include <memory> // allocator_traits
++#include <string> //  basic_string, char_traits
+ #include <tuple> // tuple, get
+ #include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type
+ #include <utility> // move, forward, declval, pair
+@@ -6087,15 +6095,21 @@ inline void to_json(BasicJsonType& j, co
+ }
+ 
+ #if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM
++#if defined(__cpp_lib_char8_t)
++template<typename BasicJsonType, typename Tr, typename Allocator>
++inline void to_json(BasicJsonType& j, const std::basic_string<char8_t, Tr, Allocator>& s)
++{
++    using OtherAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<char>;
++    j = std::basic_string<char, std::char_traits<char>, OtherAllocator>(s.begin(), s.end(), s.get_allocator());
++}
++#endif
++
+ template<typename BasicJsonType>
+ inline void to_json(BasicJsonType& j, const std_fs::path& p)
+ {
+-#ifdef JSON_HAS_CPP_20
+-    const std::u8string s = p.u8string();
+-    j = std::string(s.begin(), s.end());
+-#else
+-    j = p.u8string(); // returns std::string in C++17
+-#endif
++    // Returns either a std::string or a std::u8string depending whether library
++    // support for char8_t is enabled.
++    j = p.u8string();
+ }
+ #endif
+ 
Index: pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-deserialization.cpp
diff -u /dev/null pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-deserialization.cpp:1.1
--- /dev/null   Sun Apr 27 20:07:25 2025
+++ pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-deserialization.cpp      Sun Apr 27 20:07:25 2025
@@ -0,0 +1,19 @@
+$NetBSD: patch-tests_src_unit-deserialization.cpp,v 1.1 2025/04/27 20:07:25 wiz Exp $
+
+https://github.com/nlohmann/json/pull/4736
+
+--- tests/src/unit-deserialization.cpp.orig    2025-04-11 08:42:28.000000000 +0000
++++ tests/src/unit-deserialization.cpp
+@@ -1134,9 +1134,10 @@ TEST_CASE("deserialization")
+     }
+ }
+ 
+-// select the types to test - char8_t is only available in C++20
++// select the types to test - char8_t is only available since C++20 if and only
++// if __cpp_char8_t is defined.
+ #define TYPE_LIST(...) __VA_ARGS__
+-#ifdef JSON_HAS_CPP_20
++#if defined(__cpp_char8_t) && (__cpp_char8_t >= 201811L)
+     #define ASCII_TYPES TYPE_LIST(char, wchar_t, char16_t, char32_t, char8_t)
+ #else
+     #define ASCII_TYPES TYPE_LIST(char, wchar_t, char16_t, char32_t)
Index: pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-regression2.cpp
diff -u /dev/null pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-regression2.cpp:1.1
--- /dev/null   Sun Apr 27 20:07:25 2025
+++ pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-regression2.cpp  Sun Apr 27 20:07:25 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-tests_src_unit-regression2.cpp,v 1.1 2025/04/27 20:07:25 wiz Exp $
+
+https://github.com/nlohmann/json/pull/4763
+
+--- tests/src/unit-regression2.cpp.orig        2025-04-11 08:42:28.000000000 +0000
++++ tests/src/unit-regression2.cpp
+@@ -388,7 +388,7 @@ struct Example_3810
+     Example_3810() = default;
+ };
+ 
+-NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Example_3810, bla); // NOLINT(misc-use-internal-linkage)
++NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Example_3810, bla) // NOLINT(misc-use-internal-linkage)
+ 
+ TEST_CASE("regression tests 2")
+ {
Index: pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-user__defined__input.cpp
diff -u /dev/null pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-user__defined__input.cpp:1.1
--- /dev/null   Sun Apr 27 20:07:25 2025
+++ pkgsrc/textproc/nlohmann-json/patches/patch-tests_src_unit-user__defined__input.cpp Sun Apr 27 20:07:25 2025
@@ -0,0 +1,21 @@
+$NetBSD: patch-tests_src_unit-user__defined__input.cpp,v 1.1 2025/04/27 20:07:25 wiz Exp $
+
+https://github.com/nlohmann/json/pull/4763
+
+--- tests/src/unit-user_defined_input.cpp.orig 2025-04-11 08:42:28.000000000 +0000
++++ tests/src/unit-user_defined_input.cpp
+@@ -60,12 +60,12 @@ TEST_CASE("Custom container member begin
+     {
+         const char* data;
+ 
+-        const char* begin() const
++        const char* begin() const noexcept
+         {
+             return data;
+         }
+ 
+-        const char* end() const
++        const char* end() const noexcept
+         {
+             return data + strlen(data); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
+         }



Home | Main Index | Thread Index | Old Index