summarylogtreecommitdiffstats
path: root/000-python3.8.patch
blob: e26dd3decd9f9f223cae46460a0275343f098bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Upstream bug report, https://github.com/xbmc/xbmc/issues/16560
Patch by asavah, https://forum.kodi.tv/showthread.php?tid=349548

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2fb6bf5bed..52be5b649d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,7 +163,7 @@ find_package(JsonSchemaBuilder REQUIRED)
 core_optional_dep(${optional_deps})
 core_require_dep(${required_deps})

-SET(PYTHON_VERSION 3.7)
+SET(PYTHON_VERSION 3.8)

 if(ENABLE_MARIADBCLIENT AND NOT ENABLE_MARIADBCLIENT STREQUAL AUTO AND ENABLE_MYSQLCLIENT AND NOT ENABLE_MYSQLCLIENT STREQUAL AUTO)
   MESSAGE(FATAL_ERROR "You can not use MySql and MariaDB at the same time. Disable one by adding -DENABLE_MYSQLCLIENT=OFF or -DENABLE_MARIADBCLIENT=OFF.")
diff --git a/xbmc/interfaces/python/PythonInvoker.cpp b/xbmc/interfaces/python/PythonInvoker.cpp
index 4342e05dcd..660e82c254 100644
--- a/xbmc/interfaces/python/PythonInvoker.cpp
+++ b/xbmc/interfaces/python/PythonInvoker.cpp
@@ -8,6 +8,14 @@

 // python.h should always be included first before any other includes
 #include <Python.h>
+#if PY_VERSION_HEX >= 0x03080000
+# define Py_BUILD_CORE
+# undef HAVE_STD_ATOMIC
+/* for access to the fields of PyInterpreterState */
+#  include "internal/pycore_pystate.h"
+# undef Py_BUILD_CORE
+# define HAVE_STD_ATOMIC
+#endif
 #include <iterator>
 #include <osdefs.h>