Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Mar 2011 05:37:35 -0800 (PST)
From:      "Jason E. Hale" <bsdkaffee@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        kde@FreeBSD.org
Subject:   ports/155435: [PATCH] devel/kdebindings4-python-pykdeuic4 leaves .pyo files after deinstall
Message-ID:  <4d78d41f.4969e50a.19a9.7cd8@mx.google.com>
Resent-Message-ID: <201103101340.p2ADeBdt066894@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         155435
>Category:       ports
>Synopsis:       [PATCH] devel/kdebindings4-python-pykdeuic4 leaves .pyo files after deinstall
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 10 13:40:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jason E. Hale
>Release:        FreeBSD 8.2-RELEASE i386
>Organization:
none 
>Environment:
System: FreeBSD mocha.verizon.net 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Tue Feb 22 19:19:42 EST 2011 root@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 ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4d78d41f.4969e50a.19a9.7cd8>