commit d931fd2501868d9d26f55e012b14ac4b80caeea1 Author: CentOS Sources Date: Tue Nov 2 15:39:23 2021 -0400 import xdg-desktop-portal-1.8.1-6.el9 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1eaef7c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/xdg-desktop-portal-1.8.1.tar.xz diff --git a/.xdg-desktop-portal.metadata b/.xdg-desktop-portal.metadata new file mode 100644 index 0000000..e78bc85 --- /dev/null +++ b/.xdg-desktop-portal.metadata @@ -0,0 +1 @@ +308bb017c1306574b8bd62b19b250466bbd4785a SOURCES/xdg-desktop-portal-1.8.1.tar.xz diff --git a/SOURCES/power-profiles-daemon-gnome-40-backport.patch b/SOURCES/power-profiles-daemon-gnome-40-backport.patch new file mode 100644 index 0000000..808b1ad --- /dev/null +++ b/SOURCES/power-profiles-daemon-gnome-40-backport.patch @@ -0,0 +1,314 @@ +From 9e5e5ae969a96ab8ef6de7c28a0ebc1deae08b86 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Mon, 9 Aug 2021 16:41:29 +0200 +Subject: [PATCH 1/3] data: add PowerProfileMonitor interface definition + +--- + data/Makefile.am.inc | 1 + + ...freedesktop.portal.PowerProfileMonitor.xml | 43 +++++++++++++++++++ + 2 files changed, 44 insertions(+) + create mode 100644 data/org.freedesktop.portal.PowerProfileMonitor.xml + +diff --git a/data/Makefile.am.inc b/data/Makefile.am.inc +index aacba2a..3aabe16 100644 +--- a/data/Makefile.am.inc ++++ b/data/Makefile.am.inc +@@ -15,6 +15,7 @@ dist_introspection_DATA = \ + data/org.freedesktop.portal.NetworkMonitor.xml \ + data/org.freedesktop.portal.Notification.xml \ + data/org.freedesktop.portal.OpenURI.xml \ ++ data/org.freedesktop.portal.PowerProfileMonitor.xml \ + data/org.freedesktop.portal.Print.xml \ + data/org.freedesktop.portal.ProxyResolver.xml \ + data/org.freedesktop.portal.RemoteDesktop.xml \ +diff --git a/data/org.freedesktop.portal.PowerProfileMonitor.xml b/data/org.freedesktop.portal.PowerProfileMonitor.xml +new file mode 100644 +index 0000000..daf487a +--- /dev/null ++++ b/data/org.freedesktop.portal.PowerProfileMonitor.xml +@@ -0,0 +1,43 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +-- +2.31.1 + + +From 9a5ab798e345063eecaf6ef049cfab1ee3d52925 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Mon, 9 Aug 2021 17:11:25 +0200 +Subject: [PATCH 2/3] power-profile-monitor: Add portal implementation for + GPowerProfileMonitor + +See glib references: +https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2194 +--- + src/Makefile.am.inc | 3 + + src/power-profile-monitor.c | 113 ++++++++++++++++++++++++++++++++++++ + src/power-profile-monitor.h | 25 ++++++++ + src/xdg-desktop-portal.c | 2 + + 4 files changed, 143 insertions(+) + create mode 100644 src/power-profile-monitor.c + create mode 100644 src/power-profile-monitor.h + +diff --git a/src/Makefile.am.inc b/src/Makefile.am.inc +index 961a722..7e803dd 100644 +--- a/src/Makefile.am.inc ++++ b/src/Makefile.am.inc +@@ -41,6 +41,7 @@ PORTAL_IFACE_FILES =\ + data/org.freedesktop.portal.Camera.xml \ + data/org.freedesktop.portal.Secret.xml \ + data/org.freedesktop.portal.Wallpaper.xml \ ++ data/org.freedesktop.portal.PowerProfileMonitor.xml \ + $(NULL) + + PORTAL_IMPL_IFACE_FILES =\ +@@ -126,6 +127,8 @@ xdg_desktop_portal_SOURCES = \ + src/memory-monitor.h \ + src/network-monitor.c \ + src/network-monitor.h \ ++ src/power-profile-monitor.c \ ++ src/power-profile-monitor.h \ + src/proxy-resolver.c \ + src/proxy-resolver.h \ + src/screenshot.c \ +diff --git a/src/power-profile-monitor.c b/src/power-profile-monitor.c +new file mode 100644 +index 0000000..9ffa87a +--- /dev/null ++++ b/src/power-profile-monitor.c +@@ -0,0 +1,113 @@ ++/* ++ * Copyright © 2021 Red Hat, Inc ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library. If not, see . ++ * ++ * Authors: ++ * Bastien Nocera ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++ ++#include "power-profile-monitor.h" ++#include "request.h" ++#include "xdp-dbus.h" ++#include "xdp-utils.h" ++ ++#if GLIB_CHECK_VERSION(2, 69, 1) ++#define HAS_POWER_PROFILE_MONITOR 1 ++#endif ++ ++typedef struct _PowerProfileMonitor PowerProfileMonitor; ++typedef struct _PowerProfileMonitorClass PowerProfileMonitorClass; ++ ++struct _PowerProfileMonitor ++{ ++ XdpPowerProfileMonitorSkeleton parent_instance; ++ ++#ifdef HAS_POWER_PROFILE_MONITOR ++ GPowerProfileMonitor *monitor; ++#endif /* HAS_POWER_PROFILE_MONITOR */ ++}; ++ ++struct _PowerProfileMonitorClass ++{ ++ XdpPowerProfileMonitorSkeletonClass parent_class; ++}; ++ ++static PowerProfileMonitor *power_profile_monitor; ++ ++GType power_profile_monitor_get_type (void) G_GNUC_CONST; ++static void power_profile_monitor_iface_init (XdpPowerProfileMonitorIface *iface); ++ ++G_DEFINE_TYPE_WITH_CODE (PowerProfileMonitor, power_profile_monitor, XDP_TYPE_POWER_PROFILE_MONITOR_SKELETON, ++ G_IMPLEMENT_INTERFACE (XDP_TYPE_POWER_PROFILE_MONITOR, power_profile_monitor_iface_init)); ++ ++static void ++power_profile_monitor_iface_init (XdpPowerProfileMonitorIface *iface) ++{ ++} ++ ++#ifdef HAS_POWER_PROFILE_MONITOR ++static void ++power_saver_enabled_changed_cb (GObject *gobject, ++ GParamSpec *pspec, ++ PowerProfileMonitor *ppm) ++{ ++ xdp_power_profile_monitor_set_power_saver_enabled (XDP_POWER_PROFILE_MONITOR (ppm), ++ g_power_profile_monitor_get_power_saver_enabled (ppm->monitor)); ++} ++#endif /* HAS_POWER_PROFILE_MONITOR */ ++ ++static void ++power_profile_monitor_init (PowerProfileMonitor *ppm) ++{ ++#ifdef HAS_POWER_PROFILE_MONITOR ++ ppm->monitor = g_power_profile_monitor_dup_default (); ++ g_signal_connect (ppm->monitor, "notify::power-saver-enabled", G_CALLBACK (power_saver_enabled_changed_cb), ppm); ++#endif /* HAS_POWER_PROFILE_MONITOR */ ++ ++ xdp_power_profile_monitor_set_version (XDP_POWER_PROFILE_MONITOR (ppm), 1); ++} ++ ++static void ++power_profile_monitor_finalize (GObject *object) ++{ ++#ifdef HAS_POWER_PROFILE_MONITOR ++ PowerProfileMonitor *ppm = (PowerProfileMonitor *) object; ++ ++ g_clear_object (&ppm->monitor); ++#endif /* HAS_POWER_PROFILE_MONITOR */ ++ ++ G_OBJECT_CLASS (power_profile_monitor_parent_class)->finalize (object); ++} ++ ++static void ++power_profile_monitor_class_init (PowerProfileMonitorClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ ++ object_class->finalize = power_profile_monitor_finalize; ++} ++ ++GDBusInterfaceSkeleton * ++power_profile_monitor_create (GDBusConnection *connection) ++{ ++ power_profile_monitor = g_object_new (power_profile_monitor_get_type (), NULL); ++ ++ return G_DBUS_INTERFACE_SKELETON (power_profile_monitor); ++} +diff --git a/src/power-profile-monitor.h b/src/power-profile-monitor.h +new file mode 100644 +index 0000000..b23ea8b +--- /dev/null ++++ b/src/power-profile-monitor.h +@@ -0,0 +1,25 @@ ++/* ++ * Copyright © 2021 Red Hat, Inc ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library. If not, see . ++ * ++ * Authors: ++ * Bastien Nocera ++ */ ++ ++#pragma once ++ ++#include ++ ++GDBusInterfaceSkeleton * power_profile_monitor_create (GDBusConnection *connection); +diff --git a/src/xdg-desktop-portal.c b/src/xdg-desktop-portal.c +index 88a6c5e..e5f3002 100644 +--- a/src/xdg-desktop-portal.c ++++ b/src/xdg-desktop-portal.c +@@ -40,6 +40,7 @@ + #include "print.h" + #include "memory-monitor.h" + #include "network-monitor.h" ++#include "power-profile-monitor.h" + #include "proxy-resolver.h" + #include "screenshot.h" + #include "notification.h" +@@ -227,6 +228,7 @@ on_bus_acquired (GDBusConnection *connection, + lockdown = xdp_impl_lockdown_skeleton_new (); + + export_portal_implementation (connection, memory_monitor_create (connection)); ++ export_portal_implementation (connection, power_profile_monitor_create (connection)); + export_portal_implementation (connection, network_monitor_create (connection)); + export_portal_implementation (connection, proxy_resolver_create (connection)); + export_portal_implementation (connection, trash_create (connection)); +-- +2.31.1 + + +From ba7413f52dfd2c933a261509e511ce724dd5042a Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 24 Aug 2021 16:38:18 +0200 +Subject: [PATCH 3/3] Force power-profiles-daemon support in + +--- + src/power-profile-monitor.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/power-profile-monitor.c b/src/power-profile-monitor.c +index 9ffa87a..d033fed 100644 +--- a/src/power-profile-monitor.c ++++ b/src/power-profile-monitor.c +@@ -28,9 +28,7 @@ + #include "xdp-dbus.h" + #include "xdp-utils.h" + +-#if GLIB_CHECK_VERSION(2, 69, 1) + #define HAS_POWER_PROFILE_MONITOR 1 +-#endif + + typedef struct _PowerProfileMonitor PowerProfileMonitor; + typedef struct _PowerProfileMonitorClass PowerProfileMonitorClass; +-- +2.31.1 + diff --git a/SPECS/xdg-desktop-portal.spec b/SPECS/xdg-desktop-portal.spec new file mode 100644 index 0000000..811720d --- /dev/null +++ b/SPECS/xdg-desktop-portal.spec @@ -0,0 +1,267 @@ +%global pipewire_version 0.2.90 +%global geoclue_version 2.5.2 +%global glib_version 2.68.3-5 +%global low_memory_monitor_version 2.0 + +Name: xdg-desktop-portal +Version: 1.8.1 +Release: 6%{?dist} +Summary: Portal frontend service to flatpak + +License: LGPLv2+ +URL: https://github.com/flatpak/xdg-desktop-portal/ +Source0: https://github.com/flatpak/xdg-desktop-portal/releases/download/%{version}/%{name}-%{version}.tar.xz + +BuildRequires: make +BuildRequires: gcc +BuildRequires: pkgconfig(flatpak) +BuildRequires: pkgconfig(fuse) +BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib_version} +BuildRequires: pkgconfig(json-glib-1.0) +BuildRequires: pkgconfig(libgeoclue-2.0) >= %{geoclue_version} +BuildRequires: pkgconfig(libpipewire-0.3) >= %{pipewire_version} +BuildRequires: /usr/bin/xmlto +%{?systemd_requires} +BuildRequires: systemd +BuildRequires: git +BuildRequires: automake +BuildRequires: autoconf +BuildRequires: libtool +BuildRequires: gettext-devel + +Requires: dbus +# Required version for icon validator. +Recommends: flatpak >= 1.2.0 +Requires: geoclue2 >= %{geoclue_version} +Requires: glib2 >= %{glib_version} +Recommends: pipewire >= %{pipewire_version} +Requires: pipewire-libs >= %{pipewire_version} +# Required for the document portal. +Requires: /usr/bin/fusermount +# Required for the GMemoryMonitor GIO API +Requires: low-memory-monitor >= %{low_memory_monitor_version} + +# https://github.com/flatpak/xdg-desktop-portal/pull/613 +Patch0: power-profiles-daemon-gnome-40-backport.patch + +%description +xdg-desktop-portal works by exposing a series of D-Bus interfaces known as +portals under a well-known name (org.freedesktop.portal.Desktop) and object +path (/org/freedesktop/portal/desktop). The portal interfaces include APIs for +file access, opening URIs, printing and others. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The pkg-config file for %{name}. + + +%prep +%autosetup -S git -p1 +autoreconf -f -i + + +%build +%configure --enable-docbook-docs --disable-libportal +%make_build + + +%install +%make_install +install -dm 755 %{buildroot}/%{_pkgdocdir} +install -pm 644 README.md %{buildroot}/%{_pkgdocdir} +# This directory is used by implementations such as xdg-desktop-portal-gtk. +install -dm 755 %{buildroot}/%{_datadir}/%{name}/portals + +%find_lang %{name} + + +%post +%systemd_user_post %{name}.service +%systemd_user_post xdg-document-portal.service +%systemd_user_post xdg-permission-store.service + + +%preun +%systemd_user_preun %{name}.service +%systemd_user_preun xdg-document-portal.service +%systemd_user_preun xdg-permission-store.service + + +%files -f %{name}.lang +%doc %{_pkgdocdir} +%license COPYING +%{_datadir}/dbus-1/interfaces/org.freedesktop.portal.*.xml +%{_datadir}/dbus-1/interfaces/org.freedesktop.impl.portal.*.xml +%{_datadir}/dbus-1/services/org.freedesktop.portal.Desktop.service +%{_datadir}/dbus-1/services/org.freedesktop.portal.Documents.service +%{_datadir}/dbus-1/services/org.freedesktop.impl.portal.PermissionStore.service +%{_datadir}/%{name} +%{_libexecdir}/xdg-desktop-portal +%{_libexecdir}/xdg-document-portal +%{_libexecdir}/xdg-permission-store +%{_userunitdir}/%{name}.service +%{_userunitdir}/xdg-document-portal.service +%{_userunitdir}/xdg-permission-store.service + +%files devel +%{_datadir}/pkgconfig/xdg-desktop-portal.pc + + +%changelog +* Tue Aug 24 2021 Bastien Nocera - 1.8.1-6 ++ xdg-desktop-portal-1.8.1-6 +- Add PowerProfileMonitor portal +- Resolves: rhbz#1994468 + +* Tue Aug 10 2021 Mohan Boddu - 1.8.1-5 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Apr 16 2021 Mohan Boddu - 1.8.1-4 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Thu Apr 15 2021 Tomas Popela - 1.8.1-3 +- Drop PipeWire 0.2 requirement as Chrom[e|ium] 90 now depends on PipeWire 0.3 +- Resolves: rhbz#1929237 + +* Wed Feb 17 2021 David King - 1.8.1-2 +- Drop unused fontconfig BuildRequires + +* Wed Feb 17 2021 Kalev Lember - 1.8.1-1 +- Update to 1.8.1 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Sep 14 2020 Kalev Lember - 1.8.0-1 +- Update to 1.8.0 + +* Wed Jul 29 2020 Fedora Release Engineering - 1.7.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jun 25 2020 Tomas Popela - 1.7.2-2 +- Start to require pipewire0.2-libs so screen sharing works out of the box in Chrome and Chromium. + +* Fri Apr 03 2020 David King - 1.7.2-1 +- Update to 1.7.2 (#1820660) + +* Sat Mar 28 2020 Kalev Lember - 1.7.1-1 +- Update to 1.7.1 + +* Sat Mar 14 2020 David King - 1.7.0-1 +- Update to 1.7.0 (#1813534) + +* Tue Mar 10 2020 Kalev Lember - 1.6.0-4 +- Backport PipeWire 0.3 support + +* Fri Jan 31 2020 Fedora Release Engineering - 1.6.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jan 03 2020 Bastien Nocera - 1.6.0-2 ++ xdg-desktop-portal-1.6.0-2 +- Add requires to implement GMemoryMonitor + +* Fri Dec 20 2019 David King - 1.6.0-1 +- Update to 1.6.0 + +* Thu Dec 12 2019 David King - 1.5.4-1 +- Update to 1.5.4 + +* Thu Nov 28 2019 David King - 1.5.3-1 +- Update to 1.5.3 + +* Tue Oct 29 2019 David King - 1.5.2-1 +- Update to 1.5.2 (#1766780) + +* Tue Oct 22 2019 David King - 1.5.1-1 +- Update to 1.5.1 (#1714704) + +* Fri Oct 04 2019 David King - 1.5.0-1 +- Update to 1.5.0 + +* Mon Sep 16 2019 Kalev Lember - 1.4.2-3 +- Avoid a hard dep on pipewire daemon + +* Sat Jul 27 2019 Fedora Release Engineering - 1.4.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue May 28 2019 Kalev Lember - 1.4.2-1 +- Update to 1.4.2 + +* Thu Feb 14 2019 David King - 1.2.0-3 +- Drop icon validator Requires to Recommends + +* Sun Feb 03 2019 Fedora Release Engineering - 1.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jan 26 2019 David King - 1.2.0-1 +- Update to 1.2.0 (#1669552) + +* Wed Jan 16 2019 Kalev Lember - 1.1.1-1 +- Update to 1.1.1 + +* Tue Oct 09 2018 David King - 1.0.3-1 +- Update to 1.0.3 + +* Mon Sep 03 2018 David King - 1.0.2-1 +- Update to 1.0.2 + +* Mon Aug 20 2018 David King - 1.0-1 +- Update to 1.0 + +* Wed Aug 01 2018 Jan Grulich - 0.99-2 +- Rebuild PipeWire 0.2.2 + +* Tue Jul 24 2018 David King - 0.99-1 +- Update to 0.99 + +* Sat Jul 14 2018 Fedora Release Engineering - 0.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Apr 25 2018 David King - 0.11-1 +- Update to 0.11 (#1545225) + +* Wed Feb 14 2018 David King - 0.10-1 +- Update to 0.10 (#1545225) + +* Fri Feb 09 2018 Fedora Release Engineering - 0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sun Nov 19 2017 David King - 0.9-1 +- Update to 0.9 (#1514774) + +* Thu Aug 03 2017 Fedora Release Engineering - 0.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jun 06 2017 David King - 0.8-1 +- Update to 0.8 (#1458969) + +* Fri Mar 31 2017 David King - 0.6-1 +- Update to 0.6 + +* Sat Feb 11 2017 Fedora Release Engineering - 0.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jan 18 2017 David King - 0.5-1 +- Update to 0.5 + +* Thu Dec 01 2016 David King - 0.4-1 +- Update to 0.4 + +* Fri Sep 02 2016 David King - 0.3-1 +- Update to 0.3 + +* Fri Jul 29 2016 David King - 0.2-1 +- Update to 0.2 (#1361575) + +* Tue Jul 12 2016 David King - 0.1-2 +- Own the portals directory + +* Mon Jul 11 2016 David King - 0.1-1 +- Initial Fedora packaging