diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-05-18 16:12:56 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-05-18 16:12:56 +0100 |
commit | ae7f349673c9e013e85bbc65e873d3363467a293 (patch) | |
tree | 0ae90623ff8081894ad526c05a94ad9ca84f1ea4 /media-sound/mpd/files | |
parent | 8ea6e43d2f65acbfda614dbd4635823d7605b6d8 (diff) |
gentoo auto-resync : 18:05:2023 - 16:12:55
Diffstat (limited to 'media-sound/mpd/files')
-rw-r--r-- | media-sound/mpd/files/mpd-0.23.11-boost-1.81.patch | 30 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd-0.23.12-libfmt10-906074.patch | 102 | ||||
-rw-r--r-- | media-sound/mpd/files/mpd-0.23.12-stringview.patch | 235 |
3 files changed, 337 insertions, 30 deletions
diff --git a/media-sound/mpd/files/mpd-0.23.11-boost-1.81.patch b/media-sound/mpd/files/mpd-0.23.11-boost-1.81.patch deleted file mode 100644 index cb40b14926e2..000000000000 --- a/media-sound/mpd/files/mpd-0.23.11-boost-1.81.patch +++ /dev/null @@ -1,30 +0,0 @@ -https://bugs.gentoo.org/886521 -https://github.com/MusicPlayerDaemon/MPD/issues/1693 -https://github.com/MusicPlayerDaemon/MPD/commit/e4b055eb6d08c5c8f8d85828ce4005d410e462cb - -From e4b055eb6d08c5c8f8d85828ce4005d410e462cb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= - <congdanhqx@gmail.com> -Date: Thu, 1 Dec 2022 08:29:23 +0700 -Subject: [PATCH] v0.23.x: RemoteTagCache: add missing include - -Fix build with Boost 1.81.0. `<array>` was included by one of those boost headers, -however, it's no longer included as of Boost 1.81.0. - -`master` doesn't use `std::array` in this file. - -While we're at it, add all necessary inclusion files. ---- a/src/RemoteTagCache.hxx -+++ b/src/RemoteTagCache.hxx -@@ -28,7 +28,11 @@ - #include <boost/intrusive/list.hpp> - #include <boost/intrusive/unordered_set.hpp> - -+#include <array> -+#include <functional> -+#include <memory> - #include <string> -+#include <utility> - - class RemoteTagCacheHandler; - diff --git a/media-sound/mpd/files/mpd-0.23.12-libfmt10-906074.patch b/media-sound/mpd/files/mpd-0.23.12-libfmt10-906074.patch new file mode 100644 index 000000000000..7fc5187a54f3 --- /dev/null +++ b/media-sound/mpd/files/mpd-0.23.12-libfmt10-906074.patch @@ -0,0 +1,102 @@ +libfmt 10 changed the API, requiring a few adjustments to the codebase. +This backports the upstream fixes for building against libfmt 10. + +Bug: https://bugs.gentoo.org/906074 + +--- a/src/SongPrint.cxx ++++ b/src/SongPrint.cxx +@@ -24,6 +24,7 @@ + #include "TagPrint.hxx" + #include "client/Response.hxx" + #include "fs/Traits.hxx" ++#include "lib/fmt/AudioFormatFormatter.hxx" + #include "time/ChronoUtil.hxx" + #include "util/StringBuffer.hxx" + #include "util/UriUtil.hxx" +@@ -93,7 +94,7 @@ song_print_info(Response &r, const LightSong &song, bool base) noexcept + time_print(r, "Last-Modified", song.mtime); + + if (song.audio_format.IsDefined()) +- r.Fmt(FMT_STRING("Format: {}\n"), ToString(song.audio_format)); ++ r.Fmt(FMT_STRING("Format: {}\n"), song.audio_format); + + tag_print_values(r, song.tag); + +@@ -116,7 +117,7 @@ song_print_info(Response &r, const DetachedSong &song, bool base) noexcept + time_print(r, "Last-Modified", song.GetLastModified()); + + if (const auto &f = song.GetAudioFormat(); f.IsDefined()) +- r.Fmt(FMT_STRING("Format: {}\n"), ToString(f)); ++ r.Fmt(FMT_STRING("Format: {}\n"), f); + + tag_print_values(r, song.GetTag()); + +--- a/src/TagPrint.cxx ++++ b/src/TagPrint.cxx +@@ -21,7 +21,6 @@ + #include "tag/Tag.hxx" + #include "tag/Settings.hxx" + #include "client/Response.hxx" +-#include "util/StringView.hxx" + + #include <fmt/format.h> + +@@ -35,7 +34,7 @@ tag_print_types(Response &r) noexcept + } + + void +-tag_print(Response &r, TagType type, StringView value) noexcept ++tag_print(Response &r, TagType type, std::string_view value) noexcept + { + r.Fmt(FMT_STRING("{}: {}\n"), tag_item_names[type], value); + } +--- a/src/TagPrint.hxx ++++ b/src/TagPrint.hxx +@@ -21,6 +21,7 @@ + #define MPD_TAG_PRINT_HXX + + #include <cstdint> ++#include <string_view> + + enum TagType : uint8_t; + +@@ -32,7 +33,7 @@ void + tag_print_types(Response &response) noexcept; + + void +-tag_print(Response &response, TagType type, StringView value) noexcept; ++tag_print(Response &response, TagType type, std::string_view value) noexcept; + + void + tag_print(Response &response, TagType type, const char *value) noexcept; +--- a/src/TimePrint.cxx ++++ b/src/TimePrint.cxx +@@ -36,5 +36,5 @@ time_print(Response &r, const char *name, + return; + } + +- r.Fmt(FMT_STRING("{}: {}\n"), name, s); ++ r.Fmt(FMT_STRING("{}: {}\n"), name, s.c_str()); + } +--- a/src/command/PlayerCommands.cxx ++++ b/src/command/PlayerCommands.cxx +@@ -28,6 +28,7 @@ + #include "Partition.hxx" + #include "Instance.hxx" + #include "IdleFlags.hxx" ++#include "lib/fmt/AudioFormatFormatter.hxx" + #include "util/StringBuffer.hxx" + #include "util/ScopeExit.hxx" + #include "util/Exception.hxx" +@@ -185,7 +186,7 @@ handle_status(Client &client, [[maybe_unused]] Request args, Response &r) + + if (player_status.audio_format.IsDefined()) + r.Fmt(FMT_STRING(COMMAND_STATUS_AUDIO ": {}\n"), +- ToString(player_status.audio_format)); ++ player_status.audio_format); + } + + #ifdef ENABLE_DATABASE +-- +2.39.2 + diff --git a/media-sound/mpd/files/mpd-0.23.12-stringview.patch b/media-sound/mpd/files/mpd-0.23.12-stringview.patch new file mode 100644 index 000000000000..fa0f77f2a712 --- /dev/null +++ b/media-sound/mpd/files/mpd-0.23.12-stringview.patch @@ -0,0 +1,235 @@ +Backport of upstream commit ec66ee3bfb, which is a prerequisite to +backport the fix for dev-libs/libfmt-10. + +--- a/src/command/FileCommands.cxx ++++ b/src/command/FileCommands.cxx +@@ -106,7 +106,7 @@ handle_listfiles_local(Response &r, Path path_fs) + + gcc_pure + static bool +-IsValidName(const StringView s) noexcept ++IsValidName(const std::string_view s) noexcept + { + if (s.empty() || !IsAlphaASCII(s.front())) + return false; +@@ -118,7 +118,7 @@ IsValidName(const StringView s) noexcept + + gcc_pure + static bool +-IsValidValue(const StringView s) noexcept ++IsValidValue(const std::string_view s) noexcept + { + return std::none_of(s.begin(), s.end(), [](const auto &ch) { return (unsigned char)ch < 0x20; }); + } +@@ -130,7 +130,7 @@ public: + explicit PrintCommentHandler(Response &_response) noexcept + :NullTagHandler(WANT_PAIR), response(_response) {} + +- void OnPair(StringView key, StringView value) noexcept override { ++ void OnPair(std::string_view key, std::string_view value) noexcept override { + if (IsValidName(key) && IsValidValue(value)) + response.Fmt(FMT_STRING("{}: {}\n"), key, value); + } +--- a/src/command/OtherCommands.cxx ++++ b/src/command/OtherCommands.cxx +@@ -147,7 +147,7 @@ public: + explicit PrintTagHandler(Response &_response) noexcept + :NullTagHandler(WANT_TAG), response(_response) {} + +- void OnTag(TagType type, StringView value) noexcept override { ++ void OnTag(TagType type, std::string_view value) noexcept override { + if (response.GetClient().tag_mask.Test(type)) + tag_print(response, type, value); + } +--- a/src/decoder/plugins/AdPlugDecoderPlugin.cxx ++++ b/src/decoder/plugins/AdPlugDecoderPlugin.cxx +@@ -81,11 +81,11 @@ adplug_file_decode(DecoderClient &client, Path path_fs) + } + + static void +-adplug_scan_tag(TagType type, const std::string &value, ++adplug_scan_tag(TagType type, const std::string_view value, + TagHandler &handler) noexcept + { + if (!value.empty()) +- handler.OnTag(type, {value.data(), value.size()}); ++ handler.OnTag(type, value); + } + + static bool +--- a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx ++++ b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx +@@ -39,6 +39,8 @@ + + #include <string.h> + ++using std::string_view_literals::operator""sv; ++ + class EmbeddedCuePlaylist final : public SongEnumerator { + public: + /** +@@ -69,14 +71,15 @@ public: + + ExtractCuesheetTagHandler() noexcept:NullTagHandler(WANT_PAIR) {} + +- void OnPair(StringView key, StringView value) noexcept override; ++ void OnPair(std::string_view key, std::string_view value) noexcept override; + }; + + void +-ExtractCuesheetTagHandler::OnPair(StringView name, StringView value) noexcept ++ExtractCuesheetTagHandler::OnPair(std::string_view name, std::string_view value) noexcept + { +- if (cuesheet.empty() && name.EqualsIgnoreCase("cuesheet")) +- cuesheet = {value.data, value.size}; ++ if (cuesheet.empty() && ++ StringView{name}.EqualsIgnoreCase("cuesheet"sv)) ++ cuesheet = value; + } + + static std::unique_ptr<SongEnumerator> +--- a/src/tag/Handler.cxx ++++ b/src/tag/Handler.cxx +@@ -25,13 +25,15 @@ + + #include <algorithm> + ++using std::string_view_literals::operator""sv; ++ + void +-NullTagHandler::OnTag(TagType, StringView) noexcept ++NullTagHandler::OnTag(TagType, std::string_view) noexcept + { + } + + void +-NullTagHandler::OnPair(StringView, StringView) noexcept ++NullTagHandler::OnPair(std::string_view, std::string_view) noexcept + { + } + +@@ -54,18 +56,18 @@ AddTagHandler::OnDuration(SongTime duration) noexcept + /** + * Skip leading zeroes and a non-decimal suffix. + */ +-static StringView +-NormalizeDecimal(StringView s) ++static std::string_view ++NormalizeDecimal(std::string_view s) + { + auto start = std::find_if(s.begin(), s.end(), + [](char ch){ return ch != '0'; }); + auto end = std::find_if(start, s.end(), + [](char ch){ return !IsDigitASCII(ch); }); +- return {start, end}; ++ return StringView{start, end}; + } + + void +-AddTagHandler::OnTag(TagType type, StringView value) noexcept ++AddTagHandler::OnTag(TagType type, std::string_view value) noexcept + { + if (type == TAG_TRACK || type == TAG_DISC) { + /* filter out this extra data and leading zeroes */ +@@ -77,9 +79,9 @@ AddTagHandler::OnTag(TagType type, StringView value) noexcept + } + + void +-FullTagHandler::OnPair(StringView name, StringView) noexcept ++FullTagHandler::OnPair(std::string_view name, std::string_view) noexcept + { +- if (name.EqualsIgnoreCase("cuesheet")) ++ if (StringView{name}.EqualsIgnoreCase("cuesheet"sv)) + tag.SetHasPlaylist(true); + } + +--- a/src/tag/Handler.hxx ++++ b/src/tag/Handler.hxx +@@ -24,8 +24,11 @@ + #include "Chrono.hxx" + #include "util/Compiler.h" + ++#include <cstddef> ++#include <span> ++#include <string_view> ++ + template<typename T> struct ConstBuffer; +-struct StringView; + struct AudioFormat; + class TagBuilder; + +@@ -81,13 +84,14 @@ public: + * @param the value of the tag; the pointer will become + * invalid after returning + */ +- virtual void OnTag(TagType type, StringView value) noexcept = 0; ++ virtual void OnTag(TagType type, std::string_view value) noexcept = 0; + + /** + * A name-value pair has been read. It is the codec specific + * representation of tags. + */ +- virtual void OnPair(StringView key, StringView value) noexcept = 0; ++ virtual void OnPair(std::string_view key, ++ std::string_view value) noexcept = 0; + + /** + * Declare the audio format of a song. +@@ -125,8 +129,9 @@ public: + :TagHandler(_want_mask) {} + + void OnDuration([[maybe_unused]] SongTime duration) noexcept override {} +- void OnTag(TagType type, StringView value) noexcept override; +- void OnPair(StringView key, StringView value) noexcept override; ++ void OnTag(TagType type, std::string_view value) noexcept override; ++ void OnPair(std::string_view key, ++ std::string_view value) noexcept override; + void OnAudioFormat(AudioFormat af) noexcept override; + void OnPicture(const char *mime_type, + ConstBuffer<void> buffer) noexcept override; +@@ -149,7 +154,7 @@ public: + :AddTagHandler(0, _builder) {} + + void OnDuration(SongTime duration) noexcept override; +- void OnTag(TagType type, StringView value) noexcept override; ++ void OnTag(TagType type, std::string_view value) noexcept override; + }; + + /** +@@ -173,7 +178,8 @@ public: + AudioFormat *_audio_format=nullptr) noexcept + :FullTagHandler(0, _builder, _audio_format) {} + +- void OnPair(StringView key, StringView value) noexcept override; ++ void OnPair(std::string_view key, ++ std::string_view value) noexcept override; + void OnAudioFormat(AudioFormat af) noexcept override; + }; + +--- a/test/read_tags.cxx ++++ b/test/read_tags.cxx +@@ -60,16 +60,16 @@ public: + printf("duration=%f\n", duration.ToDoubleS()); + } + +- void OnTag(TagType type, StringView value) noexcept override { ++ void OnTag(TagType type, std::string_view value) noexcept override { + printf("[%s]=%.*s\n", tag_item_names[type], +- int(value.size), value.data); ++ int(value.size()), value.data()); + empty = false; + } + +- void OnPair(StringView key, StringView value) noexcept override { ++ void OnPair(std::string_view key, std::string_view value) noexcept override { + printf("\"%.*s\"=%.*s\n", +- int(key.size), key.data, +- int(value.size), value.data); ++ int(key.size()), key.data(), ++ int(value.size()), value.data()); + } + + void OnAudioFormat(AudioFormat af) noexcept override { +-- +2.39.2 + |