From 37c2f607e8f812f9b9f3d6de034352c666859b022e19aee297231b0d47a3fc60 Mon Sep 17 00:00:00 2001 From: Luigi Baldoni Date: Wed, 8 Jul 2020 16:40:04 +0000 Subject: [PATCH] Accepting request 819520 from home:alois:branches:devel:libraries:c_c++ - Add spdlog-1.6.1-fmt7_build.patch and spdlog-1.6.1-fmt7_tests.patch to fix build with fmt 7.x OBS-URL: https://build.opensuse.org/request/show/819520 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/spdlog?expand=0&rev=33 --- spdlog-1.6.1-fmt7_build.patch | 31 +++++++++++++++++++++++++++++++ spdlog-1.6.1-fmt7_tests.patch | 22 ++++++++++++++++++++++ spdlog.changes | 6 ++++++ spdlog.spec | 4 ++++ 4 files changed, 63 insertions(+) create mode 100644 spdlog-1.6.1-fmt7_build.patch create mode 100644 spdlog-1.6.1-fmt7_tests.patch diff --git a/spdlog-1.6.1-fmt7_build.patch b/spdlog-1.6.1-fmt7_build.patch new file mode 100644 index 0000000..4e80f24 --- /dev/null +++ b/spdlog-1.6.1-fmt7_build.patch @@ -0,0 +1,31 @@ +From 22bee8128a4150ce37cf761ed9a609ad891848a6 Mon Sep 17 00:00:00 2001 +From: Craig Andrews +Date: Mon, 6 Jul 2020 13:01:52 -0400 +Subject: [PATCH] fmt 7.0.0 renamed the internal namespace to detail. + +See: https://github.com/fmtlib/fmt/issues/1538 +--- + include/spdlog/details/fmt_helper.h | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/include/spdlog/details/fmt_helper.h b/include/spdlog/details/fmt_helper.h +index cbc0bdf3..4f363858 100644 +--- a/include/spdlog/details/fmt_helper.h ++++ b/include/spdlog/details/fmt_helper.h +@@ -34,7 +34,15 @@ template + inline unsigned int count_digits(T n) + { + using count_type = typename std::conditional<(sizeof(T) > sizeof(uint32_t)), uint64_t, uint32_t>::type; +- return static_cast(fmt::internal::count_digits(static_cast(n))); ++ return static_cast(fmt:: ++// fmt 7.0.0 renamed the internal namespace to detail. ++// See: https://github.com/fmtlib/fmt/issues/1538 ++#if FMT_VERSION < 70000 ++internal ++#else ++detail ++#endif ++::count_digits(static_cast(n))); + } + + inline void pad2(int n, memory_buf_t &dest) diff --git a/spdlog-1.6.1-fmt7_tests.patch b/spdlog-1.6.1-fmt7_tests.patch new file mode 100644 index 0000000..602641a --- /dev/null +++ b/spdlog-1.6.1-fmt7_tests.patch @@ -0,0 +1,22 @@ +From 19f280466195f347f3f2c474556a6be0b343a7fb Mon Sep 17 00:00:00 2001 +From: Gabi Melman +Date: Wed, 8 Jul 2020 18:50:51 +0300 +Subject: [PATCH] Fix #1611 + +--- + include/spdlog/fmt/bin_to_hex.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/spdlog/fmt/bin_to_hex.h b/include/spdlog/fmt/bin_to_hex.h +index e974cf51..5393dcac 100644 +--- a/include/spdlog/fmt/bin_to_hex.h ++++ b/include/spdlog/fmt/bin_to_hex.h +@@ -92,7 +92,7 @@ struct formatter> + auto parse(ParseContext &ctx) -> decltype(ctx.begin()) + { + auto it = ctx.begin(); +- while (*it && *it != '}') ++ while (it != ctx.end() && *it != '}') + { + switch (*it) + { diff --git a/spdlog.changes b/spdlog.changes index d63a867..42b8174 100644 --- a/spdlog.changes +++ b/spdlog.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 8 11:05:02 UTC 2020 - aloisio@gmx.com + +- Add spdlog-1.6.1-fmt7_build.patch and + spdlog-1.6.1-fmt7_tests.patch to fix build with fmt 7.x + ------------------------------------------------------------------- Wed May 27 07:38:11 UTC 2020 - Luigi Baldoni diff --git a/spdlog.spec b/spdlog.spec index 1c33995..4dbfa51 100644 --- a/spdlog.spec +++ b/spdlog.spec @@ -24,6 +24,10 @@ Summary: C++ logging library License: MIT URL: https://github.com/gabime/spdlog Source0: https://github.com/gabime/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM spdlog-1.6.1-fmt7_build.patch +Patch0: spdlog-1.6.1-fmt7_build.patch +# PATCH-FIX-UPSTREAM spdlog-1.6.1-fmt7_tests.patch +Patch1: spdlog-1.6.1-fmt7_tests.patch BuildRequires: benchmark-devel >= 1.4.0 BuildRequires: cmake BuildRequires: gcc