diff options
author | James Le Cuirot <chewi@gentoo.org> | 2024-12-28 23:25:41 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2024-12-28 23:26:23 +0000 |
commit | 991083a7f1fe4e842c1a1fb026ce51d82868c385 (patch) | |
tree | dd46c51b09dd7fbcb74bb1041216aadcd0b7ff77 | |
parent | media-tv/kodi: bump ffmpeg in live (diff) | |
download | gentoo-991083a7f1fe4e842c1a1fb026ce51d82868c385.tar.gz gentoo-991083a7f1fe4e842c1a1fb026ce51d82868c385.tar.bz2 gentoo-991083a7f1fe4e842c1a1fb026ce51d82868c385.zip |
net-misc/sunshine: Fix building against Boost 1.87
I think this will also work with 1.86 and 1.85. Let me know if it doesn't.
Closes: https://bugs.gentoo.org/946480
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
-rw-r--r-- | net-misc/sunshine/files/sunshine-boost-1.87.patch | 100 | ||||
-rw-r--r-- | net-misc/sunshine/sunshine-0.23.1.ebuild | 1 |
2 files changed, 101 insertions, 0 deletions
diff --git a/net-misc/sunshine/files/sunshine-boost-1.87.patch b/net-misc/sunshine/files/sunshine-boost-1.87.patch new file mode 100644 index 000000000000..ba871fcab26b --- /dev/null +++ b/net-misc/sunshine/files/sunshine-boost-1.87.patch @@ -0,0 +1,100 @@ +diff --git a/src/rtsp.cpp b/src/rtsp.cpp +index 0180fbee..da20d134 100644 +--- a/src/rtsp.cpp ++++ b/src/rtsp.cpp +@@ -90,8 +90,8 @@ namespace rtsp_stream { + + class socket_t: public std::enable_shared_from_this<socket_t> { + public: +- socket_t(boost::asio::io_service &ios, std::function<void(tcp::socket &sock, launch_session_t &, msg_t &&)> &&handle_data_fn): +- handle_data_fn { std::move(handle_data_fn) }, sock { ios } {} ++ socket_t(boost::asio::io_context &io_context, std::function<void(tcp::socket &sock, launch_session_t &, msg_t &&)> &&handle_data_fn): ++ handle_data_fn { std::move(handle_data_fn) }, sock { io_context } {} + + /** + * @brief Queues an asynchronous read to begin the next message. +@@ -440,7 +440,7 @@ namespace rtsp_stream { + return -1; + } + +- next_socket = std::make_shared<socket_t>(ios, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) { ++ next_socket = std::make_shared<socket_t>(io_context, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) { + handle_msg(sock, session, std::move(msg)); + }); + +@@ -454,7 +454,7 @@ namespace rtsp_stream { + template <class T, class X> + void + iterate(std::chrono::duration<T, X> timeout) { +- ios.run_one_for(timeout); ++ io_context.run_one_for(timeout); + } + + void +@@ -499,7 +499,7 @@ namespace rtsp_stream { + } + + // Queue another asynchronous accept for the next incoming connection +- next_socket = std::make_shared<socket_t>(ios, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) { ++ next_socket = std::make_shared<socket_t>(io_context, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) { + handle_msg(sock, session, std::move(msg)); + }); + acceptor.async_accept(next_socket->sock, [this](const auto &ec) { +@@ -591,8 +591,8 @@ namespace rtsp_stream { + } + } + +- if (all && !ios.stopped()) { +- ios.stop(); ++ if (all && !io_context.stopped()) { ++ io_context.stop(); + } + } + +@@ -627,8 +627,8 @@ namespace rtsp_stream { + std::chrono::steady_clock::time_point raised_timeout; + int _slot_count; + +- boost::asio::io_service ios; +- tcp::acceptor acceptor { ios }; ++ boost::asio::io_context io_context; ++ tcp::acceptor acceptor { io_context }; + + std::shared_ptr<socket_t> next_socket; + }; +diff --git a/src/stream.cpp b/src/stream.cpp +index df5b3d96..0b304e23 100644 +--- a/src/stream.cpp ++++ b/src/stream.cpp +@@ -340,10 +340,10 @@ namespace stream { + std::thread audio_thread; + std::thread control_thread; + +- asio::io_service io; ++ asio::io_context io_context; + +- udp::socket video_sock { io }; +- udp::socket audio_sock { io }; ++ udp::socket video_sock { io_context }; ++ udp::socket audio_sock { io_context }; + + control_server_t control_server; + }; +@@ -1159,7 +1159,7 @@ namespace stream { + auto &message_queue_queue = ctx.message_queue_queue; + auto broadcast_shutdown_event = mail::man->event<bool>(mail::broadcast_shutdown); + +- auto &io = ctx.io; ++ auto &io = ctx.io_context; + + udp::endpoint peer; + +@@ -1664,7 +1664,7 @@ namespace stream { + audio_packets->stop(); + + ctx.message_queue_queue->stop(); +- ctx.io.stop(); ++ ctx.io_context.stop(); + + ctx.video_sock.close(); + ctx.audio_sock.close(); diff --git a/net-misc/sunshine/sunshine-0.23.1.ebuild b/net-misc/sunshine/sunshine-0.23.1.ebuild index 81552c090837..b3a422edf43c 100644 --- a/net-misc/sunshine/sunshine-0.23.1.ebuild +++ b/net-misc/sunshine/sunshine-0.23.1.ebuild @@ -181,6 +181,7 @@ PATCHES=( "${FILESDIR}"/${PN}-find-npm.patch "${FILESDIR}"/${PN}-miniupnpc.patch "${FILESDIR}"/${PN}-boost-1.86.patch + "${FILESDIR}"/${PN}-boost-1.87.patch ) # Make this mess a bit simpler. |