git: 3b9151ce785b - main - math/vtk9: Build and install python bytecode

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Thu, 05 Sep 2024 06:23:26 UTC
The branch main has been updated by sunpoet:

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

commit 3b9151ce785bf20c59482a27dd983387aec9db8e
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-09-05 05:30:17 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-09-05 06:18:35 +0000

    math/vtk9: Build and install python bytecode
    
    - Bump PORTREVISION for package change
    
    from graphics/py-mayavi build log:
    =>> Checking for filesystem violations... done
    =>> Error: Filesystem touched during build:
    extra: usr/local/lib/python3.11/site-packages/__pycache__/vtk.cpython-311.pyc
    extra: usr/local/lib/python3.11/site-packages/vtkmodules/__pycache__
    extra: usr/local/lib/python3.11/site-packages/vtkmodules/util/__pycache__
    =>> Cleaning up wrkdir
    ===>  Cleaning for py311-mayavi-4.8.2
    
    Approved by:    portmgr (blanket)
    With hat:       python
---
 math/vtk9/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/math/vtk9/Makefile b/math/vtk9/Makefile
index 035d68bba89e..1caede6b971f 100644
--- a/math/vtk9/Makefile
+++ b/math/vtk9/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	vtk
 DISTVERSION=	9.2.6
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	math graphics
 MASTER_SITES=	https://vtk.org/files/release/${VTK_SHORT_VER}/
 PKGNAMESUFFIX=	9
@@ -132,6 +132,8 @@ RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mpi4py>0:net/py-mpi4py@${PY_FLAVOR}
 CONFLICTS=	vtk6 vtk8
 
 do-install-PYTHON-on:
+	${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} -f ${STAGEDIR}${PYTHON_SITELIBDIR}
+	${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} -f ${STAGEDIR}${PYTHON_SITELIBDIR}
 	# cmake doesn't install pip's .egg-info: https://gitlab.kitware.com/vtk/vtk/-/issues/18087
 	@${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/vtk-${DISTVERSION}-py${PYTHON_VER}.egg-info
 	@${INSTALL_DATA} ${WRKDIR}/PKG-INFO ${STAGEDIR}${PYTHON_SITELIBDIR}/vtk-${DISTVERSION}-py${PYTHON_VER}.egg-info