[packages/collectd] fix build with python >= 3.11

atler atler at pld-linux.org
Mon Jul 28 21:15:39 CEST 2025


commit 21f86896a2cf0e7c8df01000576d8d8ced948af0
Author: Jan Palus <atler at pld-linux.org>
Date:   Mon Jul 28 21:12:16 2025 +0200

    fix build with python >= 3.11

 collectd.spec    |  2 ++
 python3.11.patch | 15 +++++++++++++++
 2 files changed, 17 insertions(+)
---
diff --git a/collectd.spec b/collectd.spec
index 43f90da..5c11612 100644
--- a/collectd.spec
+++ b/collectd.spec
@@ -206,6 +206,7 @@ Patch1:		glibc-2.36.patch
 Patch2:		noquote.patch
 Patch3:		libgcrypt1.11.patch
 Patch4:		types.patch
+Patch5:		python3.11.patch
 URL:		http://collectd.org/
 %{?with_ipmi:BuildRequires:	OpenIPMI-devel >= 2.0.14-3}
 BuildRequires:	autoconf
@@ -1379,6 +1380,7 @@ Perl files from Collectd package
 %patch -P2 -p1
 %patch -P3 -p1
 %patch -P4 -p1
+%patch -P5 -p1
 
 %build
 %{__libtoolize} --ltdl
diff --git a/python3.11.patch b/python3.11.patch
new file mode 100644
index 0000000..b4b5fa9
--- /dev/null
+++ b/python3.11.patch
@@ -0,0 +1,15 @@
+--- collectd-5.9.2/src/cpython.h.orig	2019-10-01 14:00:47.000000000 +0200
++++ collectd-5.9.2/src/cpython.h	2025-07-28 20:57:28.280313794 +0200
+@@ -26,7 +26,12 @@
+ 
+ /* Some python versions don't include this by default. */
+ 
++#include <Python.h>
++#if defined(PY_MAJOR_VERSION) && PY_MAJOR_VERSION > 3 || defined(PY_MAJOR_VERSION) && PY_MAJOR_VERSION == 3 && defined(PY_MINOR_VERSION) && PY_MINOR_VERSION >= 11
++#include <cpython/longintrepr.h>
++#else
+ #include <longintrepr.h>
++#endif
+ 
+ /* These two macros are basically Py_BEGIN_ALLOW_THREADS and
+  * Py_BEGIN_ALLOW_THREADS
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/collectd.git/commitdiff/a0e6f3280db71ed3444f83e8ed2c2e1d82c4d84b



More information about the pld-cvs-commit mailing list