summarylogtreecommitdiffstats
path: root/pycompile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pycompile.patch')
-rw-r--r--pycompile.patch13
1 files changed, 13 insertions, 0 deletions
diff --git a/pycompile.patch b/pycompile.patch
new file mode 100644
index 000000000000..464ff91db984
--- /dev/null
+++ b/pycompile.patch
@@ -0,0 +1,13 @@
+diff --git a/config/cmake_files/medMacros.cmake b/config/cmake_files/medMacros.cmake
+index 7c82cec..f6ca6d0 100644
+--- a/config/cmake_files/medMacros.cmake
++++ b/config/cmake_files/medMacros.cmake
+@@ -457,7 +457,7 @@ MACRO(INSTALL_AND_COMPILE_PYTHON_FILE PYFILE2COMPINST PYFILELOC)
+ GET_FILENAME_COMPONENT(inputname ${input} NAME)
+ INSTALL(FILES ${input} DESTINATION ${CMAKE_INSTALL_PREFIX}/${PYFILELOC})
+ INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${PYFILELOC}/${inputname}\")")
+- INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${PYFILELOC}/${inputname}')\")")
++ INSTALL(CODE "SET(CMD \"import py_compile, os ; py_compile.compile(os.environ.get('DESTDIR', '') + '/' + '${CMAKE_INSTALL_PREFIX}/${PYFILELOC}/${inputname}', dfile='${CMAKE_INSTALL_PREFIX}/${PYFILELOC}/${inputname}')\")")
+ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\")")
+ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\")")
+ ENDFOREACH(input ${PYFILE2COMPINST})