git: 0199fbab9ae5 - 2023Q3 - devel/py-maturin: Fix command name for non-default Python versions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Aug 2023 12:17:13 UTC
The branch 2023Q3 has been updated by kai:
URL: https://cgit.FreeBSD.org/ports/commit/?id=0199fbab9ae53912fd05dcacd3348a32a28de3a7
commit 0199fbab9ae53912fd05dcacd3348a32a28de3a7
Author: John Hein <jcfyecrayz@liamekaens.com>
AuthorDate: 2023-08-03 11:04:59 +0000
Commit: Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2023-08-10 12:14:55 +0000
devel/py-maturin: Fix command name for non-default Python versions
If devel/py-maturin is built for a non-default python flavor (e.g.,
'make FLAVOR=py38'), the port installs bin/maturin-<ver> and does not
install bin/maturin which is normal and expected.
The site-packages/maturin/__init__.py file, however, explicitly defines
the command to use as 'maturin'.
Because of this when using maturin to build other ports, they can fail
with "No such file or directory: 'maturin'". [1] Fix the issue by
aligning the command name to the actual Python flavor.
PR: 272618, 272600 [1]
Reported by: John W. O'Brien [1]
MFH: 2023Q3 (after 1 week)
(cherry picked from commit 00ae5289b23194d0b79413e62abc6ceff960fb09)
---
devel/py-maturin/Makefile | 3 ++-
devel/py-maturin/files/patch-maturin-__init__.py | 11 +++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/devel/py-maturin/Makefile b/devel/py-maturin/Makefile
index 8f198ff63816..b3600318dbe1 100644
--- a/devel/py-maturin/Makefile
+++ b/devel/py-maturin/Makefile
@@ -1,7 +1,7 @@
PORTNAME= maturin
DISTVERSIONPREFIX= v
DISTVERSION= 0.13.2
-PORTREVISION= 8
+PORTREVISION= 10
CATEGORIES= devel python
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -345,6 +345,7 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}tomli>=0.10.1:textproc/py-tomli@${PY_FLAVOR
post-patch:
@${RM} ${WRKSRC}/pyproject.toml
+ ${REINPLACE_CMD} 's|%%PYTHON_VER%%|${PYTHON_VER}|' ${WRKSRC}/maturin/__init__.py
# The binary is usually built via setup.py which uses different compiler flags.
# That line is patched out there to use the compiler flags from the Ports
diff --git a/devel/py-maturin/files/patch-maturin-__init__.py b/devel/py-maturin/files/patch-maturin-__init__.py
new file mode 100644
index 000000000000..5c1fe49c81d8
--- /dev/null
+++ b/devel/py-maturin/files/patch-maturin-__init__.py
@@ -0,0 +1,11 @@
+--- maturin/__init__.py.orig 2022-08-14 11:03:56 UTC
++++ maturin/__init__.py
+@@ -52,7 +52,7 @@ def _build_wheel(
+ # PEP 517 specifies that only `sys.executable` points to the correct
+ # python interpreter
+ command = [
+- "maturin",
++ "maturin-%%PYTHON_VER%%",
+ "pep517",
+ "build-wheel",
+ "-i",