pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/gnome-shell: Import OpenBSD's ConsoleKit patch



Module Name:	pkgsrc-wip
Committed By:	Dan Cîrnaț <dan%alt.md@localhost>
Pushed By:	cirnatdan
Date:		Wed Jul 15 10:54:03 2020 +0200
Changeset:	70c1970d54bc499cc1843fd71c3a5cbfc875f331

Modified Files:
	gnome-shell/Makefile
	gnome-shell/distinfo
Added Files:
	gnome-shell/files/org.freedesktop.ConsoleKit.Manager.xml
	gnome-shell/files/org.freedesktop.ConsoleKit.Session.xml
	gnome-shell/patches/patch-data_gnome-shell-dbus-interfaces_gresource_xml
	gnome-shell/patches/patch-js_misc_loginManager_js

Log Message:
wip/gnome-shell: Import OpenBSD's ConsoleKit patch

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=70c1970d54bc499cc1843fd71c3a5cbfc875f331

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gnome-shell/Makefile                               |   5 +-
 gnome-shell/distinfo                               |   2 +
 .../files/org.freedesktop.ConsoleKit.Manager.xml   |  25 +++++
 .../files/org.freedesktop.ConsoleKit.Session.xml   |  11 ++
 ...-data_gnome-shell-dbus-interfaces_gresource_xml |  14 +++
 gnome-shell/patches/patch-js_misc_loginManager_js  | 119 +++++++++++++++++++++
 6 files changed, 175 insertions(+), 1 deletion(-)

diffs:
diff --git a/gnome-shell/Makefile b/gnome-shell/Makefile
index cbfaaeaff3..d394b24929 100644
--- a/gnome-shell/Makefile
+++ b/gnome-shell/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 
 DISTNAME=	gnome-shell-3.36.4
-PKGREVISION=	1
+PKGREVISION=	2
 CATEGORIES=	x11 gnome
 MASTER_SITES=	${MASTER_SITE_GNOME:=sources/gnome-shell/3.36/}
 EXTRACT_SUFX=	.tar.xz
