From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CD1AE158086 for ; Fri, 17 Dec 2021 17:58:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 09C5E2BC01B; Fri, 17 Dec 2021 17:58:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 841502BC014 for ; Fri, 17 Dec 2021 17:58:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5CD5E343990 for ; Fri, 17 Dec 2021 17:58:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E9F9614D for ; Fri, 17 Dec 2021 17:58:37 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1639763912.9d7601b1e4f7e1916f12a3eb9a48853216570f7f.arthurzam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/python-systemd/files/, dev-python/python-systemd/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/python-systemd/files/python-systemd-234-fix-py3.10.patch dev-python/python-systemd/python-systemd-234-r1.ebuild X-VCS-Directories: dev-python/python-systemd/ dev-python/python-systemd/files/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 9d7601b1e4f7e1916f12a3eb9a48853216570f7f X-VCS-Branch: master Date: Fri, 17 Dec 2021 17:58:37 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 12c90d49-e50c-413f-8289-821f321227db X-Archives-Hash: 3c731f24632da7ba301db5eb59649180 commit: 9d7601b1e4f7e1916f12a3eb9a48853216570f7f Author: Arthur Zamarin gentoo org> AuthorDate: Fri Dec 17 17:54:43 2021 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Fri Dec 17 17:58:32 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d7601b1 dev-python/python-systemd: enable py3.10 Signed-off-by: Arthur Zamarin gentoo.org> .../files/python-systemd-234-fix-py3.10.patch | 46 ++++++++++++++++++++++ .../python-systemd/python-systemd-234-r1.ebuild | 39 ++++++++++++++++++ 2 files changed, 85 insertions(+) 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?= +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 . + ***/ + ++#define PY_SSIZE_T_CLEAN ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wredundant-decls" + #include ++#pragma GCC diagnostic pop ++ + #include + #include + #include +@@ -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 +}