summaryrefslogtreecommitdiff
path: root/dev-libs/libportal
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/libportal')
-rw-r--r--dev-libs/libportal/Manifest4
-rw-r--r--dev-libs/libportal/files/6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch47
-rw-r--r--dev-libs/libportal/libportal-0.7.1-r1.ebuild118
-rw-r--r--dev-libs/libportal/libportal-0.7.1.ebuild5
4 files changed, 173 insertions, 1 deletions
diff --git a/dev-libs/libportal/Manifest b/dev-libs/libportal/Manifest
index 35d47b3ec261..d971313a424e 100644
--- a/dev-libs/libportal/Manifest
+++ b/dev-libs/libportal/Manifest
@@ -1,3 +1,5 @@
+AUX 6cd7c2ab82575b76f876ee2bd2d31f6cb77f022f.patch 1981 BLAKE2B ce69f3b2b95b94df487c1cb46a7a50949bdc721d93bb7039ae196fa52941db7383a1e49aa4560a87a35f83f1794ff50e8a2af39fa6d0eed285e03b64b8d911a0 SHA512 7d7106c258d0dfa96d9daf678883a9a60cc61e8fed189f74bae99d2d0dbea1e2b2b9d6fd6d00a2d97c225df30a1fe53ca007a48543b4c686ccd9d49bd5ebae5c
DIST libportal-0.7.1.tar.xz 74268 BLAKE2B b519fa88735d640a74e18cc791ec69862f136b793a7c855b1f3873cf6b15626d69088747f1a7ff54f8cd96f79e82e3df31e5349e3da57906e769b8f809f4ba34 SHA512 cbc50bfd86787fffc975fc53835acc6c3c0fd54b7ee02fce1983f1bd0fc40b15a0537780cd5e943ecedcf951840080a0f55a23a96e706223e52a6144ee70332c
-EBUILD libportal-0.7.1.ebuild 2241 BLAKE2B 4b3afb6a818448ed61ba47cd4bfe57a3ce209cb8e1ec30223b08b0c2d9784d7976f6b4755fbffe269018181faeadbedc1011f2b7e700386b164b9864e1ef9327 SHA512 5b5b82a51981025253255548e017c3442dde465f3a2fd5ca5fc7d3fc34f118b672b3b33709aa0e113f345570d659d2c167278f14545363d83df283099656fd9a
+EBUILD libportal-0.7.1-r1.ebuild 2589 BLAKE2B 20f5354a536ca366fa26d8d83b91ee7518e5bd52ad7e1e70cbcc993c7fe786ed00a95e21665fc6ae97fc2f4091d028a9beefb88865a79a840c4847551a0f3552 SHA512 fcb113dc85aad599eb08412553ad0305a72a6cff406658c6b52fe13cd7a047a3e8c0fc763562bc9e330cb9c066c60da5dc771164b7ef59c0bbfa9db8199d1ce9
+EBUILD libportal-0.7.1.ebuild 2379 BLAKE2B df03f92a4cdfa7bc58265767aafc6247dadf45125f492c37115057eab285d30d3709ee40309f82ab504fe10d4f65de176b37ae5af4241ebb9c4e438067bd243a SHA512 ef635e2939355f3cb4ac4679be407da0b50eb6f24b08b98a10fef221460aa6c10715498794b5373342c2492e70fea5fe5cd7cdfee4d364ce4446205a82277b40
MISC metadata.xml 346 BLAKE2B 36d7ac5ecd2e44a96508cd386bf9cdde323bcf70778bddde22780302958f79c57d337439d11629ea85d52c4990cc85b78aadf500241423ddfd31bd66cc6fbc7a SHA512 dc36f454412fca9a812721598d9e279ab33b83399388ca8722d6ab5dfadb7f54a5702b7dee3f5af29549cded85d8effe1b282cf6911eefafff7d9b848420d8b8
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
new file mode 100644
index 000000000000..dd7b33562a34
--- /dev/null
+++ b/dev-libs/libportal/libportal-0.7.1-r1.ebuild
@@ -0,0 +1,118 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit flag-o-matic meson python-any-r1 vala virtualx
+
+DESCRIPTION="Flatpak portal library"
+HOMEPAGE="https://github.com/flatpak/libportal"
+SRC_URI="https://github.com/flatpak/libportal/releases/download/${PV}/${P}.tar.xz"
+
+LICENSE="LGPL-3"
+SLOT="0/1-1-1-1" # soname of libportal{,-gtk3,-gtk4,-qt5}.so
+KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc x86"
+IUSE="gtk gtk-doc +introspection qt5 test +vala wayland X"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="
+ gtk-doc? ( introspection )
+ vala? ( introspection )
+"
+
+RDEPEND="
+ >=dev-libs/glib-2.58:2
+ introspection? ( dev-libs/gobject-introspection:= )
+ gtk? (
+ >=x11-libs/gtk+-3.24.41-r1:3[X?,wayland?]
+ >=gui-libs/gtk-4.12.5-r2:4[X?,wayland?]
+ )
+ qt5? (
+ dev-qt/qtcore:=
+ dev-qt/qtgui:=
+ dev-qt/qtx11extras:=
+ dev-qt/qtwidgets:=
+ )
+"
+DEPEND="${RDEPEND}
+ qt5? (
+ test? ( dev-qt/qttest:= )
+ )
+"
+BDEPEND="
+ dev-util/glib-utils
+ virtual/pkgconfig
+ gtk-doc? ( dev-util/gi-docgen )
+ qt5? (
+ test? ( dev-qt/linguist-tools )
+ )
+ test? (
+ ${PYTHON_DEPS}
+ $(python_gen_any_dep '
+ dev-python/pytest[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-python/python-dbusmock[${PYTHON_USEDEP}]
+ ')
+ )
+ 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}]" \
+ "dev-python/dbus-python[${PYTHON_USEDEP}]" \
+ "dev-python/python-dbusmock[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ if use test; then
+ python-any-r1_pkg_setup
+ fi
+}
+
+src_prepare() {
+ default
+ vala_setup
+}
+
+src_configure() {
+ # defang automagic dependencies
+ use wayland || append-cflags -DGENTOO_GTK_HIDE_WAYLAND
+ use X || append-cflags -DGENTOO_GTK_HIDE_X11
+
+ local emesonargs=(
+ $(meson_feature gtk backend-gtk3)
+ $(meson_feature gtk backend-gtk4)
+ $(meson_feature qt5 backend-qt5)
+ -Dportal-tests=false
+ $(meson_use introspection)
+ $(meson_use vala vapi)
+ $(meson_use gtk-doc docs)
+ $(meson_use test tests)
+ )
+ meson_src_configure
+}
+
+src_test() {
+ # Tests only exist for Qt5
+ if use qt5; then
+ virtx meson_src_test
+ else
+ # run meson_src_test to notice if tests are added
+ meson_src_test
+ fi
+}
+
+src_install() {
+ meson_src_install
+
+ if use gtk-doc; then
+ mkdir -p "${ED}"/usr/share/gtk-doc/html/ || die
+ mv "${ED}"/usr/share/doc/${PN}-1 "${ED}"/usr/share/gtk-doc/html/ || die
+ fi
+}
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}]" \