git: 37afd1559b97 - main - audio/libmysofa: Limit extraction of test data

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Mon, 06 May 2024 02:24:07 UTC
The branch main has been updated by jhale:

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

commit 37afd1559b9785f4cc3335aa76c9a0962e52f892
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-05-06 02:15:32 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2024-05-06 02:23:32 +0000

    audio/libmysofa: Limit extraction of test data
    
    The test data is very large (~250 Mib). Only extract it if the TEST
    option is enabled to save on I/O.
    
    While here, pet portclippy(1).
    
    PR:             278785
---
 audio/libmysofa/Makefile                                  | 15 +++++++++++----
 ...patch-tests_compare.sh => extrapatch-tests_compare.sh} |  0
 ...eIgnoreNew.sh => extrapatch-tests_compareIgnoreNew.sh} |  0
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/audio/libmysofa/Makefile b/audio/libmysofa/Makefile
index 0ca80667c266..716b11100250 100644
--- a/audio/libmysofa/Makefile
+++ b/audio/libmysofa/Makefile
@@ -13,12 +13,14 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 TEST_DEPENDS=	node:www/node
 
 USES=		cmake cpe pathfix
-USE_LDCONFIG=	yes
-
 CPE_VENDOR=	symonics
-
 USE_GITHUB=	yes
 GH_ACCOUNT=	hoene
+USE_LDCONFIG=	yes
+
+EXTRACT_AFTER_ARGS=	--exclude ${PORTNAME}-${DISTVERSION}/tests \
+			--exclude ${PORTNAME}-${DISTVERSION}/windows \
+			--no-same-owner --no-same-permissions
 
 OPTIONS_DEFINE=		STATIC TEST
 OPTIONS_DEFAULT=	STATIC
@@ -29,12 +31,17 @@ STATIC_CMAKE_BOOL=	BUILD_STATIC_LIBS
 TEST_BUILD_DEPENDS=	cunit>0:devel/cunit
 TEST_CMAKE_BOOL=	BUILD_TESTS
 TEST_TEST_TARGET=	test
+TEST_EXTRA_PATCHES=	${PATCHDIR}/extrapatch-tests_compare.sh \
+			${PATCHDIR}/extrapatch-tests_compareIgnoreNew.sh
 
 # The tests are expected to be in ../tests relative to the build
 # directory and the build results are expected to be in build/ relative
 # to ${WRKSRC}.  USES=cmake does not allow overwriting ${WRKDIR}/.build
 # as the build directory.
-post-patch:
+post-extract-TEST-on:
+	@${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \
+	    -C ${WRKDIR} --include ${PORTNAME}-${DISTVERSION}/tests \
+	    --no-same-owner --no-same-permissions
 	@${RLN} ${WRKSRC}/build ${CONFIGURE_WRKSRC}
 
 .include <bsd.port.mk>
diff --git a/audio/libmysofa/files/patch-tests_compare.sh b/audio/libmysofa/files/extrapatch-tests_compare.sh
similarity index 100%
rename from audio/libmysofa/files/patch-tests_compare.sh
rename to audio/libmysofa/files/extrapatch-tests_compare.sh
diff --git a/audio/libmysofa/files/patch-tests_compareIgnoreNew.sh b/audio/libmysofa/files/extrapatch-tests_compareIgnoreNew.sh
similarity index 100%
rename from audio/libmysofa/files/patch-tests_compareIgnoreNew.sh
rename to audio/libmysofa/files/extrapatch-tests_compareIgnoreNew.sh