summaryrefslogtreecommitdiff
path: root/dev-python/dbus-next
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/dbus-next')
-rw-r--r--dev-python/dbus-next/Manifest4
-rw-r--r--dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild56
-rw-r--r--dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch33
-rw-r--r--dev-python/dbus-next/metadata.xml12
4 files changed, 105 insertions, 0 deletions
diff --git a/dev-python/dbus-next/Manifest b/dev-python/dbus-next/Manifest
new file mode 100644
index 000000000000..d10c15893a0a
--- /dev/null
+++ b/dev-python/dbus-next/Manifest
@@ -0,0 +1,4 @@
+AUX dbus-next-0.2.3-glib-crash.patch 1361 BLAKE2B 879f66971e1a4e341ff2b5f396c8e26bc02e4c1ee7af0e72a34e2f672f156f93d40590bd9aff8d0ea8ae0ea15449d504a3b971c7745962de3607c57bb8e16806 SHA512 b32795726021fe25e41e1ed453e2040f76619f28e316a0707cde35dafd68316647a20d6865a6bb7b3d2baf7e703c0524d164d82b56c731277fe0a1265f2b6419
+DIST dbus-next-0.2.3.gh.tar.gz 81711 BLAKE2B 6acc38a05511b3de7e13893d82dd1ecd55f9a6124b4d859574294602b921ff012776c12ddb02e1be437b258c7bd5120a3a9625fc5b06bbbe02915dcc4c14897b SHA512 7836d855c755c8ac6cbbb251ca0cbd2f4df9b573f31b1ea1cab480e47896d36b4cb0d479b2469b0bf0b5c700068361a18874b4a087f73020cdcb4e04a2d7dbe7
+EBUILD dbus-next-0.2.3-r1.ebuild 1244 BLAKE2B 00fd527fb39111e63bf576473ea760bc5c046a44ebcfec818ff789637057b937c0ee19e92b8068a3e9449504eae2c4db527bf4d7b48bb072ecdabec95dcd4432 SHA512 43a1083d143c9da13ff293666230f12c73c8b5bfad5732a7a7dc5f19a1040140674cf019af5d65665484079e5be6c06161c586394d0dce8e45defab275789732
+MISC metadata.xml 382 BLAKE2B 6974331ea2db5dfedbbd9667a4fb923bfc4ed5b5c0c940f30270e02c18f1c2a4763039d90454d74b8da4740545dd282527d7a73a0448af1ec38600eaa76858a1 SHA512 64e6df55127e43b249830ba06ac13b069cd4f1c236c424b2ea3ea32c7846c980c30b9d8170e26e4b4ebecde0abc596b93c2796b3812371f4a69356cb55a7386b
diff --git a/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild b/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild
new file mode 100644
index 000000000000..a5d78a017665
--- /dev/null
+++ b/dev-python/dbus-next/dbus-next-0.2.3-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit distutils-r1 virtualx
+
+DESCRIPTION="The next great DBus library for Python with asyncio support"
+HOMEPAGE="
+ https://python-dbus-next.readthedocs.io/en/latest/
+ https://github.com/altdesktop/python-dbus-next/
+ https://pypi.org/project/dbus-next/
+"
+SRC_URI="
+ https://github.com/altdesktop/python-dbus-next/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+S="${WORKDIR}"/python-${P}
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~riscv ~x86"
+
+BDEPEND="
+ test? (
+ dev-python/pygobject[${PYTHON_USEDEP}]
+ dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+ dev-python/pytest-timeout[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.2.3-glib-crash.patch
+)
+
+EPYTEST_IGNORE=(
+ # "interface not found on this object: org.freedesktop.DBus.Debug.Stats"
+ # Seems like we build dbus w/o this?
+ test/client/test_signals.py
+)
+
+distutils_enable_tests pytest
+
+src_test() {
+ local dbus_params=(
+ $(dbus-daemon --session --print-address --fork --print-pid)
+ )
+ local -x DBUS_SESSION_BUS_ADDRESS=${dbus_params[0]}
+
+ virtx distutils-r1_src_test
+
+ kill "${dbus_params[1]}" || die
+}
diff --git a/dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch b/dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch
new file mode 100644
index 000000000000..714d733f3689
--- /dev/null
+++ b/dev-python/dbus-next/files/dbus-next-0.2.3-glib-crash.patch
@@ -0,0 +1,33 @@
+https://github.com/altdesktop/python-dbus-next/pull/114
+https://github.com/altdesktop/python-dbus-next/issues/113
+https://gitlab.gnome.org/GNOME/pygobject/-/issues/525
+
+From 445bc2cd0df80e36154e45ea3c4f268b550890b5 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue, 22 Mar 2022 22:11:01 +1000
+Subject: [PATCH] glib: destroy the _AuthLineSource explicitly
+
+See https://gitlab.gnome.org/GNOME/pygobject/-/issues/525 for an
+explanation, the summary is: we need to explicitly call source.destroy()
+if dispatch returns GLib.SOURCE_REMOVE.
+
+Deleting the source by resetting it to None causes invalid memory
+accesses and eventual crashes.
+
+This can be reproduced with a basic call to
+ bus = dbus_next.glib.MessageBus(bus_type=dbus_next.BusType.SESSION).connect_sync()
+and a GLib.MainLoop() after this call. Run in valgrind --tool=memcheck.
+
+Fixes #113
+--- a/dbus_next/glib/message_bus.py
++++ b/dbus_next/glib/message_bus.py
+@@ -457,7 +457,7 @@ def line_notify(line):
+ self._stream.write(Authenticator._format_line(resp))
+ self._stream.flush()
+ if resp == 'BEGIN':
+- self._readline_source = None
++ self._readline_source.destroy()
+ authenticate_notify(None)
+ return True
+ except Exception as e:
+
diff --git a/dev-python/dbus-next/metadata.xml b/dev-python/dbus-next/metadata.xml
new file mode 100644
index 000000000000..3af5441c90aa
--- /dev/null
+++ b/dev-python/dbus-next/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ </maintainer>
+ <stabilize-allarches/>
+ <upstream>
+ <remote-id type="github">altdesktop/python-dbus-next</remote-id>
+ <remote-id type="pypi">dbus-next</remote-id>
+ </upstream>
+</pkgmetadata>