From a0372901d17eb32565964d2a8ddf594cdd56bd98 Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Thu, 26 Apr 2018 17:09:06 +0200 Subject: [PATCH] Always build and install the demo agent 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 | 20 +++++--------------- data/Makefile.am | 5 ----- demo/Makefile.am | 5 +++-- demo/geoclue-demo-agent.desktop.in.in | 1 + 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index 3c0467a..00e0890 100644 --- a/configure.ac +++ b/configure.ac @@ -162,21 +162,11 @@ fi 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)]), - [enable_demo_agent=$enableval], - [enable_demo_agent=no]) -if test "x$enable_demo_agent" = "xyes"; then - PKG_CHECK_MODULES(DEMO_AGENT, [ - glib-2.0 >= $GLIB_MIN_VERSION - gio-2.0 >= $GLIB_MIN_VERSION - gio-unix-2.0 >= $GLIB_MIN_VERSION - libnotify]) -else - AC_DEFINE([BUILD_DEMO_AGENT], [0], [Build demo agent?]) -fi -AM_CONDITIONAL([BUILD_DEMO_AGENT], [test "x$enable_demo_agent" = "xyes"]) +PKG_CHECK_MODULES(DEMO_AGENT, [ + glib-2.0 >= $GLIB_MIN_VERSION + gio-2.0 >= $GLIB_MIN_VERSION + gio-unix-2.0 >= $GLIB_MIN_VERSION + libnotify]) GNOME_COMPILE_WARNINGS([maximum]) diff --git a/data/Makefile.am b/data/Makefile.am index fc837d0..be5d2ea 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -6,15 +6,10 @@ if BUILD_BACKEND systemconfdir = $(sysconfdir)/geoclue systemconf_DATA = $(systemconf_in_files:.conf.in=.conf) -if BUILD_DEMO_AGENT $(systemconf_DATA): $(systemconf_in_files) Makefile @sed -e \ "s|\@demo_agent\@|geoclue-demo-agent;|" \ $< > $@ -else -$(systemconf_DATA): $(systemconf_in_files) Makefile - @sed -e "s|\@demo_agent\@||" $< > $@ -endif servicedir = $(datadir)/dbus-1/system-services service_DATA = $(service_in_files:.service.in=.service) diff --git a/demo/Makefile.am b/demo/Makefile.am index b1ac99c..50a738b 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -21,6 +21,9 @@ appsdir = $(datadir)/applications apps_DATA = geoclue-where-am-i.desktop \ geoclue-demo-agent.desktop +autostartdir = $(sysconfdir)/xdg/autostart +autostart_DATA = geoclue-demo-agent.desktop + @INTLTOOL_DESKTOP_RULE@ geoclue-where-am-i.desktop.in: geoclue-where-am-i.desktop.in.in @@ -29,9 +32,7 @@ geoclue-where-am-i.desktop.in: geoclue-where-am-i.desktop.in.in geoclue-demo-agent.desktop.in: geoclue-demo-agent.desktop.in.in $(AM_V_GEN) sed -e "s|[@]libexecdir@|$(libexecdir)|g" $< > $@ -if BUILD_DEMO_AGENT demo_PROGRAMS += agent -endif # BUILD_DEMO_AGENT agent_SOURCES = $(BUILT_SOURCES) \ gclue-service-agent.h \ 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