git: e090c46bafec - main - devel/msp430-debug-stack: Fix build with latest Boost

From: Lev A. Serebryakov <lev_at_FreeBSD.org>
Date: Wed, 02 Apr 2025 18:19:59 UTC
The branch main has been updated by lev:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e090c46bafecd7ad5478c08935ce93bd4c8bac1a

commit e090c46bafecd7ad5478c08935ce93bd4c8bac1a
Author:     Lev A. Serebryakov <lev@FreeBSD.org>
AuthorDate: 2025-04-02 18:18:30 +0000
Commit:     Lev A. Serebryakov <lev@FreeBSD.org>
CommitDate: 2025-04-02 18:18:30 +0000

    devel/msp430-debug-stack: Fix build with latest Boost
    
     Adopt sources to new boost::asio API.
    
    PR:             284822
    Reported by:    ice@extreme.hu
---
 devel/msp430-debug-stack/Makefile                  |  4 +-
 ...ch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp | 55 +++++++++++++++++++++-
 ...atch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.h | 20 ++++++++
 ...erfaces_MSPBSL__PhysicalInterfaceSerialUART.cpp | 11 +++++
 ...nterfaces_MSPBSL__PhysicalInterfaceSerialUART.h | 10 ++++
 5 files changed, 96 insertions(+), 4 deletions(-)

diff --git a/devel/msp430-debug-stack/Makefile b/devel/msp430-debug-stack/Makefile
index 51c02b9dd83d..77b05bcbcc86 100644
--- a/devel/msp430-debug-stack/Makefile
+++ b/devel/msp430-debug-stack/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	msp430-debug-stack
 PORTVERSION=	3.15.1.1
-PORTREVISION=	10
+PORTREVISION=	11
 CATEGORIES=	devel
 MASTER_SITES=	https://dr-download.ti.com/software-development/driver-or-library/MD-4vnqcP1Wk4/${PORTVERSION}/ \
 		LOCAL/lev:doc1 \
@@ -16,8 +16,6 @@ WWW=		http://www.ti.com/tool/mspds
 
 LICENSE=	BSD3CLAUSE
 
-BROKEN=		fails to build with Boost>=1.87
-
 LIB_DEPENDS=	libboost_filesystem.so:devel/boost-libs \
 		libhidapi.so:comms/hidapi
 
diff --git a/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp b/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp
index e65c70898d70..3bb02c53d7a1 100644
--- a/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp
+++ b/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.cpp
@@ -1,5 +1,23 @@
---- DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp.orig	2020-02-14 09:38:32 UTC
+--- DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp.orig	2025-02-14 17:38:09 UTC
 +++ DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.cpp
+@@ -42,7 +42,7 @@
+ 
+ #include <boost/asio/read.hpp>
+ #include <boost/asio/write.hpp>
+-#include <boost/asio/io_service.hpp>
++#include <boost/asio/io_context.hpp>
+ 
+ #if defined(_WIN32) || defined(_WIN64)
+ 
+@@ -181,7 +181,7 @@ void UsbCdcIoChannel::createCdcPortList(const uint16_t
+ 
+ 	for (;;)
+ 	{
+-		io_service_t device = IOIteratorNext(iterator);
++		io_context_t device = IOIteratorNext(iterator);
+ 		if (device == 0)
+ 		{
+ 			if (!IOIteratorIsValid(iterator))
 @@ -310,6 +310,22 @@ void UsbCdcIoChannel::createCdcPortList(const uint16_t
  	}
  #else
@@ -31,3 +49,38 @@
  					const string filename = it->path().filename().string();
  					const string portPath = string("/dev/") + filename;
  
+@@ -376,7 +393,7 @@ bool UsbCdcIoChannel::openPort()
+ 
+ bool UsbCdcIoChannel::openPort()
+ {
+-	ioService = new boost::asio::io_service;
++	ioService = new boost::asio::io_context;
+ 	port = new boost::asio::serial_port(*ioService);
+ 	timer = new boost::asio::deadline_timer(*ioService);
+ 
+@@ -542,7 +559,7 @@ size_t UsbCdcIoChannel::read(HalResponse& resp)
+ 
+ 	boost::system::error_code ec;
+ 
+-	while (ioService->run_one(ec))
++	while (ioService->run_one())
+ 	{
+ 		if (readEvent)
+ 		{
+@@ -577,13 +594,13 @@ size_t UsbCdcIoChannel::read(HalResponse& resp)
+ 
+ 		if (ioService->stopped())
+ 		{
+-			ioService->reset();
++			ioService->restart();
+ 		}
+ 	}
+ 
+ 	//Let cancelled tasks finish
+-	ioService->run(ec);
+-	ioService->reset();
++	ioService->run();
++	ioService->restart();
+ 
+ 
+ 	if (actSize == expSize)
diff --git a/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.h b/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.h
new file mode 100644
index 000000000000..7d5a7f5dfe50
--- /dev/null
+++ b/devel/msp430-debug-stack/files/patch-DLL430__v3_src_TI_DLL430_UsbCdcIoChannel.h
@@ -0,0 +1,20 @@
+--- DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h.orig	2025-04-02 18:10:46 UTC
++++ DLL430_v3/src/TI/DLL430/UsbCdcIoChannel.h
+@@ -45,7 +45,7 @@
+ 
+ #include <boost/asio/serial_port.hpp>
+ #include <boost/asio/deadline_timer.hpp>
+-#include <boost/asio/io_service.hpp>
++#include <boost/asio/io_context.hpp>
+ 
+ namespace TI
+ {
+@@ -74,7 +74,7 @@ namespace TI
+ 
+ 		private:
+ 			std::vector<uint8_t> inputBuffer;
+-			boost::asio::io_service* ioService;
++			boost::asio::io_context* ioService;
+ 			boost::asio::serial_port* port;
+ 			boost::asio::deadline_timer* timer;
+ 			ComState comState;
diff --git a/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceSerialUART.cpp b/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceSerialUART.cpp
new file mode 100644
index 000000000000..8e2381a91f25
--- /dev/null
+++ b/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceSerialUART.cpp
@@ -0,0 +1,11 @@
+--- ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp.orig	2025-04-02 18:13:20 UTC
++++ ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.cpp
+@@ -129,7 +129,7 @@ MSPBSL_PhysicalInterfaceSerialUART::MSPBSL_PhysicalInt
+ 
+ 
+ 	//TODO: Catch exception forunknown ports
+-	io_service io;
++	io_context io;
+     port = new serial_port( io, PORT );
+ 	port->set_option( serial_port_base::character_size( 8 ) );
+ 	port->set_option( serial_port_base::flow_control( serial_port_base::flow_control::none ) );
diff --git a/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceSerialUART.h b/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceSerialUART.h
new file mode 100644
index 000000000000..898f1e9cf840
--- /dev/null
+++ b/devel/msp430-debug-stack/files/patch-ThirdParty_BSL430__DLL_BSL430__DLL_Physical__Interfaces_MSPBSL__PhysicalInterfaceSerialUART.h
@@ -0,0 +1,10 @@
+--- ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.h.orig	2025-04-02 18:10:22 UTC
++++ ThirdParty/BSL430_DLL/BSL430_DLL/Physical_Interfaces/MSPBSL_PhysicalInterfaceSerialUART.h
+@@ -72,6 +72,6 @@ class MSPBSL_PhysicalInterfaceSerialUART : public MSPB
+ 	virtual std::string getErrorInformation( uint16_t err );
+ 
+ private:
+-    boost::asio::io_service io;
++    boost::asio::io_context io;
+     boost::asio::serial_port* port;
+ };