From 776c0b39941c52c7f0d01f16eff473c483f60807 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Nov 20 2023 07:55:08 +0000 Subject: [gnome-weather]: upgrade to v45.0 --- diff --git a/nonprism/gnome-weather/PKGBUILD b/nonprism/gnome-weather/PKGBUILD index 4c4eb39..2acf0f2 100644 --- a/nonprism/gnome-weather/PKGBUILD +++ b/nonprism/gnome-weather/PKGBUILD @@ -1,49 +1,64 @@ +# Maintainer (arch): Fabian Bornschein +# Maintainer (arch): Jan Alexander Steffens (heftig) # Maintainer: Andreas Grapentin -# Maintainer (arch): Jan Alexander Steffens (heftig) # Contributor: André Silva -pkgname=gnome-weather -pkgver=3.26.0 -pkgrel=1.nonprism1 -arch=(any) +# parabola changes and rationale: +# privacy: +# - removed geoclue support +# technical: +# - build from versioned source-ball, rather than VCS sources + -pkgdesc="Access current weather conditions and forecasts, without geoclue2 support" +pkgname=gnome-weather +pkgver=45.0 +pkgrel=1 +pkgrel+=.nonprism1 +pkgdesc="Access current weather conditions and forecasts" +pkgdesc+=", without geoclue support" url="https://wiki.gnome.org/Apps/Weather" +arch=(any) license=(GPL) +depends=( + geoclue + gjs + gtk4 + libadwaita + libgweather-4 +) +depends=( ${depends[*]/geoclue/} ) # privacy +makedepends=( + appstream-glib + git + gobject-introspection + meson +) +makedepends=( ${makedepends[*]/git/} ) +groups=(gnome) +source=(https://download.gnome.org/sources/gnome-weather/45/gnome-weather-45.0.tar.xz) +source+=(nonprism.patch) +sha256sums=('30c0029702883dc8d8160e6de1d6116877cd6c25bc950d4e4902a6ab467b2fa4') +sha256sums+=('226c05dfc345ab4d8ed6b21686d10799a98e65a7050602d944d70208d718d19a') -makedepends=(intltool gobject-introspection autoconf-archive appstream-glib git) -depends=(gtk3 gjs libgweather gnome-desktop) -groups=(gnome-extra) - -_commit=608877f993ab001666d9ca843c23c98c16459abe # tags/3.26.0^0 -source=("git+https://git.gnome.org/browse/gnome-weather#commit=$_commit" - "nonprism.patch") -sha256sums=('SKIP' - '982ac0d22e5e46adc97d5b9b964a13c3c036f9525b42b05fc56946a1d114f0de') - -pkgver() { - cd $pkgname - - git describe --tags | sed 's/-/+/g' -} prepare() { - cd $pkgname + cd ${pkgname}-${pkgver} - patch -p1 -i $srcdir/nonprism.patch - NOCONFIGURE=1 ./autogen.sh + echo "applying nonprism.patch" + patch -p1 -i ${srcdir}/nonprism.patch } build() { - cd $pkgname + arch-meson ${pkgname}-${pkgver} build + meson compile -C build +} - ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var - make +check() { + meson test -C build --print-errorlogs } package() { - cd $pkgname - - make DESTDIR="$pkgdir" install + meson install -C build --destdir "$pkgdir" } + diff --git a/nonprism/gnome-weather/nonprism.patch b/nonprism/gnome-weather/nonprism.patch index df6da2e..985a4bd 100644 --- a/nonprism/gnome-weather/nonprism.patch +++ b/nonprism/gnome-weather/nonprism.patch @@ -1,69 +1,77 @@ -diff --git a/configure.ac b/configure.ac -index f5810bd5d..d3d20a540 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -33,7 +33,6 @@ PKG_CHECK_MODULES([DEPS], [gdk-3.0 - glib-2.0 - gobject-2.0 - gtk+-3.0 >= 3.11.4 -- libgeoclue-2.0 >= 2.3.1 - gjs-1.0 >= $GJS_MIN_VERSION - gweather-3.0 >= 3.17.2]) - -diff --git a/data/org.gnome.Weather.Application.desktop.in b/data/org.gnome.Weather.Application.desktop.in -index 3cd54ba2e..9d59b4699 100644 ---- a/data/org.gnome.Weather.Application.desktop.in -+++ b/data/org.gnome.Weather.Application.desktop.in -@@ -8,4 +8,3 @@ DBusActivatable=true - StartupNotify=true +diff --git a/data/org.gnome.Weather.desktop.in.in b/data/org.gnome.Weather.desktop.in.in +index 021e0d5..3f5c4a4 100644 +--- a/data/org.gnome.Weather.desktop.in.in ++++ b/data/org.gnome.Weather.desktop.in.in +@@ -10,6 +10,5 @@ StartupNotify=true Categories=GNOME;GTK;Utility;Core; - _Keywords=Weather;Forecast; --_X-Geoclue-Reason=Allows weather information to be displayed for your location. + # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! + Keywords=Weather;Forecast; +-X-Geoclue-Reason=Allows weather information to be displayed for your location. + # Translators: Do NOT translate or transliterate this text (these are enum types)! + X-Purism-FormFactor=Workstation;Mobile; + +diff --git a/meson.build b/meson.build +index 62d6594..f17fabe 100644 +--- a/meson.build ++++ b/meson.build +@@ -11,7 +11,6 @@ dependency('glib-2.0') + dependency('gobject-introspection-1.0', version: '>=1.35.9') + dependency('gtk4', version :'>=4.5') + gjs = dependency('gjs-1.0', version: '>= 1.71.0') +-dependency('libgeoclue-2.0', version: '>= 0.12.99') + dependency('libadwaita-1', version: '>= 1.4.alpha') + dependency('gweather4', version: '>= 3.90.0') + diff --git a/src/app/currentLocationController.js b/src/app/currentLocationController.js -index c070598b3..10b436d54 100644 +index 772b9b5..2332157 100644 --- a/src/app/currentLocationController.js +++ b/src/app/currentLocationController.js -@@ -20,104 +20,14 @@ const GLib = imports.gi.GLib; - const Gio = imports.gi.Gio; - const Lang = imports.lang; - const GWeather = imports.gi.GWeather; --const Geoclue = imports.gi.Geoclue; +@@ -18,7 +18,6 @@ - const Util = imports.misc.util; + import GLib from 'gi://GLib'; + import GWeather from 'gi://GWeather'; +-import Geoclue from 'gi://Geoclue'; --var AutoLocation = { -- DISABLED: 0, -- ENABLED: 1, -- NOT_AVAILABLE: 2 --}; -- - var CurrentLocationController = class CurrentLocationController { - constructor(world) { - this._world = world; + import * as Util from '../misc/util.js'; + export class CurrentLocationController { +@@ -27,92 +26,12 @@ export class CurrentLocationController { this._processStarted = false; - this._settings = Util.getSettings('org.gnome.Weather.Application'); -- let autoLocation = this._settings.get_value('automatic-location').deep_unpack(); -- this._syncAutoLocation(autoLocation); -- if (this.autoLocation == AutoLocation.ENABLED) -- this._startGeolocationService(); + this._settings = Util.getSettings('org.gnome.Weather'); + +- this.autoLocationAvailable = false; +- this._startGeolocationService(); this.currentLocation = null; - } -- +- } + - _startGeolocationService() { - this._processStarted = true; -- Geoclue.Simple.new(pkg.name, -- Geoclue.AccuracyLevel.CITY, -- null, -- this._onSimpleReady.bind(this)); +- if (Geoclue.Simple.new_with_thresholds) { +- Geoclue.Simple.new_with_thresholds(pkg.name, +- Geoclue.AccuracyLevel.CITY, +- 0, /* time threshold */ +- 100, /* distance threshold */ +- null, +- (object, result) => { +- this._onSimpleReady(object, result) +- }); +- } else { +- Geoclue.Simple.new(pkg.name, +- Geoclue.AccuracyLevel.CITY, +- null, +- (object, result) => { +- this._onSimpleReady(object, result) +- }); +- } - } - - _geoLocationFailed(e) { - log ("Failed to connect to GeoClue2 service: " + e.message); -- this.autoLocation = AutoLocation.NOT_AVAILABLE; -- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { -- this._world.currentLocationChanged(null); -- }); -- } ++ log ("GeoClue2 service disabled"); + this.autoLocationAvailable = false; + GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { + this._world.currentLocationChanged(null); + }); + } - - _onSimpleReady(object, result) { - try { @@ -74,16 +82,22 @@ index c070598b3..10b436d54 100644 - return; - } - -- let client = this._simple.get_client(); -- client.distance_threshold = 100; +- // geoclue doesn't use a client proxy inside a flatpak sandbox +- if (this._simple.client && !Geoclue.Simple.new_with_thresholds) { +- let client = this._simple.get_client(); +- client.distance_threshold = 100; +- } - - this._findLocation(); +- +- this.autoLocationAvailable = true; - } - - _findLocation() { - this._locationUpdatedId = -- this._simple.connect("notify::location", -- this._onLocationUpdated.bind(this)); +- this._simple.connect("notify::location", (simple) => { +- this._onLocationUpdated(simple); +- }); - - this._onLocationUpdated(this._simple); - } @@ -91,37 +105,23 @@ index c070598b3..10b436d54 100644 - _onLocationUpdated(simple) { - let geoclueLocation = simple.get_location(); - -- this.currentLocation = GWeather.Location.new_detached(geoclueLocation.description, -- null, -- geoclueLocation.latitude, -- geoclueLocation.longitude); +- this.currentLocation = GWeather.Location.get_world() +- .find_nearest_city( +- geoclueLocation.latitude, +- geoclueLocation.longitude +- ); - this._world.currentLocationChanged(this.currentLocation); - } - -- setAutoLocation(active) { -- this._settings.set_value('automatic-location', new GLib.Variant('b', active)); -- -- if (this.autoLocation == AutoLocation.NOT_AVAILABLE) -- return; -- this._autoLocationChanged(active); -- this._syncAutoLocation(active); -- } -- -- _syncAutoLocation(autoLocation) { -- if (autoLocation) -- this.autoLocation = AutoLocation.ENABLED; -- else -- this.autoLocation = AutoLocation.DISABLED; -- } -- - _autoLocationChanged(active) { - if (active) { - if (!this._processStarted) { - this._startGeolocationService(); - } else { - this._locationUpdatedId = -- this._simple.connect("notify::location", -- this._onLocationUpdated.bind(this)); +- this._simple.connect("notify::location", (simple) => { +- this._onLocationUpdated(simple); +- }); - } - } else { - this._simple.disconnect(this._locationUpdatedId);