Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Aug 2023 11:12:01 GMT
From:      Kai Knoblich <kai@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 00ae5289b231 - main - devel/py-maturin: Fix command name for non-default Python versions
Message-ID:  <202308031112.373BC1iP006246@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kai:

URL: https://cgit.FreeBSD.org/ports/commit/?id=00ae5289b23194d0b79413e62abc6ceff960fb09

commit 00ae5289b23194d0b79413e62abc6ceff960fb09
Author:     John Hein <jcfyecrayz@liamekaens.com>
AuthorDate: 2023-08-03 11:04:59 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2023-08-03 11:04:59 +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)
---
 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 25d73bf046be..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=	9
+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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308031112.373BC1iP006246>