git: 50aed9b03a2c - 2022Q3 - math/Imath: ensure PYTHON build with /usr/bin/python[3] links

From: Matthias Andree <>
Date: Tue, 12 Jul 2022 19:27:46 UTC
The branch 2022Q3 has been updated by mandree:


commit 50aed9b03a2ccb85c7a5f45866d914e97f2ef42d
Author:     Matthias Andree <>
AuthorDate: 2022-07-12 19:06:08 +0000
Commit:     Matthias Andree <>
CommitDate: 2022-07-12 19:20:52 +0000

    math/Imath: ensure PYTHON build with /usr/bin/python[3] links
    When /usr/bin/python[3] symlinks are present (which is nonstandard), the
    FindPython logic inside cmake will grab it over $PREFIX/bin/python[3],
    but still identify (by default) /usr/local/lib/... as the sitelib path,
    but goof up when calculating the relative path in case of /usr/bin vs
    /usr/local/bin mismatch.
    Fix: Provide ${PYTHON_CMD} through the cmake Python_EXECUTABLE
    variable to avoid any ambiguities and pin the right executable.
    I believe it should be safe to NOT bump PORTREVISION,
    but I will fetch far and err on the safe side and bump it, because that
    is easier than researching all possible paths how and where
    Python paths might find their way into the resulting package.
    The detailed report by Seneca helped identify and solve this issue, so:
    Thanks to:      Seneca Cunningham <>
    PR:             263341
    Reported by:    D'Arcy J.M. Cain <>
    Reported by:    Seneca Cunningham <>
    MFH:            2022Q3
    (cherry picked from commit d443494a71b73dc543cc0eddec69a01d6280ce02)
 math/Imath/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/math/Imath/Makefile b/math/Imath/Makefile
index a8dfc492bc43..1e7ee781b089 100644
--- a/math/Imath/Makefile
+++ b/math/Imath/Makefile
@@ -2,6 +2,7 @@
 CATEGORIES=	math devel graphics
@@ -45,7 +46,7 @@ _MINVER=	4
 _PLVER=		0
-	${REINPLACE_CMD} -E 's/find_package\(Python(3?) COMPONENTS/find_package(Python\1 ${PYTHON_VER} EXACT COMPONENTS/' \
+	${REINPLACE_CMD} -E 's}find_package\(Python(3?) COMPONENTS}set(Python\1_EXECUTABLE ${PYTHON_CMD})\nfind_package(Python\1 ${PYTHON_VER} EXACT COMPONENTS}' \