commit 2fd2c1d45a7a0e0ad3a49b59014f1303200c5799
Author: Jan Palus <[email protected]>
Date:   Fri Apr 9 00:08:25 2021 +0200

    fix build with python 3.9

 domoticz.spec   |  2 ++
 python3.9.patch | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
---
diff --git a/domoticz.spec b/domoticz.spec
index e1bb9ca..1c5e366 100644
--- a/domoticz.spec
+++ b/domoticz.spec
@@ -18,6 +18,7 @@ Patch2:               %{name}-python.patch
 Patch3:                no-git.patch
 Patch4:                boost-1.73.patch
 Patch5:                %{name}-gpio.patch
+Patch6:                python3.9.patch
 BuildRequires: boost-devel >= 1.66.0
 BuildRequires: cereal-devel
 BuildRequires: cmake >= 3.16.0
@@ -61,6 +62,7 @@ and much more. Notifications/Alerts can be sent to any mobile 
device
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 APPVERSION="%{version}"
 echo "#define APPVERSION ${APPVERSION##*.}" > appversion.h
diff --git a/python3.9.patch b/python3.9.patch
new file mode 100644
index 0000000..ad13e03
--- /dev/null
+++ b/python3.9.patch
@@ -0,0 +1,34 @@
+Index: domoticz-2020.2/hardware/plugins/DelayedLink.h
+===================================================================
+--- domoticz-2020.2.orig/hardware/plugins/DelayedLink.h
++++ domoticz-2020.2/hardware/plugins/DelayedLink.h
+@@ -14,6 +14,16 @@
+ #include <frameobject.h>
+ #include "../../main/Helper.h"
+ 
++#ifndef _Py_DEC_REFTOTAL
++  /* _Py_DEC_REFTOTAL macro has been removed from Python 3.9 by:
++    
https://github.com/python/cpython/commit/49932fec62c616ec88da52642339d83ae719e924
 */
++#  ifdef Py_REF_DEBUG
++#    define _Py_DEC_REFTOTAL _Py_RefTotal--
++#  else
++#    define _Py_DEC_REFTOTAL
++#  endif
++#endif
++
+ #if PY_VERSION_HEX >= 0x030800f0
+ static inline void
+ py3__Py_DECREF(const char *filename, int lineno, PyObject *op)
+Index: domoticz-2020.2/CMakeLists.txt
+===================================================================
+--- domoticz-2020.2.orig/CMakeLists.txt
++++ domoticz-2020.2/CMakeLists.txt
+@@ -744,7 +744,7 @@ else()
+   message(STATUS "Not found telldus-core (telldus-core.h), not adding 
tellstick support")
+ endif (TELLDUSCORE_INCLUDE)
+ 
+-target_link_libraries(domoticz ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} 
${MINIZIP_LIBRARIES} ${CURL_LIBRARIES} pthread ${MQTT_LIBRARIES} 
${LUA_LIBRARIES} ${CMAKE_DL_LIBS} ${TELLDUS_LIBRARIES})
++target_link_libraries(domoticz ${Boost_LIBRARIES} ${ZLIB_LIBRARIES} 
${MINIZIP_LIBRARIES} ${CURL_LIBRARIES} pthread ${PYTHON_LIBRARIES} 
${MQTT_LIBRARIES} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS} ${TELLDUS_LIBRARIES})
+ 
+ IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+   target_link_libraries(domoticz -lresolv)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/domoticz.git/commitdiff/e9c32406e214bcb0cc4d1bdb36febd7690105e64

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to