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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2776>
This commit is contained in:
Florian Müllner 2023-05-24 17:09:55 +02:00 committed by Marge Bot
parent 679fb5a11e
commit ba43c61917
5 changed files with 0 additions and 57 deletions

View File

@ -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 */

View File

@ -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)

View File

@ -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;

View File

@ -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')

View File

@ -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'
)