git: 2b3af2667f78 - main - net-im/tox: Improve port

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sun, 02 Feb 2025 18:48:06 UTC
The branch main has been updated by diizzy:

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

commit 2b3af2667f78cc3d500d64d5309b4a1334793fcb
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2025-02-02 18:08:21 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2025-02-02 18:47:26 +0000

    net-im/tox: Improve port
    
    * Use upstream release archive
    * Fix various dependency related issues
    * Add USES= compiler:c++17-lang
    * Utilize USES= cmake:testing
    * Fix plist-issue, bash-completion
    * Rework and modernize Makefile layout to closer follow Porters Handbook
    
    PR:             284134
    Approved by:    portmgr (maintainer timeout, 2+ weeks)
---
 net-im/tox/Makefile  | 51 ++++++++++++++++++++++++---------------------------
 net-im/tox/distinfo  |  8 +++-----
 net-im/tox/pkg-plist |  2 +-
 3 files changed, 28 insertions(+), 33 deletions(-)

diff --git a/net-im/tox/Makefile b/net-im/tox/Makefile
index 54e5c4679685..153041b83df4 100644
--- a/net-im/tox/Makefile
+++ b/net-im/tox/Makefile
@@ -1,47 +1,44 @@
 PORTNAME=	toxcore
-DISTVERSIONPREFIX=	v
 DISTVERSION=	0.2.20
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net-im net-p2p
+MASTER_SITES=	https://github.com/TokTok/c-${PORTNAME}/releases/download/v${DISTVERSION}/
+DISTNAME=	c-${PORTNAME}-${DISTVERSION}
 
 MAINTAINER=	thierry@FreeBSD.org
 COMMENT=	ProjectTox-Core library, a decentralized and secure messenger
 WWW=		https://tox.chat/
 
 LICENSE=	GPLv3
+LICENSE_FILES=	${WRKSRC}/LICENSE
 
-BUILD_DEPENDS=	checkmk:devel/check			\
-		gtest:sysutils/coreutils
-LIB_DEPENDS=	libvpx.so:multimedia/libvpx		\
-		libsndfile.so:audio/libsndfile		\
-		libportaudio.so:audio/portaudio		\
-		libsodium.so:security/libsodium		\
-		libopus.so:audio/opus			\
-		libconfig.so:devel/libconfig
-TEST_DEPENDS=	opencv_visualisation:graphics/opencv
-#TEST_DEPENDS=	libopencv_core.so:graphics/opencv
-
-USE_GITHUB=	yes
-GH_ACCOUNT=	TokTok camgunz:cmp
-GH_PROJECT=	c-toxcore cmp:cmp
-GH_TAGNAME=	2ac6bca152987c805c04423ebbba4b750585337f:cmp
-GH_SUBDIR=	third_party/cmp:cmp
+LIB_DEPENDS=	libopus.so:audio/opus \
+		libsodium.so:security/libsodium	\
+		libvpx.so:multimedia/libvpx
+TEST_DEPENDS=	googletest>0:devel/googletest
 
+USES=		cmake:testing compiler:c++17-lang cpe pathfix pkgconfig
 CPE_VENDOR=	toktok
-
-USES=		cmake cpe pathfix pkgconfig
+PATHFIX_CMAKELISTSTXT=	ModulePackage.cmake
 USE_LDCONFIG=	yes
-PLIST_SUB=	VER=${PORTVERSION:C/0.//}.0 SO=2
 
-OPTIONS_DEFINE=		DAEMON TEST
-OPTIONS_SUB=		yes
+PLIST_SUB=	VER=${DISTVERSION:C/0.//}.0 SO=2
 
-DAEMON_DESC=		Bootstrap daemon
-DAEMON_CMAKE_ON=	-DBOOTSTRAP_DAEMON=on
-DAEMON_LIB_DEPENDS=	libconfig.so:devel/libconfig
+CMAKE_TESTING_OFF=	CMAKE_DISABLE_FIND_PACKAGE_GTest
+CMAKE_TESTING_ON=	UNITTEST
+# AUTOTEST(s) are broken...
+
+CMAKE_OFF=	CMAKE_DISABLE_FIND_PACKAGE_GTest \
+		UNITTEST
 
-TEST_CMAKE_ON=		-DAUTOTEST=on
-TEST_TARGET=		test
+OPTIONS_DEFINE=	DAEMON
+OPTIONS_SUB=	yes
+
+DAEMON_DESC=	Bootstrap daemon
+
+DAEMON_LIB_DEPENDS=	libconfig.so:devel/libconfig
+DAEMON_CMAKE_BOOL=	BOOTSTRAP_DAEMON
 
 .include <bsd.port.options.mk>
 
diff --git a/net-im/tox/distinfo b/net-im/tox/distinfo
index 37d3a1b0aa62..febef1b55966 100644
--- a/net-im/tox/distinfo
+++ b/net-im/tox/distinfo
@@ -1,5 +1,3 @@
-TIMESTAMP = 1736010194
-SHA256 (TokTok-c-toxcore-v0.2.20_GH0.tar.gz) = 5c1bc37d24a1e37fc6c03580e2602019a09393cd2e8ae1f58e338438f14d5871
-SIZE (TokTok-c-toxcore-v0.2.20_GH0.tar.gz) = 823028
-SHA256 (camgunz-cmp-2ac6bca152987c805c04423ebbba4b750585337f_GH0.tar.gz) = 65a22f44baf630630210c22a2188bea2e46e43afae0be61aced47b8eccc4b281
-SIZE (camgunz-cmp-2ac6bca152987c805c04423ebbba4b750585337f_GH0.tar.gz) = 40172
+TIMESTAMP = 1737201354
+SHA256 (c-toxcore-0.2.20.tar.gz) = a9c89a8daea745d53e5d78e7aacb99c7b4792c4400a5a69c71238f45d6164f4c
+SIZE (c-toxcore-0.2.20.tar.gz) = 862660
diff --git a/net-im/tox/pkg-plist b/net-im/tox/pkg-plist
index 552794118a42..faafb5ee44a4 100644
--- a/net-im/tox/pkg-plist
+++ b/net-im/tox/pkg-plist
@@ -11,7 +11,7 @@ lib/libtoxcore.so
 lib/libtoxcore.so.%%SO%%
 lib/libtoxcore.so.%%VER%%
 libdata/pkgconfig/toxcore.pc
-share/bash-completion/completions/tox-bootstrapd
+%%DAEMON%%share/bash-completion/completions/tox-bootstrapd
 %%DAEMON%%@dir(%%TOXDHT%%,nobody,755) /var/run/tox-bootstrapd
 %%DAEMON%%@dir(%%TOXDHT%%,nobody,700) /var/lib/tox-bootstrapd
 %%DAEMON%%@dir /var/lib