build: Add soup2 option

!1940 added support for soup 3, including a fallback to soup 2.4
where the newer version isn't available.

Unfortunately it missed that libgweather has a hidden soup dependency,
and now gnome-shell fails to start if a weather location has been set
up and soup 3 is available.

We don't have a good way to detect that case, so hide the soup 3 support
behind a build option. Distributors are expected to switch it at the
same time as libgweather.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1966>
This commit is contained in:
Florian Müllner
2021-08-29 14:24:42 +02:00
parent 66ba806838
commit 1d607cf18f
5 changed files with 13 additions and 0 deletions

View File

@ -12,6 +12,8 @@ imports.gi.versions.TelepathyGLib = '0.12';
imports.gi.versions.TelepathyLogger = '0.2';
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';