git: 9a15762f0dff - main - textproc/ibus: avoid generating "*.cpython3*.opt-2.pyc" by -OO on byte compiling

Dima Panov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.ports
Message-ID <[email protected]>
The branch main has been updated by fluffy:

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

commit 9a15762f0dffe2848315c61d4d1361aa73d47126
Author:     Dima Panov <[email protected]>
AuthorDate: 2026-08-13 13:25:47 +0000
Commit:     Dima Panov <[email protected]>
CommitDate: 2026-08-13 13:30:56 +0000

    textproc/ibus: avoid generating "*.cpython3*.opt-2.pyc" by -OO on byte compiling
    
    It unnecessary touch and rebuild setuptools component:
    =>> Error: Filesystem touched during stage (files must install to ${STAGEDIR}):
    extra: usr/local/lib/python3.12/site-packages/_distutils_hack/__pycache__/__init__.cpython-312.opt-2.pyc
    
    Reported by:    bulk -t
    Approved by:    portmgr blanket
---
 textproc/ibus/Makefile  |  5 +++++
 textproc/ibus/pkg-plist | 10 ----------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/textproc/ibus/Makefile b/textproc/ibus/Makefile
index 7f88d71a4c7e..b16b0292c1cf 100644
--- a/textproc/ibus/Makefile
+++ b/textproc/ibus/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	ibus
 DISTVERSION=	1.5.34
+PORTREVISION=	1
 CATEGORIES=	textproc
 MASTER_SITES=	https://github.com/${PORTNAME}/${PORTNAME}/releases/download/${DISTVERSION}/
 
@@ -110,6 +111,10 @@ PLIST_SUB+=	COMPDIR=""
 PLIST_SUB+=	COMPDIR="@comment "
 .endif
 
+# avoid generating "*.cpython3*.opt-2.pyc" by -OO on byte compiling
+post-patch:
+	@${REINPLACE_CMD} -e '/PYTHON/ s|-OO|-O|' ${WRKSRC}/py-compile
+
 post-configure:
 	# Clean pre-generated source code, which may not match the options selected.
 	${MAKE} -C ${WRKSRC}/ui/gtk3 maintainer-clean-generic
diff --git a/textproc/ibus/pkg-plist b/textproc/ibus/pkg-plist
index 92abf2be0952..e4f7e8df7c05 100644
--- a/textproc/ibus/pkg-plist
+++ b/textproc/ibus/pkg-plist
@@ -56,7 +56,6 @@ include/ibus-1.0/ibusxml.h
 %%GINTRO%%%%PYTHON_SITELIBDIR%%/gi/overrides/IBus.py
 %%GINTRO%%%%PYTHON_SITELIBDIR%%/gi/overrides/IBus.pyc
 %%GINTRO%%%%PYTHON_SITELIBDIR%%/gi/overrides/IBus.pyo
-%%GINTRO%%%%PYTHON_SITELIBDIR%%/gi/overrides/__pycache__/IBus%%PYTHON_TAG%%.opt-2.pyc
 %%GTK3%%lib/gtk-3.0/3.0.0/immodules/im-ibus.so
 %%GTK4%%lib/gtk-4.0/4.0.0/immodules/libim-ibus.so
 lib/libibus-1.0.so
@@ -317,39 +316,30 @@ share/dbus-1/services/org.freedesktop.portal.IBus.service
 %%DATADIR%%/setup/emojilang.py
 %%DATADIR%%/setup/emojilang.pyc
 %%DATADIR%%/setup/emojilang.pyo
-%%DATADIR%%/setup/__pycache__/emojilang%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/engineabout.py
 %%DATADIR%%/setup/engineabout.pyc
 %%DATADIR%%/setup/engineabout.pyo
-%%DATADIR%%/setup/__pycache__/engineabout%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/enginecombobox.py
 %%DATADIR%%/setup/enginecombobox.pyc
 %%DATADIR%%/setup/enginecombobox.pyo
-%%DATADIR%%/setup/__pycache__/enginecombobox%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/enginedialog.py
 %%DATADIR%%/setup/enginedialog.pyc
 %%DATADIR%%/setup/enginedialog.pyo
-%%DATADIR%%/setup/__pycache__/enginedialog%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/enginetreeview.py
 %%DATADIR%%/setup/enginetreeview.pyc
 %%DATADIR%%/setup/enginetreeview.pyo
-%%DATADIR%%/setup/__pycache__/enginetreeview%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/i18n.py
 %%DATADIR%%/setup/i18n.pyc
 %%DATADIR%%/setup/i18n.pyo
-%%DATADIR%%/setup/__pycache__/i18n%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/icon.py
 %%DATADIR%%/setup/icon.pyc
 %%DATADIR%%/setup/icon.pyo
-%%DATADIR%%/setup/__pycache__/icon%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/keyboardshortcut.py
 %%DATADIR%%/setup/keyboardshortcut.pyc
 %%DATADIR%%/setup/keyboardshortcut.pyo
-%%DATADIR%%/setup/__pycache__/keyboardshortcut%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/main.py
 %%DATADIR%%/setup/main.pyc
 %%DATADIR%%/setup/main.pyo
-%%DATADIR%%/setup/__pycache__/main%%PYTHON_TAG%%.opt-2.pyc
 %%DATADIR%%/setup/setup.ui
 %%NLS%%share/gettext/its/ibus.its
 %%NLS%%share/gettext/its/ibus.loc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.