git: e5731e2bf4e7 - main - net-p2p/libutp: update to g20230213

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 10 Sep 2023 16:13:26 UTC
The branch main has been updated by fuz:

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

commit e5731e2bf4e706904cae6131fc5e7fd32d6814c7
Author:     Rafe <mondo.debater_0q@icloud.com>
AuthorDate: 2023-09-06 00:45:48 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-09-10 16:12:57 +0000

    net-p2p/libutp: update to g20230213
    
    In preparation of the following net-p2p/transmission update.
    The library must be updated in lockstep.
    
    PR:             269504
    Reported by:    dutchman01@quicknet.nl
    Approved by:    rigoletto, tcberner (maintainer timeout)
    Reviewed By:    fcharlier_ploup.net
    Differential Revision: https://reviews.freebsd.org/D40910
---
 net-p2p/libutp/Makefile                   | 17 ++++++++---------
 net-p2p/libutp/distinfo                   |  6 +++---
 net-p2p/libutp/files/patch-CMakeLists.txt | 30 ++++++++++++++++++++++--------
 net-p2p/libutp/pkg-plist                  | 10 ++++++++++
 4 files changed, 43 insertions(+), 20 deletions(-)

diff --git a/net-p2p/libutp/Makefile b/net-p2p/libutp/Makefile
index 60a6b5ae31ef..9150ca449f76 100644
--- a/net-p2p/libutp/Makefile
+++ b/net-p2p/libutp/Makefile
@@ -1,10 +1,10 @@
 PORTNAME=	libutp
-DISTVERSION=	g20180515
+DISTVERSION=	g20230213
 CATEGORIES=	net-p2p
 
-MAINTAINER=	rigoletto@FreeBSD.org
-COMMENT=	uTorrent Transport Protocol library and sample utilities
-WWW=		https://github.com/bittorrent/libutp
+MAINTAINER=	mondo.debater_0q@icloud.com
+COMMENT=	uTorrent Transport Protocol library and sample utilities.
+WWW=		https://github.com/transmission/libutp
 
 LICENSE=	MIT
 
@@ -12,12 +12,11 @@ USES=		cmake uidfix
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	transmission
-GH_TAGNAME=	fda9f4b3db97ccb243fcbed2ce280eb4135d705b
+GH_TAGNAME=	c95738b1a6644b919e5b64d3ea9736cfc5894e0b
 
 USE_LDCONFIG=	yes
-
-PLIST_FILES=	include/libutp/utp.h \
-		include/libutp/utypes.h \
-		lib/libutp.so
+CMAKE_ON=	LIBUTP_SHARED
+CMAKE_OFF=	LIBUTP_ENABLE_WERROR
+CMAKE_BUILD_TYPE=	Release
 
 .include <bsd.port.mk>
diff --git a/net-p2p/libutp/distinfo b/net-p2p/libutp/distinfo
index 443fdc9d884a..7ebb081422bd 100644
--- a/net-p2p/libutp/distinfo
+++ b/net-p2p/libutp/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1668792304
-SHA256 (transmission-libutp-g20180515-fda9f4b3db97ccb243fcbed2ce280eb4135d705b_GH0.tar.gz) = c515e6f9add47d3d202389e8a62feb765f0ae41d6398cc238e44028be520774e
-SIZE (transmission-libutp-g20180515-fda9f4b3db97ccb243fcbed2ce280eb4135d705b_GH0.tar.gz) = 71743
+TIMESTAMP = 1690649660
+SHA256 (transmission-libutp-g20230213-c95738b1a6644b919e5b64d3ea9736cfc5894e0b_GH0.tar.gz) = d856fde68828d52eb39df40e15ad5dc4efaa9a51d4121bcbfbe47fed2163d20a
+SIZE (transmission-libutp-g20230213-c95738b1a6644b919e5b64d3ea9736cfc5894e0b_GH0.tar.gz) = 59698
diff --git a/net-p2p/libutp/files/patch-CMakeLists.txt b/net-p2p/libutp/files/patch-CMakeLists.txt
index 35e1773d3966..27dc44215202 100644
--- a/net-p2p/libutp/files/patch-CMakeLists.txt
+++ b/net-p2p/libutp/files/patch-CMakeLists.txt
@@ -1,11 +1,25 @@
---- CMakeLists.txt.orig	2017-01-01 23:21:43 UTC
+--- CMakeLists.txt.orig	2023-08-04 09:40:52 UTC
 +++ CMakeLists.txt
-@@ -11,7 +11,7 @@ include_directories(.)
+@@ -56,6 +56,13 @@ if(WIN32)
+         libutp_inet_ntop.h)
+ endif()
  
- include_directories(.)
++if(CMAKE_VERSION VERSION_LESS 3.25)
++	    set(BSD OFF)
++	        if(CMAKE_SYSTEM_NAME MATCHES "BSD")
++			        set(BSD ON)
++				    endif()
++			    endif()
++
+ add_library(libutp ${LIBUTP_LIBRARY_TYPE}
+     include/libutp/utp.h
+     include/libutp/utp_types.h
+@@ -118,7 +125,7 @@ if(LIBUTP_BUILD_PROGRAMS AND NOT MSVC)
  
--add_library(${PROJECT_NAME} STATIC
-+add_library(${PROJECT_NAME} SHARED
-     utp.cpp
-     utp_utils.cpp
-     ${${PROJECT_NAME}_ADD_SOURCES}
+     target_compile_definitions(ucat
+         PRIVATE
+-            $<$<NOT:$<BOOL:${WIN32}>>:_POSIX_C_SOURCE=200112L>
++	    $<$<NOT:$<OR:$<BOOL:${WIN32}>,$<BOOL:${BSD}>>>:_POSIX_C_SOURCE=200112L>
+             $<$<BOOL:${APPLE}>:_DARWIN_C_SOURCE>)
+ 
+     target_link_libraries(ucat
diff --git a/net-p2p/libutp/pkg-plist b/net-p2p/libutp/pkg-plist
new file mode 100644
index 000000000000..a7d219d201ae
--- /dev/null
+++ b/net-p2p/libutp/pkg-plist
@@ -0,0 +1,10 @@
+bin/ucat
+lib/cmake/libutp/libutp-config-version.cmake
+lib/cmake/libutp/libutp-config.cmake
+lib/cmake/libutp/libutp-targets.cmake
+lib/cmake/libutp/libutp-targets-release.cmake
+include/libutp/utp.h
+include/libutp/utp_types.h
+lib/libutp.so
+%%DOCSDIR%%/LICENSE
+%%DOCSDIR%%/README.md