aboutsummaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-10-09 20:10:19 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-10-09 20:10:19 +0000
commitcc012dfe935550fa107b361479f8bfad06cc65c8 (patch)
tree17a9eda1e1f171ed10862bf5f81960780b73d7c2 /x11
parent84c0e9b4cd09c1dccd8df7cfe89408bd799e0e51 (diff)
downloadports-cc012dfe935550fa107b361479f8bfad06cc65c8.tar.gz
ports-cc012dfe935550fa107b361479f8bfad06cc65c8.zip
Notes
Diffstat (limited to 'x11')
-rw-r--r--x11/gnome-shell/Makefile4
-rw-r--r--x11/gnome-shell/files/org.freedesktop.ConsoleKit.Manager.xml25
-rw-r--r--x11/gnome-shell/files/org.freedesktop.ConsoleKit.Session.xml11
-rw-r--r--x11/gnome-shell/files/patch-data_gnome-shell-dbus-interfaces.gresource.xml11
-rw-r--r--x11/gnome-shell/files/patch-js_misc_loginManager_js119
-rw-r--r--x11/gnome-shell/files/patch-js_ui_status_keyboard_js27
6 files changed, 197 insertions, 0 deletions
diff --git a/x11/gnome-shell/Makefile b/x11/gnome-shell/Makefile
index 78c32a8c1065..48aa8dd22d25 100644
--- a/x11/gnome-shell/Makefile
+++ b/x11/gnome-shell/Makefile
@@ -3,6 +3,7 @@
PORTNAME= gnome-shell
PORTVERSION= 3.36.6
+PORTREVISION= 1
CATEGORIES= x11 gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome
@@ -73,6 +74,9 @@ GLIB_SCHEMAS= org.gnome.shell.gschema.xml \
LDFLAGS+= -fuse-ld=lld
.endif
+post-extract:
+ ${CP} ${FILESDIR}/*.xml ${WRKSRC}/data/dbus-interfaces
+
post-patch:
${REINPLACE_CMD} -e "s,python3,${PYTHON_VERSION},g" \
${WRKSRC}/meson.build
diff --git a/x11/gnome-shell/files/org.freedesktop.ConsoleKit.Manager.xml b/x11/gnome-shell/files/org.freedesktop.ConsoleKit.Manager.xml
new file mode 100644
index 000000000000..bf6a73cf3c0f
--- /dev/null
+++ b/x11/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/x11/gnome-shell/files/org.freedesktop.ConsoleKit.Session.xml b/x11/gnome-shell/files/org.freedesktop.ConsoleKit.Session.xml
new file mode 100644
index 000000000000..ffa38faf1326
--- /dev/null
+++ b/x11/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/x11/gnome-shell/files/patch-data_gnome-shell-dbus-interfaces.gresource.xml b/x11/gnome-shell/files/patch-data_gnome-shell-dbus-interfaces.gresource.xml
new file mode 100644
index 000000000000..8f21f70b4ae5
--- /dev/null
+++ b/x11/gnome-shell/files/patch-data_gnome-shell-dbus-interfaces.gresource.xml
@@ -0,0 +1,11 @@
+--- data/gnome-shell-dbus-interfaces.gresource.xml.orig 2020-09-07 20:29:58 UTC
++++ data/gnome-shell-dbus-interfaces.gresource.xml
+@@ -12,6 +12,8 @@
+ <file preprocess="xml-stripblanks">org.freedesktop.impl.portal.Access.xml</file>
+ <file preprocess="xml-stripblanks">org.freedesktop.impl.portal.PermissionStore.xml</file>
+ <file preprocess="xml-stripblanks">org.freedesktop.impl.portal.Request.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.login1.Manager.xml</file>
+ <file preprocess="xml-stripblanks">org.freedesktop.login1.Session.xml</file>
+ <file preprocess="xml-stripblanks">org.freedesktop.login1.User.xml</file>
diff --git a/x11/gnome-shell/files/patch-js_misc_loginManager_js b/x11/gnome-shell/files/patch-js_misc_loginManager_js
new file mode 100644
index 000000000000..0c29afcbf268
--- /dev/null
+++ b/x11/gnome-shell/files/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) {
diff --git a/x11/gnome-shell/files/patch-js_ui_status_keyboard_js b/x11/gnome-shell/files/patch-js_ui_status_keyboard_js
new file mode 100644
index 000000000000..63f5b04828cb
--- /dev/null
+++ b/x11/gnome-shell/files/patch-js_ui_status_keyboard_js
@@ -0,0 +1,27 @@
+$OpenBSD: patch-js_ui_status_keyboard_js,v 1.6 2020/05/14 15:28:46 jasper Exp $
+
+https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235009
+
+Index: js/ui/status/keyboard.js
+--- js/ui/status/keyboard.js.orig
++++ js/ui/status/keyboard.js
+@@ -242,6 +242,19 @@ var InputSourceSystemSettings = class extends InputSou
+ id += '+%s'.format(variants[i]);
+ sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id });
+ }
++
++ // fallback: retrieve input source from current locale if we don't
++ // support the org.freedesktop.locale1 interface
++ if (sourcesList.length == 0) {
++ let _keyboardManagerLayout = KeyboardManager.getKeyboardManager()._getLocaleLayout();
++ if (_keyboardManagerLayout) {
++ let _kMLid = _keyboardManagerLayout.layout;
++ if (!!_keyboardManagerLayout.variant)
++ _kMLid = _kMLid + '+' + _keyboardManagerLayout.variant;
++ sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id: _kMLid });
++ }
++ }
++
+ return sourcesList;
+ }
+