diff options
author | Andreas K. Hüttel <dilfridge@gentoo.org> | 2011-06-21 20:36:38 +0000 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2011-06-21 20:36:38 +0000 |
commit | 82f883eb24497c33036afaec5cb514705cadbb6a (patch) | |
tree | 45e6a7daf1a8a2fd33b7ce583d6e29699dbd32a4 /kde-base/kdelibs/files/kdelibs-4.6.3-bytecode.patch | |
parent | Version bump (diff) | |
download | gentoo-2-82f883eb24497c33036afaec5cb514705cadbb6a.tar.gz gentoo-2-82f883eb24497c33036afaec5cb514705cadbb6a.tar.bz2 gentoo-2-82f883eb24497c33036afaec5cb514705cadbb6a.zip |
Respect PYTHONDONTWRITEBYTECODE environmental variable in PYTHON_INSTALL macro, bug 372407
(Portage version: 2.1.10.3/cvs/Linux x86_64)
Diffstat (limited to 'kde-base/kdelibs/files/kdelibs-4.6.3-bytecode.patch')
-rw-r--r-- | kde-base/kdelibs/files/kdelibs-4.6.3-bytecode.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/kde-base/kdelibs/files/kdelibs-4.6.3-bytecode.patch b/kde-base/kdelibs/files/kdelibs-4.6.3-bytecode.patch new file mode 100644 index 000000000000..736e2ae782b7 --- /dev/null +++ b/kde-base/kdelibs/files/kdelibs-4.6.3-bytecode.patch @@ -0,0 +1,81 @@ +diff -ruN kdelibs-4.6.3.orig/cmake/modules/PythonMacros.cmake kdelibs-4.6.3/cmake/modules/PythonMacros.cmake +--- kdelibs-4.6.3.orig/cmake/modules/PythonMacros.cmake 2011-04-01 15:55:50.000000000 +0200 ++++ kdelibs-4.6.3/cmake/modules/PythonMacros.cmake 2011-06-21 22:30:18.957765437 +0200 +@@ -23,40 +23,42 @@ + # Install the source file. + INSTALL(FILES ${SOURCE_FILE} DESTINATION ${DESINATION_DIR}) + +- # Byte compile and install the .pyc file. +- GET_FILENAME_COMPONENT(_absfilename ${SOURCE_FILE} ABSOLUTE) +- GET_FILENAME_COMPONENT(_filename ${SOURCE_FILE} NAME) +- GET_FILENAME_COMPONENT(_filenamebase ${SOURCE_FILE} NAME_WE) +- GET_FILENAME_COMPONENT(_basepath ${SOURCE_FILE} PATH) +- +- if(WIN32) +- string(REGEX REPLACE ".:/" "/" _basepath "${_basepath}") +- endif(WIN32) +- +- SET(_bin_py ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filename}) +- SET(_bin_pyc ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filenamebase}.pyc) +- +- FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}) +- +- SET(_message "-DMESSAGE=Byte-compiling ${_bin_py}") +- +- GET_FILENAME_COMPONENT(_abs_bin_py ${_bin_py} ABSOLUTE) +- IF(_abs_bin_py STREQUAL ${_absfilename}) # Don't copy the file onto itself. +- ADD_CUSTOM_COMMAND( +- TARGET compile_python_files +- COMMAND ${CMAKE_COMMAND} -E echo ${message} +- COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py} +- DEPENDS ${_absfilename} +- ) +- ELSE(_abs_bin_py STREQUAL ${_absfilename}) +- ADD_CUSTOM_COMMAND( +- TARGET compile_python_files +- COMMAND ${CMAKE_COMMAND} -E echo ${message} +- COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py} +- COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py} +- DEPENDS ${_absfilename} +- ) +- ENDIF(_abs_bin_py STREQUAL ${_absfilename}) ++ # Byte compile and install the .pyc file. ++ IF("$ENV{PYTHONDONTWRITEBYTECODE}" STREQUAL "") ++ GET_FILENAME_COMPONENT(_absfilename ${SOURCE_FILE} ABSOLUTE) ++ GET_FILENAME_COMPONENT(_filename ${SOURCE_FILE} NAME) ++ GET_FILENAME_COMPONENT(_filenamebase ${SOURCE_FILE} NAME_WE) ++ GET_FILENAME_COMPONENT(_basepath ${SOURCE_FILE} PATH) ++ ++ if(WIN32) ++ string(REGEX REPLACE ".:/" "/" _basepath "${_basepath}") ++ endif(WIN32) ++ ++ SET(_bin_py ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filename}) ++ SET(_bin_pyc ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filenamebase}.pyc) ++ ++ FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}) ++ ++ SET(_message "-DMESSAGE=Byte-compiling ${_bin_py}") ++ ++ GET_FILENAME_COMPONENT(_abs_bin_py ${_bin_py} ABSOLUTE) ++ IF(_abs_bin_py STREQUAL ${_absfilename}) # Don't copy the file onto itself. ++ ADD_CUSTOM_COMMAND( ++ TARGET compile_python_files ++ COMMAND ${CMAKE_COMMAND} -E echo ${message} ++ COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py} ++ DEPENDS ${_absfilename} ++ ) ++ ELSE(_abs_bin_py STREQUAL ${_absfilename}) ++ ADD_CUSTOM_COMMAND( ++ TARGET compile_python_files ++ COMMAND ${CMAKE_COMMAND} -E echo ${message} ++ COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py} ++ COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py} ++ DEPENDS ${_absfilename} ++ ) ++ ENDIF(_abs_bin_py STREQUAL ${_absfilename}) + +- INSTALL(FILES ${_bin_pyc} DESTINATION ${DESINATION_DIR}) ++ INSTALL(FILES ${_bin_pyc} DESTINATION ${DESINATION_DIR}) ++ ENDIF("$ENV{PYTHONDONTWRITEBYTECODE}" STREQUAL "") + ENDMACRO(PYTHON_INSTALL) |