* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libportal/files/, dev-libs/libportal/
@ 2024-08-09 14:56 Eli Schwartz
0 siblings, 0 replies; only message in thread
From: Eli Schwartz @ 2024-08-09 14:56 UTC (permalink / raw
To: gentoo-commits
commit: 986cc3ef311fcd23a2056c9b0e823a99d6f1cd29
Author: Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 14:51:42 2024 +0000
Commit: Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 14:55:20 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=986cc3ef
dev-libs/libportal: backport test fix for python-dbusmock 0.30.0
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>
.../6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch | 47 ++++++++++++++++++++++
dev-libs/libportal/libportal-0.7.1-r1.ebuild | 5 +++
dev-libs/libportal/libportal-0.7.1.ebuild | 5 +++
3 files changed, 57 insertions(+)
diff --git a/dev-libs/libportal/files/6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch b/dev-libs/libportal/files/6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch
new file mode 100644
index 000000000000..ea055c832dc8
--- /dev/null
+++ b/dev-libs/libportal/files/6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch
@@ -0,0 +1,47 @@
+From 6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@debian.org>
+Date: Tue, 26 Dec 2023 14:35:46 +0000
+Subject: [PATCH] pyportaltest: Only create one session bus per DBusTestCase
+ subclass
+
+DBusTestCase.start_session_bus() is a class method, and can only be
+called once per class, because DBusTestCase.tearDownClass() will only
+clean up one session bus. In older versions of dbusmock, calling it more
+than once will result in dbus-daemon processes being leaked; since
+0.30.0, calling it more than once will result in an assertion failure.
+
+Resolves: https://github.com/flatpak/libportal/issues/136
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058245
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ tests/pyportaltest/__init__.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/tests/pyportaltest/__init__.py b/tests/pyportaltest/__init__.py
+index af053c2a..80f04a91 100644
+--- a/tests/pyportaltest/__init__.py
++++ b/tests/pyportaltest/__init__.py
+@@ -83,6 +83,14 @@ def setUpClass(cls):
+ except AttributeError:
+ pytest.skip("Updated version of dbusmock required")
+
++ cls.__have_session_bus = False
++
++ @classmethod
++ def ensure_session_bus(cls):
++ if not cls.__have_session_bus:
++ cls.__have_session_bus = True
++ cls.start_session_bus()
++
+ def setUp(self):
+ self.p_mock = None
+ self._mainloop = None
+@@ -96,7 +104,7 @@ def setup_daemon(self, params=None, extra_templates: List[Tuple[str, Dict]] = []
+ portal name as first value and the param dict to be passed to that
+ template as second value, e.g. ("ScreenCast", {...}).
+ """
+- self.start_session_bus()
++ self.ensure_session_bus()
+ self.p_mock, self.obj_portal = self.spawn_server_template(
+ template=f"pyportaltest/templates/{self.PORTAL_NAME.lower()}.py",
+ parameters=params,
diff --git a/dev-libs/libportal/libportal-0.7.1-r1.ebuild b/dev-libs/libportal/libportal-0.7.1-r1.ebuild
index ee06945d14a1..81876f8802a6 100644
--- a/dev-libs/libportal/libportal-0.7.1-r1.ebuild
+++ b/dev-libs/libportal/libportal-0.7.1-r1.ebuild
@@ -57,6 +57,11 @@ BDEPEND="
vala? ( $(vala_depend) )
"
+PATCHES=(
+ # backport fix for tests incompatibility with dbusmock 0.30.0
+ "${FILESDIR}"/6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch
+)
+
python_check_deps() {
python_has_version \
"dev-python/pytest[${PYTHON_USEDEP}]" \
diff --git a/dev-libs/libportal/libportal-0.7.1.ebuild b/dev-libs/libportal/libportal-0.7.1.ebuild
index 38a05311150b..5d36d44b83ea 100644
--- a/dev-libs/libportal/libportal-0.7.1.ebuild
+++ b/dev-libs/libportal/libportal-0.7.1.ebuild
@@ -57,6 +57,11 @@ BDEPEND="
vala? ( $(vala_depend) )
"
+PATCHES=(
+ # backport fix for tests incompatibility with dbusmock 0.30.0
+ "${FILESDIR}"/6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch
+)
+
python_check_deps() {
python_has_version \
"dev-python/pytest[${PYTHON_USEDEP}]" \
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-08-09 14:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09 14:56 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libportal/files/, dev-libs/libportal/ Eli Schwartz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox