From: Jan Palus Date: Thu, 8 Apr 2021 22:08:25 +0000 (+0200) Subject: fix build with python 3.9 X-Git-Tag: auto/th/domoticz-2021.1-1~5 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fdomoticz.git;a=commitdiff_plain;h=2fd2c1d fix build with python 3.9 --- 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 + #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)