summaryrefslogtreecommitdiff
path: root/dev-python/python-systemd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-22 14:08:05 +0000
commit93a93e9a3b53c1a73142a305ea1f8136846942ee (patch)
treeb9791a06ab3284e27b568412c59316c66240c682 /dev-python/python-systemd
parent2771f79232c273bc2a57d23bf335dd81ccf6af28 (diff)
gentoo resync : 22.12.2021
Diffstat (limited to 'dev-python/python-systemd')
-rw-r--r--dev-python/python-systemd/Manifest2
-rw-r--r--dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch46
-rw-r--r--dev-python/python-systemd/python-systemd-234-r1.ebuild39
3 files changed, 87 insertions, 0 deletions
diff --git a/dev-python/python-systemd/Manifest b/dev-python/python-systemd/Manifest
index 32958e0d1a03..035252397e79 100644
--- a/dev-python/python-systemd/Manifest
+++ b/dev-python/python-systemd/Manifest
@@ -1,3 +1,5 @@
+AUX python-systemd-234-fix-py3.10.patch 1539 BLAKE2B c41b20fea9165c62620c2b7262ddb0e331d24c2e950bcd0cf78c92d5f5f79804a9f0eb4a52a7203d353a6be297118e3b951823a973f9a99a8211efb5a31be458 SHA512 92a4497733efa551d9c966f39ba31bc9d3443ece6591f4d664c3732f01f10c928c07de13e2b9e65725f30fa18da7a4a9ee172e0b627d98e1d991c19b7762e2ab
DIST python-systemd-234.tar.gz 53900 BLAKE2B 2658ee7083036ed8259e5f4ad0714ea15227ee836ad34c7fbbdb55dd9df48751b8d9998350d789b4f47e78fe7b4a7134e12d637e5a6ebeb29a0b31e5a4575d91 SHA512 164e34ba46827711e9c6ff9ed58b2706d9a22abfc7001de030ed7d463d8ddf783eb5fee93b207c29950a3c566018cc3f1a21a549421cf3e05c1287b433367eb2
+EBUILD python-systemd-234-r1.ebuild 879 BLAKE2B fae57f7a0911c96b3719709e805ab077b50398442e0e8b35b86ec485296a7cfcf4807237c3b8b7019a145b2fed40ca0542c7356ac4ab80e93df1466da49f2871 SHA512 15b164abef6ddf275b5d8e696dbe379d257aceb2f2d5da05ade527393a28894dc79e26d44952999387770dd680aa8987a42723a83e690789eed4e17dcb7528ac
EBUILD python-systemd-234.ebuild 894 BLAKE2B 809e9e3314b2eaa2ec4f849f9a1d6c106ac29d53c64d2b784362a6d9e50cf351c8e669e20b9e30c4320a5838461e8be8c287101512f3d62337d93c2e8aee0e6c SHA512 d3cab8c01b42501028d11cee51b97ff7ab5a73984ae7afb857f5e596c04f45024802ce1c14ad8f29a6912af6ec4fea65495f9fde3f3f707f11711b7856285dee
MISC metadata.xml 359 BLAKE2B 458599dbb5364bdf58f0cabf3fe07f03f79a4cdfb3f707ef6db328c453e606b587e13fa3349e0e0c899a7b1655e558ccae00e6a9ea22146b9e68099e0ac1a981 SHA512 73e524d826bb08d80fbe3e643be5f08e39620ddb343006752729ea41e594ad13eb6241c30da78a58f67e6e5e3c51f567a9e761af498f882f1e23ce0308bfd690
diff --git a/dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch b/dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch
new file mode 100644
index 000000000000..52045b4475e1
--- /dev/null
+++ b/dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch
@@ -0,0 +1,46 @@
+From c71bbac357f0ac722e1bcb2edfa925b68cca23c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Thu, 12 Nov 2020 16:55:56 +0100
+Subject: [PATCH] reader: make PY_SSIZE_T_CLEAN
+
+---
+ systemd/_reader.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/systemd/_reader.c b/systemd/_reader.c
+index 8de7f6a..3b6a4d0 100644
+--- a/systemd/_reader.c
++++ b/systemd/_reader.c
+@@ -18,7 +18,12 @@
+ along with python-systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#define PY_SSIZE_T_CLEAN
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wredundant-decls"
+ #include <Python.h>
++#pragma GCC diagnostic pop
++
+ #include <structmember.h>
+ #include <datetime.h>
+ #include <time.h>
+@@ -710,11 +715,17 @@ PyDoc_STRVAR(Reader_add_match__doc__,
+ "Match is a string of the form \"FIELD=value\".");
+ static PyObject* Reader_add_match(Reader *self, PyObject *args, PyObject *keywds) {
+ char *match;
+- int match_len, r;
++ Py_ssize_t match_len;
++ int r;
+ if (!PyArg_ParseTuple(args, "s#:add_match", &match, &match_len))
+ return NULL;
+
+- r = sd_journal_add_match(self->j, match, match_len);
++ if (match_len > INT_MAX) {
++ set_error(-ENOBUFS, NULL, NULL);
++ return NULL;
++ }
++
++ r = sd_journal_add_match(self->j, match, (int) match_len);
+ if (set_error(r, NULL, "Invalid match") < 0)
+ return NULL;
+
diff --git a/dev-python/python-systemd/python-systemd-234-r1.ebuild b/dev-python/python-systemd/python-systemd-234-r1.ebuild
new file mode 100644
index 000000000000..7c9442a28b16
--- /dev/null
+++ b/dev-python/python-systemd/python-systemd-234-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 2015-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_USE_SETUPTOOLS="no"
+
+inherit distutils-r1
+
+DESCRIPTION="Python module for native access to the systemd facilities"
+HOMEPAGE="https://github.com/systemd/python-systemd"
+SRC_URI="https://github.com/systemd/python-systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+
+DEPEND="sys-apps/systemd:0="
+RDEPEND="${DEPEND}
+ !sys-apps/systemd[python(-)]
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-py3.10.patch
+)
+
+distutils_enable_tests pytest
+
+python_compile() {
+ # https://bugs.gentoo.org/690316
+ distutils-r1_python_compile -j1
+}
+
+python_test() {
+ pushd "${BUILD_DIR}/lib" > /dev/null || die
+ epytest -o cache_dir="${T}"
+ popd > /dev/null || die
+}