public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 2/2] mpd: Patch mpd to deal with format function being const in fmt-11.0.0 onwards
Date: Tue, 16 Jul 2024 13:00:05 +0200	[thread overview]
Message-ID: <20240716110005.1224776-2-adolf.belka@ipfire.org> (raw)
In-Reply-To: <20240716110005.1224776-1-adolf.belka@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 4630 bytes --]

- Commit has been made in mpd but no release has yet been made with the change. When the
   next version release of mpd occurs this patch can be removed.
- The patch changes all format calls to be const . Without this patch mpd will not build
   with fmt-11.0.0 or newer.
- Update of rootfile not required.

Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
---
 lfs/mpd                                       |  3 +-
 ...format_function_const_for_fmt-11.0.0.patch | 57 +++++++++++++++++++
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 src/patches/mpd-0.23.15_make_format_function_const_for_fmt-11.0.0.patch

diff --git a/lfs/mpd b/lfs/mpd
index 55408aeb3..0f842f993 100644
--- a/lfs/mpd
+++ b/lfs/mpd
@@ -34,7 +34,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/${THISAPP}
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = mpd
-PAK_VER    = 38
+PAK_VER    = 39
 # SUP_ARCH   = aarch64 x86_64
 
 DEPS       = alsa avahi faad2 ffmpeg flac lame libmad libshout libogg libid3tag libvorbis opus soxr fmt
@@ -82,6 +82,7 @@ $(subst %,%_BLAKE2,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@$(PREBUILD)
 	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/mpd-0.23.15_make_format_function_const_for_fmt-11.0.0.patch
 	$(UPDATE_AUTOMAKE)
 	cd $(DIR_APP) && meson setup \
 				--prefix=/usr \
diff --git a/src/patches/mpd-0.23.15_make_format_function_const_for_fmt-11.0.0.patch b/src/patches/mpd-0.23.15_make_format_function_const_for_fmt-11.0.0.patch
new file mode 100644
index 000000000..beea45484
--- /dev/null
+++ b/src/patches/mpd-0.23.15_make_format_function_const_for_fmt-11.0.0.patch
@@ -0,0 +1,57 @@
+diff -Naur mpd-0.23.15.orig/src/lib/ffmpeg/LibFmt.hxx mpd-0.23.15/src/lib/ffmpeg/LibFmt.hxx
+--- mpd-0.23.15.orig/src/lib/ffmpeg/LibFmt.hxx	2023-12-20 16:21:57.000000000 +0100
++++ mpd-0.23.15/src/lib/ffmpeg/LibFmt.hxx	2024-07-15 23:04:27.093307051 +0200
+@@ -29,7 +29,7 @@
+ 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 -Naur mpd-0.23.15.orig/src/lib/fmt/AudioFormatFormatter.hxx mpd-0.23.15/src/lib/fmt/AudioFormatFormatter.hxx
+--- mpd-0.23.15.orig/src/lib/fmt/AudioFormatFormatter.hxx	2023-12-20 16:21:57.000000000 +0100
++++ mpd-0.23.15/src/lib/fmt/AudioFormatFormatter.hxx	2024-07-15 23:05:48.519267115 +0200
+@@ -39,7 +39,7 @@
+ 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);
+ 	}
+@@ -49,7 +49,7 @@
+ 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 -Naur mpd-0.23.15.orig/src/lib/fmt/ExceptionFormatter.hxx mpd-0.23.15/src/lib/fmt/ExceptionFormatter.hxx
+--- mpd-0.23.15.orig/src/lib/fmt/ExceptionFormatter.hxx	2023-12-20 16:21:57.000000000 +0100
++++ mpd-0.23.15/src/lib/fmt/ExceptionFormatter.hxx	2024-07-15 23:06:21.330325382 +0200
+@@ -38,7 +38,7 @@
+ 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 -Naur mpd-0.23.15.orig/src/lib/fmt/PathFormatter.hxx mpd-0.23.15/src/lib/fmt/PathFormatter.hxx
+--- mpd-0.23.15.orig/src/lib/fmt/PathFormatter.hxx	2023-12-20 16:21:57.000000000 +0100
++++ mpd-0.23.15/src/lib/fmt/PathFormatter.hxx	2024-07-15 23:07:13.908687683 +0200
+@@ -29,7 +29,7 @@
+ 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);
+ 	}
+ };
-- 
2.45.2


      reply	other threads:[~2024-07-16 11:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 11:00 [PATCH 1/2] fmt: Update to version 11.0.1 Adolf Belka
2024-07-16 11:00 ` Adolf Belka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240716110005.1224776-2-adolf.belka@ipfire.org \
    --to=adolf.belka@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox