Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
prusaslicer: fix build with boost 1.87
To:
ports@openbsd.org
Cc:
renato@renatoaguiar.net
Date:
Sat, 19 Apr 2025 14:27:17 +0200

Download raw body.

Thread
  • Theo Buehler:

    prusaslicer: fix build with boost 1.87

This pulls in the patch set from gentoo plus two extra patches on top
due to param.h being pulled in, which has OpenBSD as a define and
hilarity ensues.

Still builds with boost 1.84. I'm going to commit this quite soon.

Index: Makefile
===================================================================
RCS file: /cvs/ports/cad/prusaslicer/Makefile,v
diff -u -p -r1.19 Makefile
--- Makefile	13 Mar 2025 10:29:08 -0000	1.19
+++ Makefile	19 Apr 2025 12:24:57 -0000
@@ -4,6 +4,7 @@ DPB_PROPERTIES = parallel
 
 V =		2.9.1
 PKGNAME =	prusaslicer-${V}
+REVISION =	0
 
 GH_ACCOUNT =	prusa3d
 GH_PROJECT =	PrusaSlicer
Index: patches/patch-src_libslic3r_GCodeSender_cpp
===================================================================
RCS file: patches/patch-src_libslic3r_GCodeSender_cpp
diff -N patches/patch-src_libslic3r_GCodeSender_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_libslic3r_GCodeSender_cpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/946495
+https://github.com/prusa3d/PrusaSlicer/issues/13799
+
+Index: src/libslic3r/GCodeSender.cpp
+--- src/libslic3r/GCodeSender.cpp.orig
++++ src/libslic3r/GCodeSender.cpp
+@@ -113,7 +113,7 @@ GCodeSender::connect(std::string devname, unsigned int
+     this->io.post(boost::bind(&GCodeSender::do_read, this));
+     
+     // start reading in the background thread
+-    boost::thread t(boost::bind(&boost::asio::io_service::run, &this->io));
++    boost::thread t(boost::bind(&boost::asio::io_context::run, &this->io));
+     this->background_thread.swap(t);
+     
+     // always send a M105 to check for connection because firmware might be silent on connect
Index: patches/patch-src_libslic3r_GCodeSender_hpp
===================================================================
RCS file: patches/patch-src_libslic3r_GCodeSender_hpp
diff -N patches/patch-src_libslic3r_GCodeSender_hpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_libslic3r_GCodeSender_hpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/946495
+https://github.com/prusa3d/PrusaSlicer/issues/13799
+
+Index: src/libslic3r/GCodeSender.hpp
+--- src/libslic3r/GCodeSender.hpp.orig
++++ src/libslic3r/GCodeSender.hpp
+@@ -40,7 +40,7 @@ class GCodeSender : private boost::noncopyable {
+     void reset();
+     
+     private:
+-    asio::io_service io;
++    asio::io_context io;
+     asio::serial_port serial;
+     boost::thread background_thread;
+     boost::asio::streambuf read_buffer, write_buffer;
Index: patches/patch-src_libslic3r_Platform_cpp
===================================================================
RCS file: patches/patch-src_libslic3r_Platform_cpp
diff -N patches/patch-src_libslic3r_Platform_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_libslic3r_Platform_cpp	18 Apr 2025 20:57:54 -0000
@@ -0,0 +1,16 @@
+Undo param.h pollution to fix build with boost >= 1.87
+
+Index: src/libslic3r/Platform.cpp
+--- src/libslic3r/Platform.cpp.orig
++++ src/libslic3r/Platform.cpp
+@@ -13,6 +13,10 @@
+ #include <mach/machine.h>
+ #endif
+ 
++#if defined(OpenBSD)
++#undef OpenBSD
++#endif
++
+ namespace Slic3r {
+ 
+ static auto s_platform 		  = Platform::Uninitialized;
Index: patches/patch-src_libslic3r_Platform_hpp
===================================================================
RCS file: patches/patch-src_libslic3r_Platform_hpp
diff -N patches/patch-src_libslic3r_Platform_hpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_libslic3r_Platform_hpp	18 Apr 2025 20:57:57 -0000
@@ -0,0 +1,16 @@
+Undo param.h pollution to fix build with boost >= 1.87
+
+Index: src/libslic3r/Platform.hpp
+--- src/libslic3r/Platform.hpp.orig
++++ src/libslic3r/Platform.hpp
+@@ -7,6 +7,10 @@
+ 
+ #include <string>
+ 
++#if defined(OpenBSD)
++#undef OpenBSD
++#endif
++
+ namespace Slic3r {
+ 
+ enum class Platform
Index: patches/patch-src_slic3r_GUI_FirmwareDialog_cpp
===================================================================
RCS file: patches/patch-src_slic3r_GUI_FirmwareDialog_cpp
diff -N patches/patch-src_slic3r_GUI_FirmwareDialog_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_slic3r_GUI_FirmwareDialog_cpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,9 @@
++++ src/slic3r/GUI/FirmwareDialog.cpp
+@@ -429,7 +429,7 @@ void FirmwareDialog::priv::avr109_wait_for_bootloader(
+ void FirmwareDialog::priv::avr109_reboot(const SerialPortInfo &port)
+ {
+-	asio::io_service io;
++	asio::io_context io;
+ 	Serial serial(io, port.port, 1200);
+ 	std::this_thread::sleep_for(std::chrono::milliseconds(50));
+ }
Index: patches/patch-src_slic3r_Utils_Bonjour_cpp
===================================================================
RCS file: patches/patch-src_slic3r_Utils_Bonjour_cpp
diff -N patches/patch-src_slic3r_Utils_Bonjour_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_slic3r_Utils_Bonjour_cpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,181 @@
+https://bugs.gentoo.org/946495
+https://github.com/prusa3d/PrusaSlicer/issues/13799
+
+Index: src/slic3r/Utils/Bonjour.cpp
+--- src/slic3r/Utils/Bonjour.cpp.orig
++++ src/slic3r/Utils/Bonjour.cpp
+@@ -624,11 +624,11 @@ UdpSession::UdpSession(Bonjour::ReplyFn rfn) : replyfn
+ 	buffer.resize(DnsMessage::MAX_SIZE);
+ }
+ 
+-UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, const asio::ip::address& interface_address, std::shared_ptr< boost::asio::io_service > io_service)
++UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, const asio::ip::address& interface_address, std::shared_ptr< boost::asio::io_context > io_context)
+ 	: replyfn(replyfn)
+ 	, multicast_address(multicast_address)
+-	, socket(*io_service)
+-	, io_service(io_service)
++	, socket(*io_context)
++	, io_context(io_context)
+ {
+ 	try {
+ 		// open socket
+@@ -658,11 +658,11 @@ UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const 
+ }
+ 
+ 
+-UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, std::shared_ptr< boost::asio::io_service > io_service)
++UdpSocket::UdpSocket( Bonjour::ReplyFn replyfn, const asio::ip::address& multicast_address, std::shared_ptr< boost::asio::io_context > io_context)
+ 	: replyfn(replyfn)
+ 	, multicast_address(multicast_address)
+-	, socket(*io_service)
+-	, io_service(io_service)
++	, socket(*io_context)
++	, io_context(io_context)
+ {
+ 	try {
+ 		// open socket
+@@ -714,7 +714,7 @@ void UdpSocket::receive_handler(SharedSession session,
+ 	// let io_service to handle the datagram on session
+ 	// from boost documentation io_service::post:
+ 	// The io_service guarantees that the handler will only be called in a thread in which the run(), run_one(), poll() or poll_one() member functions is currently being invoked.
+-	io_service->post(boost::bind(&UdpSession::handle_receive, session, error, bytes));
++	boost::asio::post(*io_context, boost::bind(&UdpSession::handle_receive, session, error, bytes));
+ 	// immediately accept new datagrams
+ 	async_receive();
+ }
+@@ -871,13 +871,13 @@ void Bonjour::priv::lookup_perform()
+ {
+ 	service_dn = (boost::format("_%1%._%2%.local") % service % protocol).str();
+ 
+-	std::shared_ptr< boost::asio::io_service > io_service(new boost::asio::io_service);
++	std::shared_ptr< boost::asio::io_context > io_context(new boost::asio::io_context);
+ 
+ 	std::vector<LookupSocket*> sockets;
+ 
+ 	// resolve intefaces - from PR#6646
+ 	std::vector<boost::asio::ip::address> interfaces;
+-	asio::ip::udp::resolver resolver(*io_service);
++	asio::ip::udp::resolver resolver(*io_context);
+ 	boost::system::error_code ec;
+ 	// ipv4 interfaces
+ 	auto results = resolver.resolve(udp::v4(), asio::ip::host_name(), "", ec);
+@@ -890,12 +890,12 @@ void Bonjour::priv::lookup_perform()
+ 		// create ipv4 socket for each interface
+ 		// each will send to querry to for both ipv4 and ipv6
+ 		for (const auto& intrfc : interfaces) 		
+-			sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP4, intrfc, io_service));
++			sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP4, intrfc, io_context));
+ 	} else {
+ 		BOOST_LOG_TRIVIAL(info) << "Failed to resolve ipv4 interfaces: " << ec.message();
+ 	}
+ 	if (sockets.empty())
+-		sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP4, io_service));
++		sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP4, io_context));
+ 	// ipv6 interfaces
+ 	interfaces.clear();
+ 	//udp::resolver::query query(host, PORT, boost::asio::ip::resolver_query_base::numeric_service);
+@@ -910,9 +910,9 @@ void Bonjour::priv::lookup_perform()
+ 		// create ipv6 socket for each interface
+ 		// each will send to querry to for both ipv4 and ipv6
+ 		for (const auto& intrfc : interfaces)
+-			sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP6, intrfc, io_service));
++			sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP6, intrfc, io_context));
+ 		if (interfaces.empty())
+-			sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP6, io_service));
++			sockets.emplace_back(new LookupSocket(txt_keys, service, service_dn, protocol, replyfn, BonjourRequest::MCAST_IP6, io_context));
+ 	} else {
+ 		BOOST_LOG_TRIVIAL(info)<< "Failed to resolve ipv6 interfaces: " << ec.message();
+ 	}
+@@ -923,13 +923,13 @@ void Bonjour::priv::lookup_perform()
+ 			socket->send();
+ 
+ 		// timer settings
+-		asio::deadline_timer timer(*io_service);
++		asio::deadline_timer timer(*io_context);
+ 		retries--;
+ 		std::function<void(const error_code&)> timer_handler = [&](const error_code& error) {
+ 			// end 
+ 			if (retries == 0 || error) {
+ 				// is this correct ending?
+-				io_service->stop();
++				io_context->stop();
+ 				if (completefn) {
+ 					completefn();
+ 				}
+@@ -947,7 +947,7 @@ void Bonjour::priv::lookup_perform()
+ 		timer.expires_from_now(boost::posix_time::seconds(timeout));
+ 		timer.async_wait(timer_handler);
+ 		// start io_service, it will run until it has something to do - so in this case until stop is called in timer
+-		io_service->run();
++		io_context->run();
+ 	}
+ 	catch (std::exception& e) {
+ 		BOOST_LOG_TRIVIAL(error) << e.what();
+@@ -966,12 +966,12 @@ void Bonjour::priv::resolve_perform()
+ 			rpls.push_back(reply);
+ 	};
+ 
+-	std::shared_ptr< boost::asio::io_service > io_service(new boost::asio::io_service);
++	std::shared_ptr< boost::asio::io_context > io_context(new boost::asio::io_context);
+ 	std::vector<ResolveSocket*> sockets;
+ 
+ 	// resolve interfaces - from PR#6646
+ 	std::vector<boost::asio::ip::address> interfaces;
+-	asio::ip::udp::resolver resolver(*io_service);
++	asio::ip::udp::resolver resolver(*io_context);
+ 	boost::system::error_code ec;
+ 	// ipv4 interfaces
+ 	auto results = resolver.resolve(udp::v4(), asio::ip::host_name(), "", ec);
+@@ -984,12 +984,12 @@ void Bonjour::priv::resolve_perform()
+ 		// create ipv4 socket for each interface
+ 		// each will send to querry to for both ipv4 and ipv6
+ 		for (const auto& intrfc : interfaces)
+-			sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP4, intrfc, io_service));
++			sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP4, intrfc, io_context));
+ 	} else {
+ 		BOOST_LOG_TRIVIAL(info) << "Failed to resolve ipv4 interfaces: " << ec.message();
+ 	}
+ 	if (sockets.empty())
+-		sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP4, io_service));
++		sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP4, io_context));
+ 
+ 	// ipv6 interfaces
+ 	interfaces.clear();
+@@ -1003,9 +1003,9 @@ void Bonjour::priv::resolve_perform()
+ 		// create ipv6 socket for each interface
+ 		// each will send to querry to for both ipv4 and ipv6
+ 		for (const auto& intrfc : interfaces) 
+-			sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP6, intrfc, io_service));
++			sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP6, intrfc, io_context));
+ 		if (interfaces.empty())
+-			sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP6, io_service));
++			sockets.emplace_back(new ResolveSocket(hostname, reply_callback, BonjourRequest::MCAST_IP6, io_context));
+ 	} else {
+ 		BOOST_LOG_TRIVIAL(info) << "Failed to resolve ipv6 interfaces: " << ec.message();
+ 	}
+@@ -1016,14 +1016,14 @@ void Bonjour::priv::resolve_perform()
+ 			socket->send();
+ 
+ 		// timer settings
+-		asio::deadline_timer timer(*io_service);
++		asio::deadline_timer timer(*io_context);
+ 		retries--;
+ 		std::function<void(const error_code&)> timer_handler = [&](const error_code& error) {
+ 			int replies_count = replies.size();
+ 			// end 
+ 			if (retries == 0 || error || replies_count > 0) {
+ 				// is this correct ending?
+-				io_service->stop();
++				io_context->stop();
+ 				if (replies_count > 0 && resolvefn) {
+ 					resolvefn(replies);
+ 				}
+@@ -1041,7 +1041,7 @@ void Bonjour::priv::resolve_perform()
+ 		timer.expires_from_now(boost::posix_time::seconds(timeout));
+ 		timer.async_wait(timer_handler);
+ 		// start io_service, it will run until it has something to do - so in this case until stop is called in timer
+-		io_service->run();
++		io_context->run();
+ 	}
+ 	catch (std::exception& e) {
+ 		BOOST_LOG_TRIVIAL(error) << e.what();
Index: patches/patch-src_slic3r_Utils_Bonjour_hpp
===================================================================
RCS file: patches/patch-src_slic3r_Utils_Bonjour_hpp
diff -N patches/patch-src_slic3r_Utils_Bonjour_hpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_slic3r_Utils_Bonjour_hpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,73 @@
+https://bugs.gentoo.org/946495
+https://github.com/prusa3d/PrusaSlicer/issues/13799
+
+Index: src/slic3r/Utils/Bonjour.hpp
+--- src/slic3r/Utils/Bonjour.hpp.orig
++++ src/slic3r/Utils/Bonjour.hpp
+@@ -155,11 +155,11 @@ class UdpSocket (public)
+ 	UdpSocket(Bonjour::ReplyFn replyfn
+ 		, const boost::asio::ip::address& multicast_address
+ 		, const boost::asio::ip::address& interface_address
+-		, std::shared_ptr< boost::asio::io_service > io_service);
++		, std::shared_ptr< boost::asio::io_context > io_context);
+ 
+ 	UdpSocket(Bonjour::ReplyFn replyfn
+ 		, const boost::asio::ip::address& multicast_address
+-		, std::shared_ptr< boost::asio::io_service > io_service);
++		, std::shared_ptr< boost::asio::io_context > io_context);
+ 
+ 	void send();
+ 	void async_receive();
+@@ -172,7 +172,7 @@ class UdpSocket (public)
+ 	boost::asio::ip::address					    multicast_address;
+ 	boost::asio::ip::udp::socket					socket;
+ 	boost::asio::ip::udp::endpoint					mcast_endpoint;
+-	std::shared_ptr< boost::asio::io_service >	io_service;
++	std::shared_ptr< boost::asio::io_context >	io_context;
+ 	std::vector<BonjourRequest>						requests;
+ };
+ 
+@@ -186,8 +186,8 @@ class LookupSocket : public UdpSocket (public)
+ 		, Bonjour::ReplyFn replyfn
+ 		, const boost::asio::ip::address& multicast_address
+ 		, const boost::asio::ip::address& interface_address
+-		, std::shared_ptr< boost::asio::io_service > io_service)
+-		: UdpSocket(replyfn, multicast_address, interface_address, io_service)
++		, std::shared_ptr< boost::asio::io_context > io_context)
++		: UdpSocket(replyfn, multicast_address, interface_address, io_context)
+ 		, txt_keys(txt_keys)
+ 		, service(service)
+ 		, service_dn(service_dn)
+@@ -203,8 +203,8 @@ class LookupSocket : public UdpSocket (public)
+ 		, std::string protocol
+ 		, Bonjour::ReplyFn replyfn
+ 		, const boost::asio::ip::address& multicast_address
+-		, std::shared_ptr< boost::asio::io_service > io_service)
+-		: UdpSocket(replyfn, multicast_address, io_service)
++		, std::shared_ptr< boost::asio::io_context > io_context)
++		: UdpSocket(replyfn, multicast_address, io_context)
+ 		, txt_keys(txt_keys)
+ 		, service(service)
+ 		, service_dn(service_dn)
+@@ -241,8 +241,8 @@ class ResolveSocket : public UdpSocket (public)
+ 		, Bonjour::ReplyFn replyfn
+ 		, const boost::asio::ip::address& multicast_address
+ 		, const boost::asio::ip::address& interface_address
+-		, std::shared_ptr< boost::asio::io_service > io_service)
+-		: UdpSocket(replyfn, multicast_address, interface_address, io_service)
++		, std::shared_ptr< boost::asio::io_context > io_context)
++		: UdpSocket(replyfn, multicast_address, interface_address, io_context)
+ 		, hostname(hostname)
+ 
+ 	{
+@@ -253,8 +253,8 @@ class ResolveSocket : public UdpSocket (public)
+ 	ResolveSocket(const std::string& hostname
+ 		, Bonjour::ReplyFn replyfn
+ 		, const boost::asio::ip::address& multicast_address
+-		, std::shared_ptr< boost::asio::io_service > io_service)
+-		: UdpSocket(replyfn, multicast_address, io_service)
++		, std::shared_ptr< boost::asio::io_context > io_context)
++		: UdpSocket(replyfn, multicast_address, io_context)
+ 		, hostname(hostname)
+ 
+ 	{
Index: patches/patch-src_slic3r_Utils_Serial_cpp
===================================================================
RCS file: patches/patch-src_slic3r_Utils_Serial_cpp
diff -N patches/patch-src_slic3r_Utils_Serial_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_slic3r_Utils_Serial_cpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,55 @@
+https://bugs.gentoo.org/946495
+https://github.com/prusa3d/PrusaSlicer/issues/13799
+
+Index: src/slic3r/Utils/Serial.cpp
+--- src/slic3r/Utils/Serial.cpp.orig
++++ src/slic3r/Utils/Serial.cpp
+@@ -282,12 +282,12 @@ std::vector<std::string> scan_serial_ports()
+ namespace asio = boost::asio;
+ using boost::system::error_code;
+ 
+-Serial::Serial(asio::io_service& io_service) :
+-	asio::serial_port(io_service)
++Serial::Serial(asio::io_context &io_context) :
++	asio::serial_port(io_context)
+ {}
+ 
+-Serial::Serial(asio::io_service& io_service, const std::string &name, unsigned baud_rate) :
+-	asio::serial_port(io_service, name)
++Serial::Serial(asio::io_context &io_context, const std::string &name, unsigned baud_rate) :
++	asio::serial_port(io_context, name)
+ {
+ 	set_baud_rate(baud_rate);
+ }
+@@ -390,19 +390,19 @@ void Serial::reset_line_num()
+ 
+ bool Serial::read_line(unsigned timeout, std::string &line, error_code &ec)
+ {
+-	auto& io_service =
++	auto& io_context =
+ #if BOOST_VERSION >= 107000
+ 		//FIXME this is most certainly wrong!
+ 		(boost::asio::io_context&)this->get_executor().context();
+  #else
+ 		this->get_io_service();
+ #endif
+-	asio::deadline_timer timer(io_service);
++	asio::deadline_timer timer(io_context);
+ 	char c = 0;
+ 	bool fail = false;
+ 
+ 	while (true) {
+-		io_service.reset();
++		io_context.reset();
+ 
+ 		asio::async_read(*this, boost::asio::buffer(&c, 1), [&](const error_code &read_ec, size_t size) {
+ 			if (ec || size == 0) {
+@@ -423,7 +423,7 @@ bool Serial::read_line(unsigned timeout, std::string &
+ 			});
+ 		}
+ 
+-		io_service.run();
++		io_context.run();
+ 
+ 		if (fail) {
+ 			return false;
Index: patches/patch-src_slic3r_Utils_Serial_hpp
===================================================================
RCS file: patches/patch-src_slic3r_Utils_Serial_hpp
diff -N patches/patch-src_slic3r_Utils_Serial_hpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_slic3r_Utils_Serial_hpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/946495
+https://github.com/prusa3d/PrusaSlicer/issues/13799
+
+Index: src/slic3r/Utils/Serial.hpp
+--- src/slic3r/Utils/Serial.hpp.orig
++++ src/slic3r/Utils/Serial.hpp
+@@ -43,8 +43,8 @@ extern std::vector<SerialPortInfo> 	scan_serial_ports_
+ class Serial : public boost::asio::serial_port
+ {
+ public:
+-	Serial(boost::asio::io_service &io_service);
+-	Serial(boost::asio::io_service &io_service, const std::string &name, unsigned baud_rate);
++	Serial(boost::asio::io_context &io_context);
++	Serial(boost::asio::io_context &io_context, const std::string &name, unsigned baud_rate);
+ 	Serial(const Serial &) = delete;
+ 	Serial &operator=(const Serial &) = delete;
+ 	~Serial();
Index: patches/patch-src_slic3r_Utils_TCPConsole_cpp
===================================================================
RCS file: patches/patch-src_slic3r_Utils_TCPConsole_cpp
diff -N patches/patch-src_slic3r_Utils_TCPConsole_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_slic3r_Utils_TCPConsole_cpp	19 Apr 2025 02:40:53 -0000
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/946495
+https://github.com/prusa3d/PrusaSlicer/issues/13799
+
+Index: src/slic3r/Utils/TCPConsole.cpp
+--- src/slic3r/Utils/TCPConsole.cpp.orig
++++ src/slic3r/Utils/TCPConsole.cpp
+@@ -9,6 +9,7 @@
+ #include <boost/asio/read_until.hpp>
+ #include <boost/asio/steady_timer.hpp>
+ #include <boost/asio/write.hpp>
++#include <boost/asio/connect.hpp>
+ #include <boost/bind/bind.hpp>
+ #include <boost/format.hpp>
+ #include <boost/log/trivial.hpp>
+@@ -161,7 +162,7 @@ bool TCPConsole::run_queue()
+ 
+         auto endpoints = m_resolver.resolve(m_host_name, m_port_name);
+ 
+-        m_socket.async_connect(endpoints->endpoint(),
++        boost::asio::async_connect(m_socket, endpoints,
+             boost::bind(&TCPConsole::handle_connect, this, boost::placeholders::_1)
+         );
+