From 7c7693548ab658b3f34fab56cf165c83f61fcea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 23 Oct 2023 23:46:05 +0200 Subject: [PATCH] Fix build with Python 3.13.0a1 --- python-psutil-include-unistd.h.patch | 12 ++++++++++++ python-psutil.spec | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 python-psutil-include-unistd.h.patch diff --git a/python-psutil-include-unistd.h.patch b/python-psutil-include-unistd.h.patch new file mode 100644 index 0000000..5719977 --- /dev/null +++ b/python-psutil-include-unistd.h.patch @@ -0,0 +1,12 @@ +diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c +index a6ee602..56fd4f6 100644 +--- a/psutil/_psutil_linux.c ++++ b/psutil/_psutil_linux.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + // see: https://github.com/giampaolo/psutil/issues/659 + #ifdef PSUTIL_ETHTOOL_MISSING_TYPES diff --git a/python-psutil.spec b/python-psutil.spec index dca0659..008746b 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -17,6 +17,13 @@ Patch0: python-psutil-skip-tests-in-mock.patch # avoid: AssertionError: 7883822.420000001 != 7883822.42 # Patch1: python-psutil-test-sum-floats-via-almost-equal.patch +# +# include unistd.h to avoid (on Python 3.13+): +# error: implicit declaration of function ‘syscall’ +# error: implicit declaration of function ‘close’ +# upstream PR: https://github.com/giampaolo/psutil/pull/2321 +# +Patch2: python-psutil-include-unistd.h.patch BuildRequires: gcc BuildRequires: grep