From 896ad8576a5cf5079b5823e24821897e5ef020bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 4 Aug 2025 08:04:30 +0200 Subject: [PATCH 1/2] environment: Work around introspection issue Methods of all classes from GioUnix erroneously show up as static methods, see https://gitlab.gnome.org/GNOME/glib/-/issues/3744. Work around this by defining the methods ourselves if we detect that case. --- js/ui/environment.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/ui/environment.js b/js/ui/environment.js index 77f09bf10c..bbbdf1d31d 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -8,6 +8,7 @@ import Cairo from 'cairo'; import Clutter from 'gi://Clutter'; import Gdk from 'gi://Gdk'; import Gio from 'gi://Gio'; +import GioUnix from 'gi://GioUnix'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; import Meta from 'gi://Meta'; @@ -340,6 +341,17 @@ Object.prototype.toString = function () { } }; +// Work around https://gitlab.gnome.org/GNOME/glib/-/issues/3744 +if (!GioUnix.DesktopAppInfo.prototype.has_key) { + GioUnix.DesktopAppInfo.prototype.has_key = function (key) { + return GioUnix.DesktopAppInfo.has_key(this, key); + }; + + GioUnix.DesktopAppInfo.prototype.get_categories = function () { + return GioUnix.DesktopAppInfo.get_categories(this); + }; +} + const slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR'); if (slowdownEnv) { let factor = parseFloat(slowdownEnv); -- GitLab From ff61aad0249f92a1b569bbce5aa5e61d8ae633ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 16 Jul 2025 19:06:34 +0200 Subject: [PATCH 2/2] Port to gjs-1.85/girepository-2.0 gjs ported from the stand-alone gobject-introspection-1.0 to the new girepository-2.0 library bundled with glib. Bump the requirements for gjs/glib and adjust to the (fairly minor) changes. --- .gitlab-ci.yml | 2 +- meson.build | 7 +++---- src/main.c | 23 +++++++++++++---------- src/run-js-test.c | 9 ++++++--- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1058c56b54..319c748d5b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ default: image: $MUTTER_CI_IMAGE variables: - MUTTER_CI_IMAGE: registry.gitlab.gnome.org/gnome/mutter/fedora/42:x86_64-2025-07-21.0 + MUTTER_CI_IMAGE: registry.gitlab.gnome.org/gnome/mutter/fedora/42:x86_64-2025-08-04.0 TARBALL_ARTIFACT_PATH: build/meson-dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.xz .pipeline-guard: diff --git a/meson.build b/meson.build index 66e1592f33..ce2215032d 100644 --- a/meson.build +++ b/meson.build @@ -21,9 +21,8 @@ libmutter_test_pc = 'libmutter-test-' + mutter_api_version ecal_req = '>= 3.33.1' eds_req = '>= 3.33.1' gcr_req = '>= 3.90.0' -gio_req = '>= 2.79.2' -gi_req = '>= 1.49.1' -gjs_req = '>= 1.81.2' +gio_req = '>= 2.85.1' +gjs_req = '>= 1.85.1' gtk_req = '>= 4.0' mutter_req = '>= 49.beta' polkit_req = '>= 0.100' @@ -73,7 +72,7 @@ ecal_dep = dependency('libecal-2.0', version: ecal_req) eds_dep = dependency('libedataserver-1.2', version: eds_req) gcr_dep = dependency('gcr-4', version: gcr_req) gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0') -gi_dep = dependency('gobject-introspection-1.0', version: gi_req) +gi_dep = dependency('girepository-2.0', version: gio_req) gio_dep = dependency('gio-2.0', version: gio_req) gio_unix_dep = dependency('gio-unix-2.0', version: gio_req) gjs_dep = dependency('gjs-1.0', version: gjs_req) diff --git a/src/main.c b/src/main.c index af4fa8597e..99eca3e3c9 100644 --- a/src/main.c +++ b/src/main.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -133,7 +133,7 @@ shell_dbus_init (gboolean replace) #ifdef HAVE_EXE_INTROSPECTION static void -maybe_add_rpath_introspection_paths (void) +maybe_add_rpath_introspection_paths (GIRepository *repo) { ElfW (Dyn) *dyn; ElfW (Dyn) *rpath = NULL; @@ -210,8 +210,8 @@ maybe_add_rpath_introspection_paths (void) g_debug ("Prepending RPATH directory '%s' " "to introsepciton library search path", rpath_dir->str); - g_irepository_prepend_search_path (rpath_dir->str); - g_irepository_prepend_library_path (rpath_dir->str); + gi_repository_prepend_search_path (repo, rpath_dir->str); + gi_repository_prepend_library_path (repo, rpath_dir->str); } } #endif /* HAVE_EXE_INTROSPECTION */ @@ -219,20 +219,23 @@ maybe_add_rpath_introspection_paths (void) static void shell_introspection_init (void) { + g_autoptr (GIRepository) repo = NULL; - g_irepository_prepend_search_path (MUTTER_TYPELIB_DIR); - g_irepository_prepend_search_path (SHELL_TYPELIB_DIR); + repo = gi_repository_dup_default (); + + gi_repository_prepend_search_path (repo, MUTTER_TYPELIB_DIR); + gi_repository_prepend_search_path (repo, SHELL_TYPELIB_DIR); /* We need to explicitly add the directories where the private libraries are * installed to the GIR's library path, so that they can be found at runtime * when linking using DT_RUNPATH (instead of DT_RPATH), which is the default * for some linkers (e.g. gold) and in some distros (e.g. Debian). */ - g_irepository_prepend_library_path (MUTTER_TYPELIB_DIR); - g_irepository_prepend_library_path (GNOME_SHELL_PKGLIBDIR); + gi_repository_prepend_library_path (repo, MUTTER_TYPELIB_DIR); + gi_repository_prepend_library_path (repo, GNOME_SHELL_PKGLIBDIR); #ifdef HAVE_EXE_INTROSPECTION - maybe_add_rpath_introspection_paths (); + maybe_add_rpath_introspection_paths (repo); #endif } @@ -611,7 +614,7 @@ main (int argc, char **argv) context = meta_create_context (WM_NAME); meta_context_add_option_entries (context, gnome_shell_options, GETTEXT_PACKAGE); - meta_context_add_option_group (context, g_irepository_get_option_group ()); + meta_context_add_option_group (context, gi_repository_get_option_group ()); session_mode = (char *) g_getenv ("GNOME_SHELL_SESSION_MODE"); diff --git a/src/run-js-test.c b/src/run-js-test.c index 4f795252c2..7a539d3a23 100644 --- a/src/run-js-test.c +++ b/src/run-js-test.c @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include "shell-global.h" @@ -64,6 +64,7 @@ int main (int argc, char **argv) { GOptionContext *context; + g_autoptr (GIRepository) repo = NULL; g_autoptr (GError) error = NULL; ShellGlobal *global; GjsContext *js_context; @@ -85,8 +86,10 @@ main (int argc, char **argv) global = shell_global_get (); js_context = _shell_global_get_gjs_context (global); - g_irepository_prepend_search_path (MUTTER_TYPELIB_DIR); - g_irepository_prepend_search_path (SHELL_TYPELIB_DIR); + repo = gi_repository_dup_default (); + + gi_repository_prepend_search_path (repo, MUTTER_TYPELIB_DIR); + gi_repository_prepend_search_path (repo, SHELL_TYPELIB_DIR); if (argc < 2) { -- GitLab