From ba43c6191798dd07f66693ec90e2808ec9954e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 24 May 2023 17:09:55 +0200 Subject: [PATCH] build: Remove Soup2 support We started to support Soup3 in GNOME 41, and used it by default since GNOME 43. This should be enough time for distros to adapt, so GNOME 45 looks like a good moment to drop the old Soup2 support. Part-of: --- js/misc/config.js.in | 2 -- js/misc/meson.build | 1 - js/ui/environment.js | 46 -------------------------------------------- meson.build | 2 -- meson_options.txt | 6 ------ 5 files changed, 57 deletions(-) diff --git a/js/misc/config.js.in b/js/misc/config.js.in index 8ef427037..5684ef69c 100644 --- a/js/misc/config.js.in +++ b/js/misc/config.js.in @@ -7,8 +7,6 @@ var PACKAGE_NAME = '@PACKAGE_NAME@'; var PACKAGE_VERSION = '@PACKAGE_VERSION@'; /* 1 if networkmanager is available, 0 otherwise */ var HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@; -/* 1 if soup2 should be used instead of soup3, 0 otherwise */ -var HAVE_SOUP2 = @HAVE_SOUP2@; /* gettext package */ var GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@'; /* locale dir */ diff --git a/js/misc/meson.build b/js/misc/meson.build index 2dff20dec..5aceefac4 100644 --- a/js/misc/meson.build +++ b/js/misc/meson.build @@ -4,7 +4,6 @@ jsconf.set('PACKAGE_VERSION', meson.project_version()) jsconf.set('GETTEXT_PACKAGE', meson.project_name()) jsconf.set('LIBMUTTER_API_VERSION', mutter_api_version) jsconf.set10('HAVE_NETWORKMANAGER', have_networkmanager) -jsconf.set10('HAVE_SOUP2', have_soup2) jsconf.set('datadir', datadir) jsconf.set('libexecdir', libexecdir) diff --git a/js/ui/environment.js b/js/ui/environment.js index 353cd35f6..09c9f031d 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -33,16 +33,6 @@ imports.gi.versions.TelepathyGLib = '0.12'; imports.gi.versions.TelepathyLogger = '0.2'; imports.gi.versions.UPowerGlib = '1.0'; -try { - if (Config.HAVE_SOUP2) - throw new Error('Soup3 support not enabled'); - const Soup_ = imports.gi.Soup; -} catch (e) { - imports.gi.versions.Soup = '2.4'; - const { Soup } = imports.gi; - _injectSoup3Compat(Soup); -} - const {Clutter, Gdk, Gio, GLib, GObject, Meta, Polkit, Shell, St} = imports.gi; const Gettext = imports.gettext; const System = imports.system; @@ -101,42 +91,6 @@ function _patchLayoutClass(layoutClass, styleProps) { } } -/** - * Mimick the Soup 3 APIs we use when falling back to Soup 2.4 - * - * @param {object} Soup 2.4 namespace - * @returns {void} - */ -function _injectSoup3Compat(Soup) { - Soup.StatusCode = Soup.KnownStatusCode; - - Soup.Message.new_from_encoded_form = - function (method, uri, form) { - const soupUri = new Soup.URI(uri); - soupUri.set_query(form); - return Soup.Message.new_from_uri(method, soupUri); - }; - Soup.Message.prototype.set_request_body_from_bytes = - function (contentType, bytes) { - this.set_request( - contentType, - Soup.MemoryUse.COPY, - new TextDecoder().decode(bytes.get_data())); - }; - - Soup.Session.prototype.send_and_read_async = - function (message, prio, cancellable, callback) { - this.queue_message(message, () => callback(this, message)); - }; - Soup.Session.prototype.send_and_read_finish = - function (message) { - if (message.status_code !== Soup.KnownStatusCode.OK) - return null; - - return message.response_body.flatten().get_as_bytes(); - }; -} - function _makeEaseCallback(params, cleanup) { let onComplete = params.onComplete; delete params.onComplete; diff --git a/meson.build b/meson.build index 7b08fe52d..dd0337486 100644 --- a/meson.build +++ b/meson.build @@ -112,8 +112,6 @@ else have_systemd = false endif -have_soup2 = get_option('soup2') - if get_option('man') if fs.exists('man/gnome-shell.1') install_man('man/gnome-shell.1') diff --git a/meson_options.txt b/meson_options.txt index 46ca8e785..2d317e602 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -39,9 +39,3 @@ option('systemd', value: true, description: 'Enable systemd integration' ) - -option('soup2', - type: 'boolean', - value: false, - description: 'Use Soup 2.4 instead of Soup 3. Must be in sync with libgweather' -)