git: 8978bbb9747c - main - www/py-adblock: Prepare for py-maturin >= 0.13.0

From: Kai Knoblich <kai_at_FreeBSD.org>
Date: Sat, 10 Sep 2022 10:52:35 UTC
The branch main has been updated by kai:

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

commit 8978bbb9747c44ba8ddf8058ea3419c363e92bf2
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2022-09-10 10:33:40 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2022-09-10 10:33:40 +0000

    www/py-adblock: Prepare for py-maturin >= 0.13.0
    
    * Since the 0.13.0 release maturin no longer searches for the Python
      interpreters by default and uses the current interpreter found in the
      PATH environment variable.  Thus set BINARY_ALIAS to give a specific
      Python interpreter during build.
    
    * Fix build as well if building the port for multiple Python flavors by
      using FLAVOR_DEFAULT_ALL in poudriere and BUILD_ALL_PYTHON_FLAVORS in
      the make.conf.
    
    * Add CONFLICTS_INSTALL because a shared library is installed outside of
      Python's site-lib directory.
    
    * No bump of PORTREVISION as the package content isn't changed.
    
    PR:             266211 (related)
    Approved by:    portmgr (blanket)
---
 www/py-adblock/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/www/py-adblock/Makefile b/www/py-adblock/Makefile
index 41feb5e1a0ab..3004f7141aee 100644
--- a/www/py-adblock/Makefile
+++ b/www/py-adblock/Makefile
@@ -100,6 +100,11 @@ CARGO_BUILD=		no
 CARGO_INSTALL=		no
 CARGO_TARGET_DIR=	${WRKSRC}/target
 
+CONFLICTS_INSTALL=	py3[0-9]-adblock py3[0-9][0-9]-adblock # lib/libadblock.so
+
+# Required since maturin >= 0.13.0
+BINARY_ALIAS=	python3=${PYTHON_CMD}
+
 .include <bsd.port.options.mk>
 
 # This is to prevent Mk/Uses/python.mk do-configure target from firing.
@@ -108,7 +113,7 @@ do-configure:
 do-build:
 	@(cd ${BUILD_WRKSRC} ; \
 		PSL_PATH="${PREFIX}/share/public_suffix_list/public_suffix_list.dat" \
-		${SETENV} ${MAKE_ENV} maturin build --release ${WITH_DEBUG:D:U--strip})
+		${SETENV} ${MAKE_ENV} maturin-${PYTHON_VER} build --release ${WITH_DEBUG:D:U--strip})
 
 # Due to upstream not supplying a setup.py file or other way to install
 # using pip command for now...
@@ -120,7 +125,7 @@ do-install:
 	@(cd ${INSTALL_WRKSRC} ; \
 		${INSTALL_DATA} "target/release/libadblock.so" \
 		"${STAGEDIR}/${PREFIX}/lib" ; \
-		${SETENV} ${MAKE_ENV} pip install --isolated --root=${STAGEDIR} \
+		${SETENV} ${MAKE_ENV} pip-${PYTHON_VER} install --isolated --root=${STAGEDIR} \
 		--ignore-installed --no-deps target/wheels/*.whl)
 
 post-install: