0003-cmake-search-for-python-interpreter.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 6bb112e585f2ffd10e5af70ca28159dd235d063b Mon Sep 17 00:00:00 2001
  2. From: wsnipex <wsnipex@a1.net>
  3. Date: Thu, 19 Aug 2021 08:50:05 +0200
  4. Subject: [PATCH] [cmake] search for python interpreter fixes installing
  5. eventclients on linux
  6. Backport of https://github.com/xbmc/xbmc/pull/20058
  7. Patch sent upstream: https://github.com/xbmc/xbmc/pull/20989
  8. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  9. ---
  10. cmake/modules/FindPython.cmake | 5 +++++
  11. 1 file changed, 5 insertions(+)
  12. diff --git a/cmake/modules/FindPython.cmake b/cmake/modules/FindPython.cmake
  13. index 35220b5426..c469ed9fb6 100644
  14. --- a/cmake/modules/FindPython.cmake
  15. +++ b/cmake/modules/FindPython.cmake
  16. @@ -20,6 +20,7 @@
  17. #
  18. # PYTHON_FOUND - system has PYTHON
  19. # PYTHON_VERSION - Python version number (Major.Minor)
  20. +# PYTHON_EXECUTABLE - Python interpreter binary
  21. # PYTHON_INCLUDE_DIRS - the python include directory
  22. # PYTHON_LIBRARIES - The python libraries
  23. # PYTHON_LDFLAGS - Python provided link options
  24. @@ -51,6 +52,9 @@ if(PYTHON_VER)
  25. endif()
  26. find_package(Python3 ${VERSION} ${EXACT_VER} COMPONENTS Development)
  27. +if(CORE_SYSTEM_NAME STREQUAL linux)
  28. + find_package(Python3 ${VERSION} ${EXACT_VER} COMPONENTS Interpreter)
  29. +endif()
  30. if(KODI_DEPENDSBUILD)
  31. find_library(FFI_LIBRARY ffi REQUIRED)
  32. @@ -73,6 +77,7 @@ if(Python3_FOUND)
  33. list(APPEND PYTHON_DEFINITIONS -DHAS_PYTHON=1)
  34. # These are all set for easy integration with the rest of our build system
  35. set(PYTHON_FOUND ${Python3_FOUND})
  36. + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Python interpreter" FORCE)
  37. set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
  38. set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
  39. set(PYTHON_VERSION "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" CACHE INTERNAL "" FORCE)
  40. --
  41. 2.30.2