commit b9bf5b97845c1ddcc90fdea302749b04457ab945
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sat Jul 20 22:22:29 2024 +0100
fix
fmt11.patch | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mpd.spec | 2 ++
2 files changed, 81 insertions(+)
---
diff --git a/fmt11.patch b/fmt11.patch
new file mode 100644
index 0000000..d4dd971
--- /dev/null
+++ b/fmt11.patch
@@ -0,0 +1,79 @@
+From 1402869715e3efca87942d79c3173a6b21a6925d Mon Sep 17 00:00:00 2001
+From: Rudi Heitbaum <rudi(a)heitbaum.com>
+Date: Fri, 5 Jul 2024 14:27:45 +0000
+Subject: [PATCH] lib/fmt: support build with libfmt-11.0.0
+
+Upstream libfmt commit fmtlib/fmt@d707292
+now requires the format function to be const.
+
+Adjust the function prototype so it is const and can compile.
+
+Signed-off-by: Rudi Heitbaum <rudi(a)heitbaum.com>
+---
+ src/lib/ffmpeg/LibFmt.hxx | 2 +-
+ src/lib/fmt/AudioFormatFormatter.hxx | 4 ++--
+ src/lib/fmt/ExceptionFormatter.hxx | 2 +-
+ src/lib/fmt/PathFormatter.hxx | 2 +-
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/lib/ffmpeg/LibFmt.hxx b/src/lib/ffmpeg/LibFmt.hxx
+index aa068711f3..dee83ed2d5 100644
+--- a/src/lib/ffmpeg/LibFmt.hxx
++++ b/src/lib/ffmpeg/LibFmt.hxx
+@@ -13,7 +13,7 @@ template<>
+ struct fmt::formatter<AVSampleFormat> : formatter<string_view>
+ {
+ template<typename FormatContext>
+- auto format(const AVSampleFormat format, FormatContext &ctx) {
++ auto format(const AVSampleFormat format, FormatContext &ctx) const {
+ const char *name = av_get_sample_fmt_name(format);
+ if (name == nullptr)
+ name = "?";
+diff --git a/src/lib/fmt/AudioFormatFormatter.hxx b/src/lib/fmt/AudioFormatFormatter.hxx
+index e0ffb62160..8da98efd41 100644
+--- a/src/lib/fmt/AudioFormatFormatter.hxx
++++ b/src/lib/fmt/AudioFormatFormatter.hxx
+@@ -13,7 +13,7 @@ template<>
+ struct fmt::formatter<SampleFormat> : formatter<string_view>
+ {
+ template<typename FormatContext>
+- auto format(const SampleFormat format, FormatContext &ctx) {
++ auto format(const SampleFormat format, FormatContext &ctx) const {
+ return formatter<string_view>::format(sample_format_to_string(format),
+ ctx);
+ }
+@@ -23,7 +23,7 @@ template<>
+ struct fmt::formatter<AudioFormat> : formatter<string_view>
+ {
+ template<typename FormatContext>
+- auto format(const AudioFormat &af, FormatContext &ctx) {
++ auto format(const AudioFormat &af, FormatContext &ctx) const {
+ return formatter<string_view>::format(ToString(af).c_str(),
+ ctx);
+ }
+diff --git a/src/lib/fmt/ExceptionFormatter.hxx b/src/lib/fmt/ExceptionFormatter.hxx
+index 3f342df672..f08b3bb228 100644
+--- a/src/lib/fmt/ExceptionFormatter.hxx
++++ b/src/lib/fmt/ExceptionFormatter.hxx
+@@ -12,7 +12,7 @@ template<>
+ struct fmt::formatter<std::exception_ptr> : formatter<string_view>
+ {
+ template<typename FormatContext>
+- auto format(std::exception_ptr e, FormatContext &ctx) {
++ auto format(std::exception_ptr e, FormatContext &ctx) const {
+ return formatter<string_view>::format(GetFullMessage(e), ctx);
+ }
+ };
+diff --git a/src/lib/fmt/PathFormatter.hxx b/src/lib/fmt/PathFormatter.hxx
+index e5ae89dec5..add06df81b 100644
+--- a/src/lib/fmt/PathFormatter.hxx
++++ b/src/lib/fmt/PathFormatter.hxx
+@@ -13,7 +13,7 @@ template<std::convertible_to<Path> T>
+ struct fmt::formatter<Path> : formatter<string_view>
+ {
+ template<typename FormatContext>
+- auto format(Path path, FormatContext &ctx) {
++ auto format(Path path, FormatContext &ctx) const {
+ return formatter<string_view>::format(path.ToUTF8(), ctx);
+ }
+ };
diff --git a/mpd.spec b/mpd.spec
index 41f4782..94c84c0 100644
--- a/mpd.spec
+++ b/mpd.spec
@@ -36,6 +36,8 @@ Source6: mpd.sysusers
Patch0: mpd-0.23-mpdconf.patch
Patch1: mpd-0.20-remove_NoNewPrivileges.patch
Patch2: timidity_path.patch
+#
https://github.com/MusicPlayerDaemon/MPD/commit/1402869715e3efca87942d79c...
+Patch3: fmt11.patch
BuildRequires: alsa-lib-devel
BuildRequires: audiofile-devel