From e96bf89d1e36c89998afc63f74a9dce07ce99c18 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 10 Jul 2020 20:12:34 +0200 Subject: [PATCH] gnomeExtensions.system-monitor: unbreak with newer GNOME Shell Had to switch to master and include Clutter typelib to path since recent versions of GNOME Shell open preferences out of Shell context. --- .../extensions/system-monitor/default.nix | 12 +++++----- .../paths_and_nonexisting_dirs.patch | 22 ++++++++++++++----- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix index 489a4c5587fa..1bc35312593a 100644 --- a/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix +++ b/pkgs/desktops/gnome-3/extensions/system-monitor/default.nix @@ -1,14 +1,14 @@ -{ stdenv, substituteAll, fetchFromGitHub, glib, glib-networking, libgtop, gnome3 }: +{ stdenv, substituteAll, fetchpatch, fetchFromGitHub, glib, glib-networking, libgtop, gnome3 }: stdenv.mkDerivation rec { pname = "gnome-shell-system-monitor"; - version = "38"; + version = "2020-04-27-unstable"; src = fetchFromGitHub { owner = "paradoxxxzero"; repo = "gnome-shell-system-monitor-applet"; - rev = "v${version}"; - sha256 = "1sdj2kxb418mgq44a6lf6jic33wlfbnn3ja61igmx0jj1530iknv"; + rev = "7f8f0a7b255473941f14d1dcaa35ebf39d3bccd0"; + sha256 = "tUUvBY0UEUE+T79zVZEAICpKoriFZuuZzi9ArdHdXks="; }; buildInputs = [ @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { patches = [ (substituteAll { src = ./paths_and_nonexisting_dirs.patch; + clutter_path = gnome3.mutter.libdir; # this should not be used in settings but 🤷‍♀️ gtop_path = "${libgtop}/lib/girepository-1.0"; glib_net_path = "${glib-networking}/lib/girepository-1.0"; }) @@ -41,8 +42,5 @@ stdenv.mkDerivation rec { license = licenses.gpl3Plus; maintainers = with maintainers; [ tiramiseb ]; homepage = "https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet"; - # 3.36 support not yet ready - # https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/pull/564 - broken = stdenv.lib.versionAtLeast gnome3.gnome-shell.version "3.34"; }; } diff --git a/pkgs/desktops/gnome-3/extensions/system-monitor/paths_and_nonexisting_dirs.patch b/pkgs/desktops/gnome-3/extensions/system-monitor/paths_and_nonexisting_dirs.patch index 82e3d7c541ba..280af965af3f 100644 --- a/pkgs/desktops/gnome-3/extensions/system-monitor/paths_and_nonexisting_dirs.patch +++ b/pkgs/desktops/gnome-3/extensions/system-monitor/paths_and_nonexisting_dirs.patch @@ -1,5 +1,5 @@ diff --git a/system-monitor@paradoxxx.zero.gmail.com/extension.js b/system-monitor@paradoxxx.zero.gmail.com/extension.js -index b4b7f15..d139135 100644 +index de5e3d7..2d7824d 100644 --- a/system-monitor@paradoxxx.zero.gmail.com/extension.js +++ b/system-monitor@paradoxxx.zero.gmail.com/extension.js @@ -18,6 +18,9 @@ @@ -11,13 +11,23 @@ index b4b7f15..d139135 100644 + /* Ugly. This is here so that we don't crash old libnm-glib based shells unnecessarily * by loading the new libnm.so. Should go away eventually */ - const libnm_glib = imports.gi.GIRepository.Repository.get_default().is_registered("NMClient", "1.0"); -@@ -386,7 +389,7 @@ const smMountsMonitor = new Lang.Class({ - connected: false, - _init: function () { + +@@ -407,7 +410,7 @@ const smMountsMonitor = class SystemMonitor_smMountsMonitor { + this.connected = false; + this._volumeMonitor = Gio.VolumeMonitor.get(); - let sys_mounts = ['/home', '/tmp', '/boot', '/usr', '/usr/local']; + let sys_mounts = ['/home', '/tmp', '/boot']; this.base_mounts = ['/']; - sys_mounts.forEach(Lang.bind(this, function (sMount) { + sys_mounts.forEach((sMount) => { if (this.is_sys_mount(sMount + '/')) { +diff --git a/system-monitor@paradoxxx.zero.gmail.com/prefs.js b/system-monitor@paradoxxx.zero.gmail.com/prefs.js +index 81d667c..0da4809 100644 +--- a/system-monitor@paradoxxx.zero.gmail.com/prefs.js ++++ b/system-monitor@paradoxxx.zero.gmail.com/prefs.js +@@ -1,3 +1,5 @@ ++imports.gi.GIRepository.Repository.prepend_search_path('@clutter_path@'); ++ + const Gtk = imports.gi.Gtk; + const Gio = imports.gi.Gio; + const Gdk = imports.gi.Gdk;