From 656efd33afb25ab66989a5cfe14cca6ce94bb1a4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 22 Feb 2023 01:39:21 +0100 Subject: [PATCH] Update to drop GTK3 dependency There's a few things going on here, that unfortunately must happen in lockstep: - The gnome-desktop-3.0 dependency gets replaced by gnome-desktop-4 and gnome-bg-4. The code in ui/background.js required minor updates. - The libnma dependency gets replaced by a libnma4 dependency. The code in misc/modemManager.js required minor updates. - The gtk3 dependency is torn down everywhere but tests. Some missing GdkPixbuf dependencies had to be added to compensate for its lack. - gtk_init_check() is no longer called As a result, we replace a hard gtk3 dependency with a soft gtk4 run-time linking one, only added indirectly through gnome-bg-4 and libnma4. Part-of: --- js/misc/modemManager.js | 4 ++-- js/ui/background.js | 4 ++-- js/ui/environment.js | 7 +++---- meson.build | 4 ++-- src/main.c | 7 +------ src/meson.build | 6 +++--- src/st/meson.build | 4 ++-- 7 files changed, 15 insertions(+), 21 deletions(-) diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js index 3c2979577..c31bf5b6b 100644 --- a/js/misc/modemManager.js +++ b/js/misc/modemManager.js @@ -1,7 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported ModemBase, ModemGsm, ModemCdma, BroadbandModem */ -const { Gio, GObject, NM, NMA } = imports.gi; +const {Gio, GObject, NM, NMA4} = imports.gi; const { loadInterfaceXML } = imports.misc.fileUtils; @@ -14,7 +14,7 @@ let _mpd; function _getMobileProvidersDatabase() { if (_mpd == null) { try { - _mpd = new NMA.MobileProvidersDatabase(); + _mpd = new NMA4.MobileProvidersDatabase(); _mpd.init(null); } catch (e) { log(e.message); diff --git a/js/ui/background.js b/js/ui/background.js index cd97c8946..a1f660108 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -94,7 +94,7 @@ // MetaBackgroundImage MetaBackgroundImage // MetaBackgroundImage MetaBackgroundImage -const { Clutter, GDesktopEnums, Gio, GLib, GObject, GnomeDesktop, Meta } = imports.gi; +const {Clutter, GDesktopEnums, Gio, GLib, GObject, GnomeBG, GnomeDesktop, Meta} = imports.gi; const Signals = imports.misc.signals; const LoginManager = imports.misc.loginManager; @@ -642,7 +642,7 @@ var BackgroundSource = class BackgroundSource { }; var Animation = GObject.registerClass( -class Animation extends GnomeDesktop.BGSlideShow { +class Animation extends GnomeBG.BGSlideShow { _init(params) { super._init(params); diff --git a/js/ui/environment.js b/js/ui/environment.js index c2088c394..a1863268c 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -9,21 +9,20 @@ imports.gi.versions.Atspi = '2.0'; imports.gi.versions.Clutter = Config.LIBMUTTER_API_VERSION; imports.gi.versions.Cogl = Config.LIBMUTTER_API_VERSION; imports.gi.versions.Gcr = '4'; -imports.gi.versions.Gdk = '3.0'; imports.gi.versions.Gdm = '1.0'; imports.gi.versions.Geoclue = '2.0'; imports.gi.versions.Gio = '2.0'; imports.gi.versions.GDesktopEnums = '3.0'; imports.gi.versions.GdkPixbuf = '2.0'; imports.gi.versions.GnomeBluetooth = '3.0'; -imports.gi.versions.GnomeDesktop = '3.0'; +imports.gi.versions.GnomeBG = '4.0'; +imports.gi.versions.GnomeDesktop = '4.0'; imports.gi.versions.Graphene = '1.0'; -imports.gi.versions.Gtk = '3.0'; imports.gi.versions.GWeather = '4.0'; imports.gi.versions.IBus = '1.0'; imports.gi.versions.Malcontent = '0'; imports.gi.versions.NM = '1.0'; -imports.gi.versions.NMA = '1.0'; +imports.gi.versions.NMA4 = '1.0'; imports.gi.versions.Pango = '1.0'; imports.gi.versions.Polkit = '1.0'; imports.gi.versions.PolkitAgent = '1.0'; diff --git a/meson.build b/meson.build index ef211d774..2017c57bd 100644 --- a/meson.build +++ b/meson.build @@ -30,7 +30,7 @@ polkit_req = '>= 0.100' schemas_req = '>= 42.beta' startup_req = '>= 0.11' ibus_req = '>= 1.5.19' -gnome_desktop_req = '>= 3.35.90' +gnome_desktop_req = '>= 40' nm_req = '>= 1.10.4' secret_req = '>= 0.18' @@ -89,7 +89,7 @@ startup_dep = dependency('libstartup-notification-1.0', version: startup_req) ibus_dep = dependency('ibus-1.0', version: ibus_req) x11_dep = dependency('x11') schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req) -gnome_desktop_dep = dependency('gnome-desktop-3.0', version: gnome_desktop_req) +gnome_desktop_dep = dependency('gnome-desktop-4', version: gnome_desktop_req) nm_deps = [] if get_option('networkmanager') diff --git a/src/main.c b/src/main.c index 5e5c20751..8cccc0a0d 100644 --- a/src/main.c +++ b/src/main.c @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -474,12 +473,8 @@ list_modes (const char *option_name, /* Many of our imports require global to be set, so rather than * tayloring our imports carefully here to avoid that dependency, - * we just set it. - * ShellGlobal has some GTK+ dependencies, so initialize GTK+; we - * don't really care if it fails though (e.g. when running from a tty), - * so we mute all warnings */ + * we just set it. */ g_log_set_writer_func (shut_up, NULL, NULL); - gtk_init_check (NULL, NULL); _shell_global_init (NULL); global = shell_global_get (); diff --git a/src/meson.build b/src/meson.build index 148d26947..398cd482f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -54,10 +54,9 @@ install_rpath = ':'.join([mutter_typelibdir, pkglibdir]) gnome_shell_deps = [ gio_unix_dep, libxml_dep, - gtk_dep, atk_bridge_dep, + gdk_pixbuf_dep, gjs_dep, - gdk_x11_dep, clutter_dep, cogl_pango_dep, startup_dep, @@ -215,7 +214,8 @@ libshell_gir_includes = [ 'Clutter-@0@'.format(mutter_api_version), 'Meta-@0@'.format(mutter_api_version), 'Gcr-4', - 'PolkitAgent-1.0' + 'PolkitAgent-1.0', + 'GdkPixbuf-2.0' ] if have_networkmanager diff --git a/src/st/meson.build b/src/st/meson.build index 061c5adf2..7369821f5 100644 --- a/src/st/meson.build +++ b/src/st/meson.build @@ -182,7 +182,7 @@ st_cflags = [ libst = shared_library('st-1.0', sources: st_gir_sources + st_nogir_sources + croco_sources, c_args: st_cflags, - dependencies: [clutter_dep, gtk_dep, mutter_dep, libxml_dep, m_dep], + dependencies: [clutter_dep, mutter_dep, libxml_dep, gdk_pixbuf_dep, m_dep], build_rpath: mutter_typelibdir, install_rpath: mutter_typelibdir, install_dir: pkglibdir, @@ -213,7 +213,7 @@ libst_gir = gnome.generate_gir(libst, sources: st_gir_sources, nsversion: '1.0', namespace: 'St', - includes: ['Clutter-' + mutter_api_version, 'Cally-' + mutter_api_version, 'Meta-' + mutter_api_version, 'Gtk-3.0'], + includes: ['Clutter-' + mutter_api_version, 'Cally-' + mutter_api_version, 'Meta-' + mutter_api_version], dependencies: [mutter_dep], include_directories: include_directories('..'), extra_args: ['-DST_COMPILATION', '--quiet'],