From d0fe638dbdfdfdf36990ff15cd9b14b5875498aa Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 2 Oct 2014 00:12:46 +0200 Subject: [PATCH] Look for private key of default geolocation service. * Let the jamfile set HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY if the header that is supposed to contain it is found in src/kits/shared (which isn't the case for normal builds). * In case HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY is set, include the corresponding header and activate Mozilla's geolocation service with the key defined in that header. This procedure should enable buildbot to create nightly images without exposing the private service key. --- src/kits/shared/Geolocation.cpp | 16 +++++++++++++--- src/kits/shared/Jamfile | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/kits/shared/Geolocation.cpp b/src/kits/shared/Geolocation.cpp index af6099b0ab..7d2f4e8485 100644 --- a/src/kits/shared/Geolocation.cpp +++ b/src/kits/shared/Geolocation.cpp @@ -141,9 +141,19 @@ BGeolocation::LocateSelf(float& latitude, float& longitude) } -// FIXME switch to an openly available service that will actually work with the -// "standard" geolocation API. Openbmap has a few variations. -const char* BGeolocation::kDefaultService = "http://openbmap.org/api/json.php5"; +#ifdef HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY + +#include "DefaultGeolocationServiceKey.h" + +const char* BGeolocation::kDefaultService + = "https://location.services.mozilla.com/v1/geolocate?key=" + DEFAULT_GEOLOCATION_SERVICE_KEY; + +#else + +const char* BGeolocation::kDefaultService = ""; + +#endif } // namespace BPrivate diff --git a/src/kits/shared/Jamfile b/src/kits/shared/Jamfile index 20cd4908d9..31858029b9 100644 --- a/src/kits/shared/Jamfile +++ b/src/kits/shared/Jamfile @@ -6,6 +6,10 @@ AddSubDirSupportedPlatforms libbe_test ; UseLibraryHeaders agg ; UsePrivateHeaders shared locale ; +if [ Glob $(SUBDIR) : DefaultGeolocationServiceKey.h ] { + SubDirC++Flags [ FDefines HAVE_DEFAULT_GEOLOCATION_SERVICE_KEY ] ; +} + local architectureObject ; for architectureObject in [ MultiArchSubDirSetup ] { on $(architectureObject) {