summary refs log tree commit diff
path: root/pkgs/development/libraries/geoclue
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-04-14 02:30:43 +0200
committerJan Tojnar <jtojnar@gmail.com>2021-04-14 02:34:36 +0200
commit80e5df8b5a07126f06d358283867fb70c2a1ee2c (patch)
treefd4885ce356cc7829e4e512a503508bed4b26f09 /pkgs/development/libraries/geoclue
parent0fc0dd22ffc2e3b68585ae4a62c3b7beac852620 (diff)
downloadnixpkgs-80e5df8b5a07126f06d358283867fb70c2a1ee2c.tar
nixpkgs-80e5df8b5a07126f06d358283867fb70c2a1ee2c.tar.gz
nixpkgs-80e5df8b5a07126f06d358283867fb70c2a1ee2c.tar.bz2
nixpkgs-80e5df8b5a07126f06d358283867fb70c2a1ee2c.tar.lz
nixpkgs-80e5df8b5a07126f06d358283867fb70c2a1ee2c.tar.xz
nixpkgs-80e5df8b5a07126f06d358283867fb70c2a1ee2c.tar.zst
nixpkgs-80e5df8b5a07126f06d358283867fb70c2a1ee2c.zip
geoclue2: Use our own Mozilla API key
https://github.com/NixOS/nixpkgs/issues/110031#issuecomment-777078988
Diffstat (limited to 'pkgs/development/libraries/geoclue')
-rw-r--r--pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch7
-rw-r--r--pkgs/development/libraries/geoclue/default.nix13
2 files changed, 18 insertions, 2 deletions
diff --git a/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch b/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch
index 9eb53acebb0..63948ab4fad 100644
--- a/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch
+++ b/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch
@@ -65,17 +65,20 @@ index fde6fa3..39b7b0a 100644
  conf.set_quoted('LOCALEDIR', localedir)
 -conf.set_quoted('SYSCONFDIR', sysconfdir)
 +conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
+ conf.set_quoted('MOZILLA_API_KEY', get_option('mozilla-api-key'))
  conf.set10('GCLUE_USE_3G_SOURCE', get_option('3g-source'))
  conf.set10('GCLUE_USE_CDMA_SOURCE', get_option('cdma-source'))
- conf.set10('GCLUE_USE_MODEM_GPS_SOURCE', get_option('modem-gps-source'))
 diff --git a/meson_options.txt b/meson_options.txt
 index 83bc60e..b726329 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
-@@ -34,3 +34,6 @@ option('systemd-system-unit-dir',
+@@ -34,6 +34,9 @@ option('systemd-system-unit-dir',
  option('dbus-srv-user',
         type: 'string', value: 'root',
         description: 'The user (existing) as which the service will run')
 +option('sysconfdir_install',
 +       type: 'string', value: '',
 +       description: 'sysconfdir to use during installation')
+ option('mozilla-api-key',
+        type: 'string', value: 'geoclue',
+        description: 'Your API key for Mozilla Location Service')
diff --git a/pkgs/development/libraries/geoclue/default.nix b/pkgs/development/libraries/geoclue/default.nix
index 3e7e295c853..360094ea765 100644
--- a/pkgs/development/libraries/geoclue/default.nix
+++ b/pkgs/development/libraries/geoclue/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitLab
+, fetchpatch
 , intltool
 , meson
 , ninja
@@ -38,6 +39,17 @@ stdenv.mkDerivation rec {
   };
 
   patches = [
+    # Make the Mozilla API key configurable
+    # https://gitlab.freedesktop.org/geoclue/geoclue/merge_requests/54 (only partially backported)
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/geoclue/geoclue/commit/95c9ad4dc176860c85a07d0db4cb4179929bdb54.patch";
+      sha256 = "/lq/dLBJl2vf16tt7emYoTtXY6iUw+4s2XcABUHp3Kc=";
+    })
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/geoclue/geoclue/commit/1a00809a0d89b0849a57647c878d192354247a33.patch";
+      sha256 = "6FuiukgFWg2cEKt8LlKP4E0rfSH/ZQgk6Ip1mGJpNFQ=";
+    })
+
     ./add-option-for-installation-sysconfdir.patch
   ];
 
@@ -77,6 +89,7 @@ stdenv.mkDerivation rec {
     "-Ddemo-agent=${lib.boolToString withDemoAgent}"
     "--sysconfdir=/etc"
     "-Dsysconfdir_install=${placeholder "out"}/etc"
+    "-Dmozilla-api-key=5c28d1f4-9511-47ff-b11a-2bef80fc177c"
     "-Ddbus-srv-user=geoclue"
     "-Ddbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
   ] ++ lib.optionals stdenv.isDarwin [