git: 3c2460a20bf5 - main - devel/pycdc: Various fixes

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sat, 10 Aug 2024 13:35:43 UTC
The branch main has been updated by diizzy:

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

commit 3c2460a20bf5b91519df82352858c6cf8215eed2
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-08-10 13:26:41 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2024-08-10 13:35:39 +0000

    devel/pycdc: Various fixes
    
    * Remove bash as build dependency
    * Define USES= compiler:c++11-lang
    * Define Python dependency for "make test" and env for build to
      enable PYTHON vars when using USES= shebangfix
    * Define bash as dependency for "make test"
    * Use TEST_TARGET instead of do-test
    
    Approved by:    portmgr (blanket, build fix)
---
 devel/pycdc/Makefile                             | 13 +++++++------
 devel/pycdc/files/patch-tests_decompyle__test.sh | 11 +++++++++++
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/devel/pycdc/Makefile b/devel/pycdc/Makefile
index 60896dd85286..418657bbba63 100644
--- a/devel/pycdc/Makefile
+++ b/devel/pycdc/Makefile
@@ -8,21 +8,22 @@ COMMENT=	Python bytecode disassembler and decompiler
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BUILD_DEPENDS=	bash:shells/bash
+TEST_DEPENDS=	bash:shells/bash
 
-USES=		cmake shebangfix
+USES=		cmake compiler:c++11-lang python:env,test shebangfix
+SHEBANG_FILES=	scripts/pymultic scripts/token_dump tests/*.sh
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	zrax
 GH_TAGNAME=	48d1bfa
 
-SHEBANG_FILES=	tests/all_tests.sh \
-		tests/decompyle_test.sh
+TEST_TARGET=	check
 
 PLIST_FILES=	bin/pycdas \
 		bin/pycdc
 
-do-test:
-	cd ${BUILD_WRKSRC} && ninja check
+post-patch:
+	@${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|g' \
+	    ${PATCH_WRKSRC}/tests/decompyle_test.sh
 
 .include <bsd.port.mk>
diff --git a/devel/pycdc/files/patch-tests_decompyle__test.sh b/devel/pycdc/files/patch-tests_decompyle__test.sh
new file mode 100644
index 000000000000..fff31c17037a
--- /dev/null
+++ b/devel/pycdc/files/patch-tests_decompyle__test.sh
@@ -0,0 +1,11 @@
+--- tests/decompyle_test.sh.orig	2024-08-10 12:46:23 UTC
++++ tests/decompyle_test.sh
+@@ -6,7 +6,7 @@ if [[ -z "$PYTHON_EXE" ]]; then
+ outdir="$2"
+ 
+ if [[ -z "$PYTHON_EXE" ]]; then
+-    PYTHON_EXE="$(which python3)"
++    PYTHON_EXE="%%PYTHON_CMD%%"
+ fi
+ 
+ if [[ -z "$testname" ]]; then