From 64fb2f4bf2549fa3ba28e1275fd1b3a3ae8c3a4d Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 17 Aug 2023 12:15:26 +0000 Subject: [PATCH] =?UTF-8?q?gnome.gnome-shell-extensions:=2045.alpha=20?= =?UTF-8?q?=E2=86=92=2045.beta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/compare/45.alpha...45.beta Ported to ESM, rewritten the fix_gmenu.patch, I found these docs useful for frontend newbie like me: https://gjs.guide/extensions/upgrading/gnome-shell-45.html#esm https://gitlab.gnome.org/GNOME/gjs/-/blob/1.77.2/doc/ESModules.md Using dynamic import() statements with top-level await since we need to control what is imported. Seem to work, though it might potentially block gnome-shell thread for a bit? Changelog-reviewed-by: Bobby Rong Changelog-reviewed-by: Jan Tojnar --- .../core/gnome-shell-extensions/default.nix | 4 +-- .../gnome-shell-extensions/fix_gmenu.patch | 27 +++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/pkgs/desktops/gnome/core/gnome-shell-extensions/default.nix b/pkgs/desktops/gnome/core/gnome-shell-extensions/default.nix index 1ed4e436741c..43a16e024d68 100644 --- a/pkgs/desktops/gnome/core/gnome-shell-extensions/default.nix +++ b/pkgs/desktops/gnome/core/gnome-shell-extensions/default.nix @@ -13,11 +13,11 @@ stdenv.mkDerivation rec { pname = "gnome-shell-extensions"; - version = "45.alpha"; + version = "45.beta"; src = fetchurl { url = "mirror://gnome/sources/gnome-shell-extensions/${lib.versions.major version}/${pname}-${version}.tar.xz"; - sha256 = "uq3CF0wRKKQ2NO3WQNWXaLlPWBcDGA2T1mO/gu8AvA8="; + sha256 = "C2IUTB55M7SH4LyxSLjXclDFCGPJK9Lf9xjGOdEZEE0="; }; patches = [ diff --git a/pkgs/desktops/gnome/core/gnome-shell-extensions/fix_gmenu.patch b/pkgs/desktops/gnome/core/gnome-shell-extensions/fix_gmenu.patch index 555664e8ae25..1254f532d611 100644 --- a/pkgs/desktops/gnome/core/gnome-shell-extensions/fix_gmenu.patch +++ b/pkgs/desktops/gnome/core/gnome-shell-extensions/fix_gmenu.patch @@ -1,11 +1,22 @@ +diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js +index 6eb58f1..28e1195 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js -@@ -1,6 +1,8 @@ - /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ - /* exported init enable disable */ +@@ -10,7 +10,7 @@ import Atk from 'gi://Atk'; + import Clutter from 'gi://Clutter'; + import Gio from 'gi://Gio'; + import GLib from 'gi://GLib'; +-import GMenu from 'gi://GMenu'; ++import GIRepository from 'gi://GIRepository'; + import GObject from 'gi://GObject'; + import Gtk from 'gi://Gtk'; + import Meta from 'gi://Meta'; +@@ -25,6 +25,8 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js'; + import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js'; + import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; -+imports.gi.GIRepository.Repository.prepend_search_path('@gmenu_path@'); -+ - const { - Atk, Clutter, Gio, GLib, GMenu, GObject, Gtk, Meta, Shell, St - } = imports.gi; ++GIRepository.Repository.prepend_search_path('@gmenu_path@'); ++const {default: GMenu} = await import('gi://GMenu'); + const appSys = Shell.AppSystem.get_default(); + + const APPLICATION_ICON_SIZE = 32;