From 8520eae10e9b919f015b862fcc6db0d2c0fa5cab Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Thu, 26 Apr 2018 17:09:06 +0200 Subject: [PATCH] Build and install the demo agent by default Most desktops don't have an agent. As a result, now that GeoClue refuses access without an agent, apps won't be able to obtain the location on those desktops. Installing the demo agent by default keeps things working just the same for those desktops: all accesses will continue being granted. However, since GNOME has its own agent, we don't want the demo agent to run on GNOME. https://bugs.freedesktop.org/show_bug.cgi?id=106236 --- configure.ac | 4 ++-- demo/Makefile.am | 9 +++++++++ demo/geoclue-demo-agent.desktop.in.in | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3c0467a..c46b02f 100644 --- a/configure.ac +++ b/configure.ac @@ -164,9 +164,9 @@ AM_CONDITIONAL([BUILD_BACKEND], [test "x$build_backend" = "xyes"]) # Demo agent AC_ARG_ENABLE(demo-agent, AS_HELP_STRING([--enable-demo-agent=yes|no], - [Build demo agent (default=no)]), + [Build demo agent (default=yes)]), [enable_demo_agent=$enableval], - [enable_demo_agent=no]) + [enable_demo_agent=yes]) if test "x$enable_demo_agent" = "xyes"; then PKG_CHECK_MODULES(DEMO_AGENT, [ glib-2.0 >= $GLIB_MIN_VERSION diff --git a/demo/Makefile.am b/demo/Makefile.am index b1ac99c..b1f2c5b 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -18,8 +18,17 @@ where_am_i_LDADD = $(GEOCLUE_LIBS) \ ../libgeoclue/libgeoclue-2.la appsdir = $(datadir)/applications +if BUILD_DEMO_AGENT apps_DATA = geoclue-where-am-i.desktop \ geoclue-demo-agent.desktop +else +apps_DATA = geoclue-where-am-i.desktop +endif # BUILD_DEMO_AGENT + +if BUILD_DEMO_AGENT +autostartdir = $(sysconfdir)/xdg/autostart +autostart_DATA = geoclue-demo-agent.desktop +endif # BUILD_DEMO_AGENT @INTLTOOL_DESKTOP_RULE@ diff --git a/demo/geoclue-demo-agent.desktop.in.in b/demo/geoclue-demo-agent.desktop.in.in index ac52fa0..257f809 100644 --- a/demo/geoclue-demo-agent.desktop.in.in +++ b/demo/geoclue-demo-agent.desktop.in.in @@ -4,6 +4,7 @@ _GenericName=Demo geoclue agent _Keywords=geolocation; Exec=@libexecdir@/geoclue-2.0/demos/agent Icon=mark-location-symbolic +NotShowIn=GNOME; NoDisplay=true Terminal=false Type=Application -- 2.17.0