summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini2023-06-20 21:59:53 +0200
committer Matteo Bernardini2024-04-27 10:38:40 +0200
commit6ebbfab1de4ab1ebe46caa2ef4139a89d9fd93cc (patch)
tree6c33e87e02d9ab5b366579e30914388c9e0ec6f8
parent68ac93024440c1dcb61e579018ce241a1ab44180 (diff)
downloadslackbuilds-nlohmann_json.tar.gz
libraries/nlohmann_json: Patch for gcc >= 13.x.nlohmann_json
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--libraries/nlohmann_json/nlohmann_json.SlackBuild2
-rw-r--r--libraries/nlohmann_json/patches/1_6cec5aefc97ad219b6fd5a4132f88f7c8f6800ee.patch55
-rw-r--r--libraries/nlohmann_json/patches/2_660d0b58565073975d6f5d94365d6cbf150a4cf8.patch24
3 files changed, 81 insertions, 0 deletions
diff --git a/libraries/nlohmann_json/nlohmann_json.SlackBuild b/libraries/nlohmann_json/nlohmann_json.SlackBuild
index dfcb6419d6..69eb38c5ed 100644
--- a/libraries/nlohmann_json/nlohmann_json.SlackBuild
+++ b/libraries/nlohmann_json/nlohmann_json.SlackBuild
@@ -76,6 +76,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+for i in $CWD/patches/* ; do patch -p1 < $i ; done
+
mkdir -p build
cd build
cmake \
diff --git a/libraries/nlohmann_json/patches/1_6cec5aefc97ad219b6fd5a4132f88f7c8f6800ee.patch b/libraries/nlohmann_json/patches/1_6cec5aefc97ad219b6fd5a4132f88f7c8f6800ee.patch
new file mode 100644
index 0000000000..6f133312ee
--- /dev/null
+++ b/libraries/nlohmann_json/patches/1_6cec5aefc97ad219b6fd5a4132f88f7c8f6800ee.patch
@@ -0,0 +1,55 @@
+From 6cec5aefc97ad219b6fd5a4132f88f7c8f6800ee Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Wed, 8 Mar 2023 11:31:56 +0000
+Subject: [PATCH] custom allocators: define missing 'rebind' type (#3895)
+
+---
+ 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 76e3b03f10..f2e63552a4 100644
+--- a/tests/src/unit-allocator.cpp
++++ b/tests/src/unit-allocator.cpp
+@@ -20,11 +20,20 @@ struct bad_allocator : std::allocator<T>
+ {
+ using std::allocator<T>::allocator;
+
++ bad_allocator() = default;
++ template<class U> bad_allocator(const bad_allocator<U>& /*unused*/) { }
++
+ template<class... Args>
+ void construct(T* /*unused*/, Args&& ... /*unused*/)
+ {
+ throw std::bad_alloc();
+ }
++
++ template <class U>
++ struct rebind
++ {
++ using other = bad_allocator<U>;
++ };
+ };
+ } // namespace
+
+diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp
+index 2bb9b32e51..dbafb436ba 100644
+--- a/tests/src/unit-regression2.cpp
++++ b/tests/src/unit-regression2.cpp
+@@ -189,6 +189,15 @@ class my_allocator : public std::allocator<T>
+ {
+ public:
+ using std::allocator<T>::allocator;
++
++ my_allocator() = default;
++ template<class U> my_allocator(const my_allocator<U>& /*unused*/) { }
++
++ template <class U>
++ struct rebind
++ {
++ using other = my_allocator<U>;
++ };
+ };
+
+ /////////////////////////////////////////////////////////////////////
diff --git a/libraries/nlohmann_json/patches/2_660d0b58565073975d6f5d94365d6cbf150a4cf8.patch b/libraries/nlohmann_json/patches/2_660d0b58565073975d6f5d94365d6cbf150a4cf8.patch
new file mode 100644
index 0000000000..d14345f40e
--- /dev/null
+++ b/libraries/nlohmann_json/patches/2_660d0b58565073975d6f5d94365d6cbf150a4cf8.patch
@@ -0,0 +1,24 @@
+From 660d0b58565073975d6f5d94365d6cbf150a4cf8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
+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
+---
+ 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 27926084c7..72a5d9dc5c 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")