[122610] users/devans/GNOME-3/stable/dports/gnome/gnome-maps

juanrgar at macports.org juanrgar at macports.org
Thu Jul 24 12:11:01 PDT 2014


Revision: 122610
          https://trac.macports.org/changeset/122610
Author:   juanrgar at macports.org
Date:     2014-07-24 12:11:01 -0700 (Thu, 24 Jul 2014)
Log Message:
-----------
GNOME-3/stable: gnome-maps, add patches to avoid crash

Add patches to avoid crash due to GeoClue not available and disable user 
location UI.

Modified Paths:
--------------
    users/devans/GNOME-3/stable/dports/gnome/gnome-maps/Portfile

Added Paths:
-----------
    users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/
    users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-disable-location-button.diff
    users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-add-connected.diff
    users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-handle-not-avail.diff

Modified: users/devans/GNOME-3/stable/dports/gnome/gnome-maps/Portfile
===================================================================
--- users/devans/GNOME-3/stable/dports/gnome/gnome-maps/Portfile	2014-07-24 19:05:15 UTC (rev 122609)
+++ users/devans/GNOME-3/stable/dports/gnome/gnome-maps/Portfile	2014-07-24 19:11:01 UTC (rev 122610)
@@ -37,6 +37,10 @@
 depends_run         port:gnome-settings-daemon \
                     port:yelp
 
+patchfiles          patch-geoclue-handle-not-avail.diff \
+                    patch-geoclue-add-connected.diff \
+                    patch-disable-location-button.diff
+
 configure.args      --disable-silent-rules
 
 # update m4/intltool.m4 and autoreconf

Added: users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-disable-location-button.diff
===================================================================
--- users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-disable-location-button.diff	                        (rev 0)
+++ users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-disable-location-button.diff	2014-07-24 19:11:01 UTC (rev 122610)
@@ -0,0 +1,22 @@
+--- src/mainWindow.js.orig	2014-07-24 20:31:54.000000000 +0200
++++ src/mainWindow.js	2014-07-24 20:33:27.000000000 +0200
+@@ -25,6 +25,7 @@
+ const GLib = imports.gi.GLib;
+ const Gtk = imports.gi.Gtk;
+ const Champlain = imports.gi.Champlain;
++const GObject = imports.gi.GObject;
+ 
+ const Lang = imports.lang;
+ const Mainloop = imports.mainloop;
+@@ -137,6 +138,11 @@
+                 signalHandlers: { activate: this._onGotoUserLocationActivate }
+             }
+         ], this);
++
++        let action = this.window.lookup_action('goto-user-location');
++        this.mapView.geoclue.bind_property('connected',
++                                           action, 'enabled',
++                                           GObject.BindingFlags.SYNC_CREATE);
+     },
+ 
+     _initSignals: function() {

Added: users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-add-connected.diff
===================================================================
--- users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-add-connected.diff	                        (rev 0)
+++ users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-add-connected.diff	2014-07-24 19:11:01 UTC (rev 122610)
@@ -0,0 +1,41 @@
+--- src/geoclue.js.orig1	2014-07-24 20:40:44.000000000 +0200
++++ src/geoclue.js	2014-07-24 20:40:52.000000000 +0200
+@@ -79,6 +79,18 @@
+ 
+ const Geoclue = new Lang.Class({
+     Name: 'Geoclue',
++    Extends: GObject.Object,
++    Properties: {
++        'connected': GObject.ParamSpec.boolean('connected',
++                                               'Connected',
++                                               'Connected to DBus service',
++                                               GObject.ParamFlags.READABLE,
++                                               false)
++    },
++
++    get connected() {
++        return this._connected;
++    },
+ 
+     overrideLocation: function(location) {
+         if (this._clientProxy && this._locationUpdatedId > 0) {
+@@ -110,6 +122,9 @@
+     },
+ 
+     _init: function() {
++        this.parent();
++        this._connected = false;
++
+         let lastLocation = Application.settings.get('last-location');
+         if (lastLocation.length >= 3) {
+             let [lat, lng, accuracy] = lastLocation;
+@@ -149,6 +164,9 @@
+ 
+         if (!this.userSetLocation)
+             this.findLocation();
++
++        this._connected = true;
++        this.notify('connected');
+     },
+ 
+     _onLocationUpdated: function(proxy, sender, [oldPath, newPath]) {

Added: users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-handle-not-avail.diff
===================================================================
--- users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-handle-not-avail.diff	                        (rev 0)
+++ users/devans/GNOME-3/stable/dports/gnome/gnome-maps/files/patch-geoclue-handle-not-avail.diff	2014-07-24 19:11:01 UTC (rev 122610)
@@ -0,0 +1,43 @@
+--- src/geoclue.js.orig	2014-07-24 20:26:13.000000000 +0200
++++ src/geoclue.js	2014-07-24 20:27:24.000000000 +0200
+@@ -81,7 +81,7 @@
+     Name: 'Geoclue',
+ 
+     overrideLocation: function(location) {
+-        if (this._locationUpdatedId > 0) {
++        if (this._clientProxy && this._locationUpdatedId > 0) {
+             this._clientProxy.disconnectSignal(this._locationUpdatedId);
+             this._locationUpdatedId = 0;
+             this._clientProxy.StopRemote(function(result, e) {
+@@ -95,6 +95,9 @@
+     },
+ 
+     findLocation: function() {
++        if (!this._clientProxy)
++            return;
++
+         this._locationUpdatedId =
+             this._clientProxy.connectSignal("LocationUpdated",
+                                             this._onLocationUpdated.bind(this));
+@@ -118,11 +121,16 @@
+             this.userSetLocation = Application.settings.get('last-location-user-set');
+         }
+ 
+-        this._managerProxy = new ManagerProxy(Gio.DBus.system,
+-                                              "org.freedesktop.GeoClue2",
+-                                              "/org/freedesktop/GeoClue2/Manager");
+-
+-        this._managerProxy.GetClientRemote(this._onGetClientReady.bind(this));
++        try {
++            this._managerProxy = new ManagerProxy(Gio.DBus.system,
++                                                  "org.freedesktop.GeoClue2",
++                                                  "/org/freedesktop/GeoClue2/Manager");
++
++            this._managerProxy.GetClientRemote(this._onGetClientReady.bind(this));
++        } catch (e) {
++            Utils.debug("Failed to connect to GeoClue2 service: " + e.message);
++            log('Connection with GeoClue failed, we are not able to find your location!');
++        }
+     },
+ 
+     _onGetClientReady: function(result, e) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140724/4bd98a0d/attachment.html>


More information about the macports-changes mailing list