From patchwork Sat Feb 25 18:58:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47322 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C29E416AFC; Sat, 25 Feb 2023 19:01:02 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A962A16B70 for ; Sat, 25 Feb 2023 19:00:58 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVzm9-0002Wx-2u; Sat, 25 Feb 2023 14:00:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVzm7-0002W2-3N for guix-patches@gnu.org; Sat, 25 Feb 2023 14:00:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVzm6-0000q7-F7 for guix-patches@gnu.org; Sat, 25 Feb 2023 14:00:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVzm6-00081E-Bs for guix-patches@gnu.org; Sat, 25 Feb 2023 14:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61789] [PATCH 20/27] services: desktop: Deprecate 'geoclue-service' procedure. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Feb 2023 19:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61789 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61789@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61789-submit@debbugs.gnu.org id=B61789.167735156330691 (code B ref 61789); Sat, 25 Feb 2023 19:00:02 +0000 Received: (at 61789) by debbugs.gnu.org; 25 Feb 2023 18:59:23 +0000 Received: from localhost ([127.0.0.1]:41492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzlS-0007yw-Tf for submit@debbugs.gnu.org; Sat, 25 Feb 2023 13:59:23 -0500 Received: from smtpm7.myservices.hosting ([185.26.105.208]:59318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVzkb-0007sM-Me for 61789@debbugs.gnu.org; Sat, 25 Feb 2023 13:58:30 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm7.myservices.hosting (Postfix) with ESMTP id 9720F20D38 for <61789@debbugs.gnu.org>; Sat, 25 Feb 2023 19:58:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id A77C98009D; Sat, 25 Feb 2023 19:58:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id I38oc8BglHNl; Sat, 25 Feb 2023 19:58:24 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 7781680079; Sat, 25 Feb 2023 19:58:23 +0100 (CET) From: Bruno Victal Date: Sat, 25 Feb 2023 18:58:06 +0000 Message-Id: <37d20c1e196b03cfc432586ec58a569e65c98b9f.1677350250.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (Desktop Services): Replace 'geoclue-service' with 'geoclue-service-type'. * gnu/services/desktop.scm (): Set default values based on the values from the now deprecated geoclue-service procedure. (geoclue-service): Deprecate procedure. (desktop-services-for-system): Use geoclue-service-type. --- doc/guix.texi | 26 ++++++++--------- gnu/services/desktop.scm | 61 ++++++++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 39 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 2c9f55cd19..f9fb891df0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23625,20 +23625,18 @@ Desktop Services know the user's location. @end defvar -@deffn {Scheme Procedure} geoclue-service [#:colord @var{colord}] @ - [#:whitelist '()] @ - [#:wifi-geolocation-url "https://location.services.mozilla.com/v1/geolocate?key=geoclue"] @ - [#:submit-data? #f] - [#:wifi-submission-url "https://location.services.mozilla.com/v1/submit?key=geoclue"] @ - [#:submission-nick "geoclue"] @ - [#:applications %standard-geoclue-applications] -Return a service that runs the GeoClue location service. This service -provides a D-Bus interface to allow applications to request access to a -user's physical location, and optionally to add information to online -location databases. See -@uref{https://wiki.freedesktop.org/www/Software/GeoClue/, the GeoClue -web site} for more information. -@end deffn +@defvar geoclue-service-type +Type for the service that runs the +@url{https://wiki.freedesktop.org/www/Software/GeoClue/, GeoClue} +location service. This service provides a D-Bus interface to allow +applications to request access to a user's physical location, and +optionally to add information to online location databases. + +The value for this service is a @code{} object. +@end defvar + +@c TODO: Document , preferably by refactoring this to use +@c define-configuration and generating documentation from it. @deffn {Scheme Procedure} bluetooth-service [#:bluez @var{bluez}] @ [@w{#:auto-enable? #f}] diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 701c64a75d..c5212ee9aa 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -104,7 +104,7 @@ (define-module (gnu services desktop) geoclue-configuration geoclue-configuration? %standard-geoclue-applications - geoclue-service + geoclue-service ; deprecated geoclue-service-type bluetooth-service-type @@ -304,19 +304,6 @@ (define upower-service-type ;;; GeoClue D-Bus service. ;;; -;; TODO: Export. -(define-record-type* - geoclue-configuration make-geoclue-configuration - geoclue-configuration? - (geoclue geoclue-configuration-geoclue - (default geoclue)) - (whitelist geoclue-configuration-whitelist) - (wifi-geolocation-url geoclue-configuration-wifi-geolocation-url) - (submit-data? geoclue-configuration-submit-data?) - (wifi-submission-url geoclue-configuration-wifi-submission-url) - (submission-nick geoclue-configuration-submission-nick) - (applications geoclue-configuration-applications)) - (define* (geoclue-application name #:key (allowed? #t) system? (users '())) "Configure default GeoClue access permissions for an application. NAME is the Desktop ID of the application, without the .desktop part. If ALLOWED? is @@ -336,6 +323,28 @@ (define %standard-geoclue-applications (geoclue-application "epiphany" #:system? #f) (geoclue-application "firefox" #:system? #f))) +;; TODO: Use define-configuration and export accessors. +(define-record-type* + geoclue-configuration make-geoclue-configuration + geoclue-configuration? + (geoclue geoclue-configuration-geoclue + (default geoclue)) + (whitelist geoclue-configuration-whitelist + (default '())) + (wifi-geolocation-url + geoclue-configuration-wifi-geolocation-url + ;; Mozilla geolocation service: + (default "https://location.services.mozilla.com/v1/geolocate?key=geoclue")) + (submit-data? geoclue-configuration-submit-data? + (default #f)) + (wifi-submission-url + geoclue-configuration-wifi-submission-url + (default "https://location.services.mozilla.com/v1/submit?key=geoclue")) + (submission-nick geoclue-configuration-submission-nick + (default "geoclue")) + (applications geoclue-configuration-applications + (default %standard-geoclue-applications))) + (define* (geoclue-configuration-file config) "Return a geoclue configuration file." (plain-file "geoclue.conf" @@ -383,16 +392,18 @@ (define geoclue-service-type access to a user's physical location, and optionally to add information to online location databases."))) -(define* (geoclue-service #:key (geoclue geoclue) - (whitelist '()) - (wifi-geolocation-url - ;; Mozilla geolocation service: - "https://location.services.mozilla.com/v1/geolocate?key=geoclue") - (submit-data? #f) - (wifi-submission-url - "https://location.services.mozilla.com/v1/submit?key=geoclue") - (submission-nick "geoclue") - (applications %standard-geoclue-applications)) +(define-deprecated + (geoclue-service #:key (geoclue geoclue) + (whitelist '()) + (wifi-geolocation-url + ;; Mozilla geolocation service: + "https://location.services.mozilla.com/v1/geolocate?key=geoclue") + (submit-data? #f) + (wifi-submission-url + "https://location.services.mozilla.com/v1/submit?key=geoclue") + (submission-nick "geoclue") + (applications %standard-geoclue-applications)) + geoclue-service-type "Return a service that runs the @command{geoclue} location service. This service provides a D-Bus interface to allow applications to request access to a user's physical location, and optionally to add information to online @@ -1806,7 +1817,7 @@ (define* (desktop-services-for-system #:optional (service accountsservice-service-type) (service cups-pk-helper-service-type) (service colord-service-type) - (geoclue-service) + (service geoclue-service-type) (service polkit-service-type) (service elogind-service-type) (dbus-service)