From e238bfa7986aead1b9266b8f3dad570f93fc8918 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 2 Aug 2024 12:45:27 -0700 Subject: [PATCH] rtpmidi: fix compilation with GCC14 and fmt10.2 Added two patches. Signed-off-by: Rosen Penev --- multimedia/rtpmidid/Makefile | 2 +- multimedia/rtpmidid/patches/010-gcc14.patch | 39 ++++ multimedia/rtpmidid/patches/020-fmt10.patch | 197 ++++++++++++++++++++ 3 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 multimedia/rtpmidid/patches/010-gcc14.patch create mode 100644 multimedia/rtpmidid/patches/020-fmt10.patch diff --git a/multimedia/rtpmidid/Makefile b/multimedia/rtpmidid/Makefile index c46373bc0..9885f767e 100644 --- a/multimedia/rtpmidid/Makefile +++ b/multimedia/rtpmidid/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtpmidid PKG_VERSION:=23.12 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/davidmoreno/rtpmidid diff --git a/multimedia/rtpmidid/patches/010-gcc14.patch b/multimedia/rtpmidid/patches/010-gcc14.patch new file mode 100644 index 000000000..10fa7fb15 --- /dev/null +++ b/multimedia/rtpmidid/patches/010-gcc14.patch @@ -0,0 +1,39 @@ +--- a/include/rtpmidid/signal.hpp ++++ b/include/rtpmidid/signal.hpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + // #define DEBUG0 DEBUG + #define DEBUG0(...) +@@ -171,4 +172,4 @@ public: + } + #undef DEBUG0 + }; +-} // namespace rtpmidid +\ No newline at end of file ++} // namespace rtpmidid +--- a/lib/mdns_rtpmidi.cpp ++++ b/lib/mdns_rtpmidi.cpp +@@ -28,6 +28,8 @@ + #include + #include + ++#include ++ + struct AvahiTimeout { + rtpmidid::poller_t::timer_t timer_id; + void *userdata; +--- a/lib/poller.cpp ++++ b/lib/poller.cpp +@@ -21,6 +21,8 @@ + #include + #include + ++#include ++ + #include + #include + #include diff --git a/multimedia/rtpmidid/patches/020-fmt10.patch b/multimedia/rtpmidid/patches/020-fmt10.patch new file mode 100644 index 000000000..36483a964 --- /dev/null +++ b/multimedia/rtpmidid/patches/020-fmt10.patch @@ -0,0 +1,197 @@ +--- a/include/rtpmidid/iobytes.hpp ++++ b/include/rtpmidid/iobytes.hpp +@@ -330,7 +330,7 @@ public: + + template <> + struct fmt::formatter : formatter { +- auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) { ++ auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) const { + return formatter::format( + fmt::format("[io_bytes_reader {} to {}, at {}, {}B left]", + (void *)data.start, (void *)data.end, (void *)data.position, +@@ -340,7 +340,7 @@ struct fmt::formatter + struct fmt::formatter : formatter { +- auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) { ++ auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) const { + return formatter::format( + fmt::format("[io_bytes_writer {} to {}, at {}, {}B left]", + (void *)data.start, (void *)data.end, (void *)data.position, +--- a/include/rtpmidid/network.hpp ++++ b/include/rtpmidid/network.hpp +@@ -24,7 +24,7 @@ + + template <> + struct fmt::formatter : formatter { +- auto format(const sockaddr_storage &addr, format_context &ctx) { ++ auto format(const sockaddr_storage &addr, format_context &ctx) const { + // print ip address and port + char name[INET6_ADDRSTRLEN]; + if (addr.ss_family == AF_INET) { +--- a/include/rtpmidid/rtpclient.hpp ++++ b/include/rtpmidid/rtpclient.hpp +@@ -99,7 +99,7 @@ template <> + struct fmt::formatter + : formatter { + auto format(const rtpmidid::rtpclient_t::endpoint_t &data, +- format_context &ctx) { ++ format_context &ctx) const { + return formatter::format( + fmt::format("[endpoint_t [{}]:{}]", data.hostname, data.port), ctx); + } +@@ -109,7 +109,7 @@ template <> + struct fmt::formatter> + : formatter { + auto format(const std::vector &data, +- format_context &ctx) { ++ format_context &ctx) const { + std::string result; + for (auto &endpoint : data) { + result += +@@ -123,7 +123,7 @@ template <> + struct fmt::formatter> + : formatter { + auto format(const std::list &data, +- format_context &ctx) { ++ format_context &ctx) const { + std::string result = "["; + for (auto &endpoint : data) { + result += fmt::format("[endpoint_t [{}]:{}] ", endpoint.hostname, +--- a/include/rtpmidid/rtppeer.hpp ++++ b/include/rtpmidid/rtppeer.hpp +@@ -152,7 +152,7 @@ public: + template <> + struct fmt::formatter + : formatter { +- auto format(rtpmidid::rtppeer_t::status_e c, format_context &ctx) { ++ auto format(rtpmidid::rtppeer_t::status_e c, format_context &ctx) const { + std::string_view name = "UNKNOWN"; + switch (c) { + case rtpmidid::rtppeer_t::status_e::NOT_CONNECTED: +@@ -175,7 +175,7 @@ struct fmt::formatter + struct fmt::formatter + : formatter { +- auto format(rtpmidid::rtppeer_t::port_e c, format_context &ctx) { ++ auto format(rtpmidid::rtppeer_t::port_e c, format_context &ctx) const { + const char *name = "UNKNOWN"; // NOLINT + switch (c) { + case rtpmidid::rtppeer_t::port_e::MIDI_PORT: +@@ -192,7 +192,7 @@ struct fmt::formatter + struct fmt::formatter + : formatter { +- auto format(rtpmidid::rtppeer_t::disconnect_reason_e c, format_context &ctx) { ++ auto format(rtpmidid::rtppeer_t::disconnect_reason_e c, format_context &ctx) const { + const char *name = "UNKNOWN"; // NOLINT + switch (c) { + case rtpmidid::rtppeer_t::disconnect_reason_e::CANT_CONNECT: +--- a/lib/mdns_rtpmidi.cpp ++++ b/lib/mdns_rtpmidi.cpp +@@ -52,12 +52,12 @@ struct AvahiEntryGroup { + rtpmidid::mdns_rtpmidi_t *current = nullptr; + + template <> struct fmt::formatter : fmt::formatter { +- auto format(AvahiWatchEvent ev, fmt::format_context &ctx) { ++ auto format(AvahiWatchEvent ev, fmt::format_context &ctx) const { + return fmt::formatter::format((int)ev, ctx); + } + }; + template <> struct fmt::formatter : fmt::formatter { +- auto format(AvahiBrowserEvent ev, fmt::format_context &ctx) { ++ auto format(AvahiBrowserEvent ev, fmt::format_context &ctx) const { + return fmt::formatter::format((int)ev, ctx); + } + }; +--- a/src/aseq.hpp ++++ b/src/aseq.hpp +@@ -152,7 +152,7 @@ template <> struct hash + struct fmt::formatter + : formatter { +- auto format(rtpmididns::aseq_t::port_t c, format_context &ctx) { ++ auto format(rtpmididns::aseq_t::port_t c, format_context &ctx) const { + auto name = fmt::format("port_t[{}, {}]", c.client, c.port); + return formatter::format(name, ctx); + } +--- a/src/mididata.hpp ++++ b/src/mididata.hpp +@@ -37,9 +37,9 @@ public: + + template <> + struct fmt::formatter : formatter { +- auto format(const rtpmididns::mididata_t &data, format_context &ctx) { ++ auto format(const rtpmididns::mididata_t &data, format_context &ctx) const { + + return fmt::format_to(ctx.out(), "[mididata_t {} + {}, at {}]", + (void *)data.start, data.size(), data.pos()); + } +-}; +\ No newline at end of file ++}; +--- a/src/settings.hpp ++++ b/src/settings.hpp +@@ -58,7 +58,7 @@ template <> + struct fmt::formatter + : formatter { + auto format(const rtpmididns::settings_t::alsa_announce_t &data, +- format_context &ctx) { ++ format_context &ctx) const { + + return fmt::format_to(ctx.out(), "[alsa_announce_t {}]", data.name); + } +@@ -68,7 +68,7 @@ template <> + struct fmt::formatter> + : formatter { + auto format(const std::vector &data, +- format_context &ctx) { ++ format_context &ctx) const { + std::string result = "["; + for (auto &item : data) { + result += fmt::format("[{}] ", item.name); +@@ -82,7 +82,7 @@ template <> + struct fmt::formatter + : formatter { + auto format(const rtpmididns::settings_t::rtpmidi_announce_t &data, +- format_context &ctx) { ++ format_context &ctx) const { + + return fmt::format_to(ctx.out(), "[rtpmidi_announce_t {} {}]", data.name, + data.port); +@@ -94,7 +94,7 @@ struct fmt::formatter { + auto + format(const std::vector &data, +- format_context &ctx) { ++ format_context &ctx) const { + std::string result = "["; + for (auto &item : data) { + result += +@@ -109,7 +109,7 @@ template <> + struct fmt::formatter + : formatter { + auto format(const rtpmididns::settings_t::connect_to_t &data, +- format_context &ctx) { ++ format_context &ctx) const { + + return fmt::format_to(ctx.out(), "[connect_to_t {} {} {}]", data.hostname, + data.port, data.name); +@@ -120,7 +120,7 @@ template <> + struct fmt::formatter> + : formatter { + auto format(const std::vector &data, +- format_context &ctx) { ++ format_context &ctx) const { + std::string result = "["; + for (auto &item : data) { + result += fmt::format("[connect_to_t {} {} {}] ", item.hostname, +@@ -133,7 +133,7 @@ struct fmt::formatter + struct fmt::formatter : formatter { +- auto format(const rtpmididns::settings_t &data, format_context &ctx) { ++ auto format(const rtpmididns::settings_t &data, format_context &ctx) const { + + return fmt::format_to(ctx.out(), + "[settings_t alsa_name: {} alsa_network: {} "