Skip to content

Commit

Permalink
gui-apps/waybar: fix build with libfmt-8
Browse files Browse the repository at this point in the history
Backport of the upstreamed fix.

(no real credit goes to me, only adjusted PR with maintainer's ack)

Closes: https://bugs.gentoo.org/797649
Closes: gentoo#21506
Signed-off-by: Jonas Toth <[email protected]>
Signed-off-by: Ionen Wolkens <[email protected]>
  • Loading branch information
ionenwks committed Jul 12, 2021
1 parent 6937b36 commit 209673f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
32 changes: 32 additions & 0 deletions gui-apps/waybar/files/waybar-0.9.7-libfmt-8.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
https://bugs.gentoo.org/797649
https://github.com/Alexays/Waybar/pull/1144

From: John Helmert III <[email protected]>
Date: Tue, 29 Jun 2021 21:29:12 -0500
Subject: [PATCH] libfmt >=8.0.0 compatibility
--- 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;
}
--- a/src/modules/clock.cpp
+++ b/src/modules/clock.cpp
@@ -196,6 +196,9 @@ template <>
struct fmt::formatter<waybar_time> : fmt::formatter<std::tm> {
template <typename FormatContext>
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));
}
};
4 changes: 4 additions & 0 deletions gui-apps/waybar/waybar-0.9.5-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ DEPEND="
"
RDEPEND="${DEPEND}"

PATCHES=(
"${FILESDIR}/${PN}-0.9.7-libfmt-8.patch"
)

src_configure() {
local emesonargs=(
$(meson_feature mpd)
Expand Down
4 changes: 4 additions & 0 deletions gui-apps/waybar/waybar-0.9.7-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ DEPEND="
"
RDEPEND="${DEPEND}"

PATCHES=(
"${FILESDIR}/${P}-libfmt-8.patch"
)

src_configure() {
local emesonargs=(
$(meson_feature mpd)
Expand Down

0 comments on commit 209673f

Please sign in to comment.