git: f4bc59d50389 - main - devel/py-virtualenv: unbreak DOCS build with non-default python (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Sat, 04 Mar 2023 12:00:34 UTC
The branch main has been updated by fluffy:

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

commit f4bc59d5038987d8cf798e2d193fb8f85c9b208e
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2023-03-04 11:58:58 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2023-03-04 11:58:58 +0000

    devel/py-virtualenv: unbreak DOCS build with non-default python (+)
    
    We should always use versioned python-related stuff
    
    Approved by:    portmgr blanket
    
    Sponsored by:   Serenity Cybersecurity, LLC
---
 devel/py-virtualenv/Makefile                 | 4 +++-
 devel/py-virtualenv/files/patch-docs_conf.py | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/devel/py-virtualenv/Makefile b/devel/py-virtualenv/Makefile
index 9bdab9d5188e..36b7a1531c9c 100644
--- a/devel/py-virtualenv/Makefile
+++ b/devel/py-virtualenv/Makefile
@@ -74,7 +74,9 @@ DOCS_PORTDOCS=		* .buildinfo
 VIRTUALENV_WHEEL=	${WRKSRC}/dist/${PORTNAME}-${PORTVERSION}-py${PYTHON_MAJOR_VER}-none-any.whl
 
 post-patch:
-	@${SED} -i.bak -e 's,%%VIRTUALENV_WHEEL%%,${VIRTUALENV_WHEEL},1' ${WRKSRC}/docs/conf.py
+	@${SED} -i.bak -e 's,%%VIRTUALENV_WHEEL%%,${VIRTUALENV_WHEEL},1' \
+	-e 's,%%PYTHON_VER%%,${PYTHON_VER},1' \
+	${WRKSRC}/docs/conf.py
 
 post-install:
 	${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py -d ${PYTHONPREFIX_SITELIBDIR} -f ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
diff --git a/devel/py-virtualenv/files/patch-docs_conf.py b/devel/py-virtualenv/files/patch-docs_conf.py
index a29883882f74..a21be0c69da2 100644
--- a/devel/py-virtualenv/files/patch-docs_conf.py
+++ b/devel/py-virtualenv/files/patch-docs_conf.py
@@ -14,7 +14,7 @@
      here = Path(__file__).parent
      root, exe = here.parent, Path(sys.executable)
 -    towncrier = exe.with_name(f"towncrier{exe.suffix}")
-+    towncrier = exe.with_name(f"towncrier")
++    towncrier = exe.with_name(f"towncrier-%%PYTHON_VER%%")
      cmd = [str(towncrier), "build", "--draft", "--version", "NEXT"]
      new = subprocess.check_output(cmd, cwd=root, text=True, stderr=subprocess.DEVNULL)
      (root / "docs" / "_draft.rst").write_text("" if "No significant changes" in new else new)