[kde-freebsd] [PATCH] devel/kdebindings4-python-pykdeuic4 leaves .pyo files after deinstall
Jason E. Hale
bsdkaffee at gmail.com
Thu Mar 10 14:37:35 CET 2011
>Submitter-Id: current-users
>Originator: Jason E. Hale
>Organization: none
>Confidential: no
>Synopsis: [PATCH] devel/kdebindings4-python-pykdeuic4 leaves .pyo files after deinstall
>Severity: non-critical
>Priority: low
>Category: ports
>Class: change-request
>Release: FreeBSD 8.2-RELEASE i386
>Environment:
System: FreeBSD mocha.verizon.net 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Tue Feb 22 19:19:42 EST 2011 root at mocha.verizon.net:/usr/obj/usr/src/sys/MOCHA8 i386
>Description:
devel/kdebindings4-python-pykdeuic4 leaves Python ".pyo" files upon deinstall.
It uses the PYTHON_INSTALL macro defined by the PythonMacros.cmake module
installed by x11/kdelibs4 to install the .py and .pyc files but not the .pyo
files.
The .pyo files are generated when the Python module is used.
I have made a patch for PythonMacros.cmake to install the .pyo files and
added the .pyo files to the pkg-plist.
Patch should apply cleanly to the 4.5.5 ports and the 4.6.1 ports.
>How-To-Repeat:
Use attached diff.
>Fix:
--- 2011-03-10-kdelibs.diff begins here ---
diff -ruN kdelibs4.orig/files/patch-cmake_modules_PythonMacros.cmake kdelibs4/files/patch-cmake_modules_PythonMacros.cmake
--- kdelibs4.orig/files/patch-cmake_modules_PythonMacros.cmake 1969-12-31 19:00:00.000000000 -0500
+++ kdelibs4/files/patch-cmake_modules_PythonMacros.cmake 2011-03-10 07:47:25.000000000 -0500
@@ -0,0 +1,30 @@
+--- ./cmake/modules/PythonMacros.cmake.orig 2011-03-10 07:44:37.000000000 -0500
++++ ./cmake/modules/PythonMacros.cmake 2011-03-10 07:46:14.000000000 -0500
+@@ -35,6 +35,7 @@
+
+ SET(_bin_py ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filename})
+ SET(_bin_pyc ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filenamebase}.pyc)
++ SET(_bin_pyo ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filenamebase}.pyo)
+
+ FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath})
+
+@@ -46,6 +47,7 @@
+ TARGET compile_python_files
+ COMMAND ${CMAKE_COMMAND} -E echo ${message}
+ COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py}
++ COMMAND ${PYTHON_EXECUTABLE} -O ${_python_compile_py} ${_bin_py}
+ DEPENDS ${_absfilename}
+ )
+ ELSE(_abs_bin_py STREQUAL ${_absfilename})
+@@ -54,9 +56,10 @@
+ COMMAND ${CMAKE_COMMAND} -E echo ${message}
+ COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py}
+ COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py}
++ COMMAND ${PYTHON_EXECUTABLE} -O ${_python_compile_py} ${_bin_py}
+ DEPENDS ${_absfilename}
+ )
+ ENDIF(_abs_bin_py STREQUAL ${_absfilename})
+
+- INSTALL(FILES ${_bin_pyc} DESTINATION ${DESINATION_DIR})
++ INSTALL(FILES ${_bin_pyc} ${_bin_pyo} DESTINATION ${DESINATION_DIR})
+ ENDMACRO(PYTHON_INSTALL)
--- 2011-03-10-kdelibs.diff ends here ---
--- 2011-03-10-kdebindings4-python-pykdeuic4.diff begins here ---
diff -ruN kdebindings4-python-pykdeuic4.orig/pkg-plist kdebindings4-python-pykdeuic4/pkg-plist
--- kdebindings4-python-pykdeuic4.orig/pkg-plist 2011-03-10 07:36:47.000000000 -0500
+++ kdebindings4-python-pykdeuic4/pkg-plist 2011-03-10 07:37:47.000000000 -0500
@@ -1,8 +1,10 @@
bin/pykdeuic4
%%PYTHON_SITELIBDIR%%/PyQt4/uic/pykdeuic4.py
%%PYTHON_SITELIBDIR%%/PyQt4/uic/pykdeuic4.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/pykdeuic4.pyo
%%PYTHON_SITELIBDIR%%/PyQt4/uic/widget-plugins/kde4.py
%%PYTHON_SITELIBDIR%%/PyQt4/uic/widget-plugins/kde4.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/widget-plugins/kde4.pyo
@dirrmtry %%PYTHON_SITELIBDIR%%/PyQt4/uic/widget-plugins
@dirrmtry %%PYTHON_SITELIBDIR%%/PyQt4/uic
@dirrmtry %%PYTHON_SITELIBDIR%%/PyQt4
--- 2011-03-10-kdebindings4-python-pykdeuic4.diff ends here ---
More information about the kde-freebsd
mailing list