@@ -30,6 +30,9 @@ MAKE_ENV+=      LD_LIBRARY_PATH=${WRKSRC}/output/subprojects/gvc
 
 REPLACE_PYTHON+=	meson/*.py
 
+post-extract:
+	cp ${FILESDIR}/*.xml ${WRKSRC}/data/dbus-interfaces/
+
 .include "../../graphics/librsvg/buildlink3.mk"
 .include "../../lang/python/application.mk"
 .include "../../textproc/json-glib/buildlink3.mk"
diff --git a/gnome-shell/distinfo b/gnome-shell/distinfo
index a7e8f78528..a038e09037 100644
--- a/gnome-shell/distinfo
+++ b/gnome-shell/distinfo
@@ -4,4 +4,6 @@ SHA1 (gnome-shell-3.36.4.tar.xz) = 8c071d920e928c2986ffcae67dc1ab628b94ffc4
 RMD160 (gnome-shell-3.36.4.tar.xz) = 39eb9e1851bc432dabcded956d4fbe4e590b4ec5
 SHA512 (gnome-shell-3.36.4.tar.xz) = 879b1590d516e7e9e1ad066c870023d59cbaaca13e1e77d8b14de302574b3138451c4b8ab0ba1b43aec3e6e03bd147304e8e0e995359b181522a790afc97d450
 Size (gnome-shell-3.36.4.tar.xz) = 1774584 bytes
+SHA1 (patch-data_gnome-shell-dbus-interfaces_gresource_xml) = fea5eefa6a8c3f52519336aa8c1eeaf616cc496c
+SHA1 (patch-js_misc_loginManager_js) = f44f1a4ab50abd1d78a8e3e0fc4786e6c635f06d
 SHA1 (patch-src_shell-util.c) = 830dd5dec94775b64aeaed1738da2384f19c6ec7
diff --git a/gnome-shell/files/org.freedesktop.ConsoleKit.Manager.xml b/gnome-shell/files/org.freedesktop.ConsoleKit.Manager.xml
new file mode 100644
index 0000000000..bf6a73cf3c
--- /dev/null
+++ b/gnome-shell/files/org.freedesktop.ConsoleKit.Manager.xml
@@ -0,0 +1,25 @@
+<!-- $OpenBSD: org.freedesktop.ConsoleKit.Manager.xml,v 1.1 2019/01/17 19:00:46 ajacoutot Exp $ -->
+
+<node>
+  <interface name="org.freedesktop.ConsoleKit.Manager">
+    <method name="Suspend">                                                     
+      <arg type="b" direction="in"/>                                            
+    </method>                                                                   
+    <method name="CanSuspend">                                                  
+      <arg type="s" direction="out"/>                                           
+    </method>                                                                   
+    <method name="Inhibit">                                                     
+      <arg type="s" direction="in"/>                                            
+      <arg type="s" direction="in"/>                                            
+      <arg type="s" direction="in"/>                                            
+      <arg type="s" direction="in"/>                                            
+      <arg type="h" direction="out"/>                                           
+    </method>                                                                   
+    <signal name="PrepareForSleep">                                             
+      <arg type="b" direction="out"/>                                           
+    </signal>                                                                   
+    <method name="GetCurrentSession">
+      <arg type="o" direction="out"/>
+    </method>
+  </interface>                                                                  
+</node>
diff --git a/gnome-shell/files/org.freedesktop.ConsoleKit.Session.xml b/gnome-shell/files/org.freedesktop.ConsoleKit.Session.xml
new file mode 100644
index 0000000000..ffa38faf13
--- /dev/null
+++ b/gnome-shell/files/org.freedesktop.ConsoleKit.Session.xml
@@ -0,0 +1,11 @@
+<!-- $OpenBSD: org.freedesktop.ConsoleKit.Session.xml,v 1.1 2019/01/17 19:00:46 ajacoutot Exp $ -->
+
+<node>
+  <interface name="org.freedesktop.ConsoleKit.Session">
+    <signal name="Lock" />
+    <signal name="Unlock" />
+      <method name="SetLockedHint">                                               
+        <arg type="b" direction="in"/>                                            
+      </method>
+    </interface>
+</node>
diff --git a/gnome-shell/patches/patch-data_gnome-shell-dbus-interfaces_gresource_xml b/gnome-shell/patches/patch-data_gnome-shell-dbus-interfaces_gresource_xml
new file mode 100644
index 0000000000..72351979cb
--- /dev/null
+++ b/gnome-shell/patches/patch-data_gnome-shell-dbus-interfaces_gresource_xml
@@ -0,0 +1,14 @@
+$OpenBSD: patch-data_gnome-shell-dbus-interfaces_gresource_xml,v 1.1 2019/01/17 19:00:46 ajacoutot Exp $
+
+Index: data/gnome-shell-dbus-interfaces.gresource.xml
+--- data/gnome-shell-dbus-interfaces.gresource.xml.orig
++++ data/gnome-shell-dbus-interfaces.gresource.xml
+@@ -6,6 +6,8 @@
+     <file preprocess="xml-stripblanks">org.freedesktop.Application.xml</file>
+     <file preprocess="xml-stripblanks">org.freedesktop.bolt1.Device.xml</file>
+     <file preprocess="xml-stripblanks">org.freedesktop.bolt1.Manager.xml</file>
++    <file preprocess="xml-stripblanks">org.freedesktop.ConsoleKit.Manager.xml</file>
++    <file preprocess="xml-stripblanks">org.freedesktop.ConsoleKit.Session.xml</file>
+     <file preprocess="xml-stripblanks">org.freedesktop.DBus.xml</file>
+     <file preprocess="xml-stripblanks">org.freedesktop.GeoClue2.Agent.xml</file>
+     <file preprocess="xml-stripblanks">org.freedesktop.GeoClue2.Manager.xml</file>
diff --git a/gnome-shell/patches/patch-js_misc_loginManager_js b/gnome-shell/patches/patch-js_misc_loginManager_js
new file mode 100644
index 0000000000..0c29afcbf2
--- /dev/null
+++ b/gnome-shell/patches/patch-js_misc_loginManager_js
@@ -0,0 +1,119 @@
+$OpenBSD: patch-js_misc_loginManager_js,v 1.10 2020/05/14 15:28:46 jasper Exp $
+
+Index: js/misc/loginManager.js
+--- js/misc/loginManager.js.orig
++++ js/misc/loginManager.js
+@@ -14,6 +14,12 @@ const SystemdLoginManager = Gio.DBusProxy.makeProxyWra
+ const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
+ const SystemdLoginUser = Gio.DBusProxy.makeProxyWrapper(SystemdLoginUserIface);
+ 
++const ConsoleKitManagerIface = loadInterfaceXML('org.freedesktop.ConsoleKit.Manager');
++const ConsoleKitSessionIface = loadInterfaceXML('org.freedesktop.ConsoleKit.Session');
++
++const ConsoleKitManager = Gio.DBusProxy.makeProxyWrapper(ConsoleKitManagerIface);
++const ConsoleKitSession = Gio.DBusProxy.makeProxyWrapper(ConsoleKitSessionIface);
++
+ function haveSystemd() {
+     return GLib.access("/run/systemd/seats", 0) >= 0;
+ }
+@@ -43,7 +49,7 @@ function canLock() {
+                                                -1, null);
+ 
+         let version = result.deep_unpack()[0].deep_unpack();
+-        return haveSystemd() && versionCompare('3.5.91', version);
++        return versionCompare('3.5.91', version);
+     } catch (e) {
+         return false;
+     }
+@@ -84,7 +90,7 @@ function getLoginManager() {
+         if (haveSystemd())
+             _loginManager = new LoginManagerSystemd();
+         else
+-            _loginManager = new LoginManagerDummy();
++            _loginManager = new LoginManagerConsoleKit();
+     }
+ 
+     return _loginManager;
+@@ -199,6 +205,82 @@ var LoginManagerSystemd = class {
+     }
+ };
+ Signals.addSignalMethods(LoginManagerSystemd.prototype);
++
++var LoginManagerConsoleKit = class {
++    constructor () {
++        this._proxy = new ConsoleKitManager(Gio.DBus.system,
++                                            'org.freedesktop.ConsoleKit',
++                                            '/org/freedesktop/ConsoleKit/Manager');
++        this._proxy.connectSignal('PrepareForSleep',
++                                  this._prepareForSleep.bind(this));
++    }
++
++    // Having this function is a bit of a hack since the Systemd and ConsoleKit
++    // session objects have different interfaces - but in both cases there are
++    // Lock/Unlock signals, and that's all we count upon at the moment.
++
++
++    getCurrentSessionProxy(callback) {
++        if (this._currentSession) {
++            callback (this._currentSession);
++            return;
++        }
++
++        this._proxy.GetCurrentSessionRemote((result, error) => {
++            if (error) {
++                logError(error, 'Could not get a proxy for the current session');
++            } else {
++                this._currentSession = new ConsoleKitSession(Gio.DBus.system,
++                                                             'org.freedesktop.ConsoleKit',
++                                                             result[0]);
++                callback(this._currentSession);
++            }
++        });
++    }
++
++    canSuspend(asyncCallback) {
++        this._proxy.CanSuspendRemote((result, error) => {
++            if (error) {
++                asyncCallback(false, false);
++            } else {
++                asyncCallback(result[0], false);
++            }
++        });
++    }
++
++    listSessions(asyncCallback) {
++        asyncCallback([]);
++    }
++
++    suspend() {
++        this._proxy.SuspendRemote(true);
++    }
++
++    inhibit(reason, callback) {
++        let inVariant = GLib.Variant.new('(ssss)',
++                                         ['sleep',
++                                          'GNOME Shell',
++                                          reason,
++                                          'delay']);
++        this._proxy.call_with_unix_fd_list('Inhibit', inVariant, 0, -1, null, null,
++            (proxy, result) => {
++                let fd = -1;
++                try {
++                    let [outVariant, fdList] = proxy.call_with_unix_fd_list_finish(result);
++                    fd = fdList.steal_fds()[0];
++                    callback(new Gio.UnixInputStream({ fd: fd }));
++                } catch(e) {
++                    logError(e, "Error getting ConsoleKit inhibitor");
++                    callback(null);
++                }
++            });
++    }
++
++    _prepareForSleep(proxy, sender, [aboutToSuspend]) {
++        this.emit('prepare-for-sleep', aboutToSuspend);
++    }
++}
++Signals.addSignalMethods(LoginManagerConsoleKit.prototype);
+ 
+ var LoginManagerDummy = class {
+     getCurrentSessionProxy(_callback) {


Home | Main Index | Thread Index | Old Index