Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135129310
D34739.id104480.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D34739.id104480.diff
View Options
Index: devel/py-qt5-pyqt/Makefile
===================================================================
--- devel/py-qt5-pyqt/Makefile
+++ devel/py-qt5-pyqt/Makefile
@@ -28,12 +28,6 @@
${RM} -r ${WRKSRC}/pyuic/uic/port_v2
post-install:
- ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR}/PyQt5 \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/PyQt5
- ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR}/PyQt5 \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/PyQt5
@${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/PyQt5 \
-name '*.so*' -exec ${STRIP_CMD} {} +
Index: devel/py-sip4/Makefile
===================================================================
--- devel/py-sip4/Makefile
+++ devel/py-sip4/Makefile
@@ -54,12 +54,6 @@
post-install:
${MKDIR} ${STAGEDIR}${DOCSDIR} && cd ${WRKSRC}/doc/html && \
${COPYTREE_SHARE} \. ${STAGEDIR}${DOCSDIR}
- ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR} \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
- ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR} \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
${STRIP_CMD} ${STAGEDIR}/${PREFIX}/bin/sip
${STRIP_CMD} ${STAGEDIR}/${PYTHON_SITELIBDIR}/sip.so
Index: devel/pyside2/Makefile
===================================================================
--- devel/pyside2/Makefile
+++ devel/pyside2/Makefile
@@ -50,12 +50,4 @@
CMAKE_ARGS+= -DDISABLE_QtWebEngine:BOOL=TRUE
.endif
-post-install:
- ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR} \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
- ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR} \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
-
.include <bsd.port.mk>
Index: devel/shiboken2/Makefile
===================================================================
--- devel/shiboken2/Makefile
+++ devel/shiboken2/Makefile
@@ -45,12 +45,4 @@
WRKSRC= ${WRKDIR}/pyside-setup-opensource-src-${DISTVERSION:C/^([0-9].[0-9]+.[0-9])(.[0-9])?/\1/}/sources/shiboken2
-post-install:
- ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR} \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
- ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
- -f -d ${PYTHONPREFIX_SITELIBDIR} \
- ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
-
.include <bsd.port.post.mk>
Index: lang/Makefile
===================================================================
--- lang/Makefile
+++ lang/Makefile
@@ -275,6 +275,7 @@
SUBDIR += python-doc-pdf-letter
SUBDIR += python-doc-text
SUBDIR += python-mode.el
+ SUBDIR += python-pycache
SUBDIR += python-tools
SUBDIR += python2
SUBDIR += python27
Index: lang/python-pycache/Makefile
===================================================================
--- /dev/null
+++ lang/python-pycache/Makefile
@@ -0,0 +1,11 @@
+PORTNAME= python-pycache
+PORTVERSION= 0.0.1
+CATEGORIES= lang
+
+MAINTAINER= portmgr@FreeBSD.org
+COMMENT= Trigger to recreate python precompiled bytecode
+
+USES= trigger metaport
+TRIGGERS= python-update-cache
+
+.include <bsd.port.mk>
Index: lang/python-pycache/files/python-update-cache.ucl.in
===================================================================
--- /dev/null
+++ lang/python-pycache/files/python-update-cache.ucl.in
@@ -0,0 +1,38 @@
+path_glob: "%%PREFIX%%/lib/python*/site-packages/*"
+cleanup: {
+ type: lua
+ sandbox: false
+ script: <<EOS
+print("TRG: Removing %%PREFIX%%/lib/python*/site-packages")
+EOS
+}
+trigger: {
+ type: lua
+ sandbox: false
+ script: <<EOS
+local hash = {}
+print("Running __pycache__ trigger")
+for _,path in ipairs(arg) do
+ path = string.match(path, ".*/site.packages/[^/]*")
+ if path then
+ local python_sitepackages = string.match(path, ".*/site.packages")
+ if (not hash[path]) and pkg.stat(path) then
+ local python_version = string.match(path, "python3.%d")
+ local egg = string.find(path, ".*egg.info")
+ if (not egg) and python_version then
+ local python_binary = "%%PREFIX%%/bin/" .. python_version
+ if pkg.stat(python_binary) then
+ print(" * Recreating cache for " .. path)
+ pkg.exec({python_binary, "-m", "compileall", "-d", python_sitepackages, path})
+ pkg.exec({python_binary, "-O", "-m", "compileall", "-d", python_sitepackages, path})
+
+ hash[path] = true
+ else
+ print("ERROR " .. python_binary .. " does not exist!")
+ end
+ end
+ end
+ end
+end
+EOS
+}
Index: lang/python-pycache/pkg-descr
===================================================================
--- /dev/null
+++ lang/python-pycache/pkg-descr
@@ -0,0 +1 @@
+Recreates pycache on pkg registration.
Index: lang/python310/Makefile
===================================================================
--- lang/python310/Makefile
+++ lang/python310/Makefile
@@ -14,6 +14,7 @@
LICENSE= PSFL
LIB_DEPENDS= libffi.so:devel/libffi
+RUN_DEPENDS= python-pycache>=0:lang/python-pycache
USES= compiler:c11 cpe ncurses pathfix pkgconfig readline \
shebangfix ssl tar:xz
Index: lang/python311/Makefile
===================================================================
--- lang/python311/Makefile
+++ lang/python311/Makefile
@@ -15,6 +15,7 @@
LICENSE= PSFL
LIB_DEPENDS= libffi.so:devel/libffi
+RUN_DEPENDS= python-pycache>=0:lang/python-pycache
USES= compiler:c11 cpe ncurses pathfix pkgconfig readline \
shebangfix ssl tar:xz
Index: lang/python37/Makefile
===================================================================
--- lang/python37/Makefile
+++ lang/python37/Makefile
@@ -15,6 +15,7 @@
LIB_DEPENDS= libffi.so:devel/libffi \
libmpdec.so:math/mpdecimal
+RUN_DEPENDS= python-pycache>=0:lang/python-pycache
USES= cpe ncurses pathfix pkgconfig readline shebangfix ssl tar:xz
PATHFIX_MAKEFILEIN= Makefile.pre.in
Index: lang/python38/Makefile
===================================================================
--- lang/python38/Makefile
+++ lang/python38/Makefile
@@ -14,6 +14,7 @@
LICENSE= PSFL
LIB_DEPENDS= libffi.so:devel/libffi
+RUN_DEPENDS= python-pycache>=0:lang/python-pycache
USES= cpe ncurses pathfix pkgconfig readline shebangfix ssl tar:xz
PATHFIX_MAKEFILEIN= Makefile.pre.in
Index: lang/python39/Makefile
===================================================================
--- lang/python39/Makefile
+++ lang/python39/Makefile
@@ -14,6 +14,7 @@
LICENSE= PSFL
LIB_DEPENDS= libffi.so:devel/libffi
+RUN_DEPENDS= python-pycache>=0:lang/python-pycache
USES= compiler:c11 cpe ncurses pathfix pkgconfig readline \
shebangfix ssl tar:xz
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 7, 6:08 PM (13 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24964844
Default Alt Text
D34739.id104480.diff (6 KB)
Attached To
Mode
D34739: lang/python: add bytecode trigger
Attached
Detach File
Event Timeline
Log In to Comment