diff --git a/gnu/local.mk b/gnu/local.mk index e2498d58f0b..68f40a609e1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1121,7 +1121,8 @@ dist_patch_DATA = \ %D%/packages/patches/coda-use-system-libs.patch \ %D%/packages/patches/cogl-fix-double-free.patch \ %D%/packages/patches/collada-dom-boost.patch \ - %D%/packages/patches/collectd-5.11.0-noinstallvar.patch \ + %D%/packages/patches/collectd-5.11.0-noinstallvar.patch \ + %D%/packages/patches/collectd-5.11.0-python-3.11.patch \ %D%/packages/patches/combinatorial-blas-awpm.patch \ %D%/packages/patches/combinatorial-blas-io-fix.patch \ %D%/packages/patches/compsize-fix-btrfs-progs-compatibility.patch \ diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm index 37000f8b68b..c496c8fc0d2 100644 --- a/gnu/packages/monitoring.scm +++ b/gnu/packages/monitoring.scm @@ -55,6 +55,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages databases) #:use-module (gnu packages django) + #:use-module (gnu packages freedesktop) ; libatasmart #:use-module (gnu packages gd) #:use-module (gnu packages gettext) #:use-module (gnu packages gnome) ;libnotify @@ -68,6 +69,7 @@ #:use-module (gnu packages ncurses) #:use-module (gnu packages networking) #:use-module (gnu packages libevent) + #:use-module (gnu packages linux) ; eudev, lm-sensors #:use-module (gnu packages pcre) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -822,20 +824,39 @@ devices.") (sha256 (base32 "1mh97afgq6qgmpvpr84zngh58m0sl1b4wimqgvvk376188q09bjv")) - (patches (search-patches "collectd-5.11.0-noinstallvar.patch")))) + (patches (search-patches "collectd-5.11.0-noinstallvar.patch" + "collectd-5.11.0-python-3.11.patch")))) (build-system gnu-build-system) (arguments - `(#:configure-flags (list "--localstatedir=/var" "--sysconfdir=/etc" - "CFLAGS=-Wno-error=deprecated-declarations") + `(#:configure-flags + (list + "--enable-python" + "--enable-sensors" + "--enable-smart" + "--localstatedir=/var" + "--sysconfdir=/etc" + "CFLAGS=-Wno-error=deprecated-declarations") #:phases (modify-phases %standard-phases (add-before 'configure 'autoreconf (lambda _ ;; Required because of patched sources. (invoke "autoreconf" "-vfi")))))) (inputs - (list rrdtool curl yajl zlib)) + (list + curl + rrdtool + yajl + zlib)) (native-inputs - (list autoconf automake libtool pkg-config)) + (list + autoconf + automake + eudev + libatasmart + libtool + `(,lm-sensors "lib") + pkg-config + python-3)) (home-page "https://collectd.org/") (synopsis "Collect system and application performance metrics periodically") (description diff --git a/gnu/packages/patches/collectd-5.11.0-python-3.11.patch b/gnu/packages/patches/collectd-5.11.0-python-3.11.patch new file mode 100644 index 00000000000..99f07e5b866 --- /dev/null +++ b/gnu/packages/patches/collectd-5.11.0-python-3.11.patch @@ -0,0 +1,30 @@ +commit 623e95394e0e62e7f9ced2104b786d21e9c0bf53 +Author: Đoàn Trần Công Danh +Date: Wed Sep 21 22:21:58 2022 +0700 + + cpython: fix build with Python 3.11 + + Python 3.11 moves longintrepr.h into cpython sub-directory. + However, in this version, longintrepr.h is always included. + +diff --git a/src/cpython.h b/src/cpython.h +index 11e64fa6..bcfa406f 100644 +--- a/src/cpython.h ++++ b/src/cpython.h +@@ -24,9 +24,15 @@ + * Sven Trenkel + **/ + ++#include + /* Some python versions don't include this by default. */ +- ++#if PY_VERSION_HEX < 0x030B0000 ++/* ++ * Python 3.11 move longintrepr.h to cpython/longintrepr.h ++ * And it's always included ++ */ + #include ++#endif /* PY_VERSION_HEX < 0x030B0000 */ + + /* These two macros are basically Py_BEGIN_ALLOW_THREADS and + * Py_BEGIN_ALLOW_THREADS