From 8d067867998938f521ebd1fe37629c2c38c8251b Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Jul 05 2021 15:24:55 +0000 Subject: Upstream patch to fix the build with new fmt --- diff --git a/waybar-0.9.7-libfmt-8.0.0-compatibility.patch b/waybar-0.9.7-libfmt-8.0.0-compatibility.patch new file mode 100644 index 0000000..f3836e2 --- /dev/null +++ b/waybar-0.9.7-libfmt-8.0.0-compatibility.patch @@ -0,0 +1,40 @@ +From 368e4813de5356332d1167e8200cb5633e772ed6 Mon Sep 17 00:00:00 2001 +From: John Helmert III +Date: Tue, 29 Jun 2021 21:29:12 -0500 +Subject: [PATCH] libfmt >=8.0.0 compatibility + +--- + include/util/format.hpp | 4 ++++ + src/modules/clock.cpp | 3 +++ + 2 files changed, 7 insertions(+) + +diff --git a/include/util/format.hpp b/include/util/format.hpp +index 288d8f0cd..543a100fb 100644 +--- a/include/util/format.hpp ++++ b/include/util/format.hpp +@@ -35,7 +35,11 @@ namespace fmt { + // The rationale for ignoring it is that the only reason to specify + // an alignment and a with is to get a fixed width bar, and ">" is + // sufficient in this implementation. ++#if FMT_VERSION < 80000 + width = parse_nonnegative_int(it, end, ctx); ++#else ++ width = detail::parse_nonnegative_int(it, end, -1); ++#endif + } + return it; + } +diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp +index 22bedc783..82c570102 100644 +--- a/src/modules/clock.cpp ++++ b/src/modules/clock.cpp +@@ -196,6 +196,9 @@ template <> + struct fmt::formatter : fmt::formatter { + template + auto format(const waybar_time& t, FormatContext& ctx) { ++#if FMT_VERSION >= 80000 ++ auto& tm_format = specs; ++#endif + return format_to(ctx.out(), "{}", date::format(t.locale, fmt::to_string(tm_format), t.ztime)); + } + }; diff --git a/waybar.spec b/waybar.spec index a107dd0..9c679f9 100644 --- a/waybar.spec +++ b/waybar.spec @@ -8,6 +8,7 @@ URL: https://github.com/Alexays/Waybar Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch0: %{url}/pull/1132.patch#/waybar-0.9.7-fix-noexcept-condvar-crash.patch +Patch1: %{url}/pull/1144.patch#/waybar-0.9.7-libfmt-8.0.0-compatibility.patch BuildRequires: gcc BuildRequires: gcc-c++