GNU bug report logs - #47870
[PATCH 0/2] Autostart polkit-gnome in XFCE

Previous Next

Package: guix-patches;

Reported by: Brendan Tildesley <btild <at> mailbox.org>

Date: Sun, 18 Apr 2021 13:15:01 UTC

Severity: normal

Tags: patch

Done: Leo Prikler <leo.prikler <at> student.tugraz.at>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47870 in the body.
You can then email your comments to 47870 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Sun, 18 Apr 2021 13:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brendan Tildesley <btild <at> mailbox.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 18 Apr 2021 13:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <btild <at> mailbox.org>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH 0/2] Autostart polkit-gnome in XFCE
Date: Sun, 18 Apr 2021 15:13:51 +0200 (CEST)
[Message part 1 (text/plain, inline)]
I noticed I couldn't edit NetworkManager settings in XFCE, and it turns it
there is no polkit authentication agent running. Every desktop seems to
have their own one, and XFCE seems to use polkit-gnome. Since it was 
abandoned by GNOME it isn't used for anything else. So I setup an autostart
desktop file just like how mate-polkit has one.
It feels a bit odd configuring the package with an embedded desktop file
just for XFCE. Perhaps it would be better to put it in a separate "xfce-autostart"
output or just put it into the xfce package instead of the polkit-gnome package.

What do you think?
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Sun, 18 Apr 2021 13:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 47870 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: xfce: Start polkit-gnome agent on login.
Date: Sun, 18 Apr 2021 23:17:27 +1000
 * gnu/packages/xfce.scm (xfce): Add polkit-gnome to the union package
 so that /polkit-gnome-authentication-agent-1 will be started on
 login. This fixes users not being able to edit NetworkManager settings
 due to there not being any polkit authentication agent running.
---
 gnu/packages/xfce.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index ffac62af9e..fd8a2f12c5 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -974,6 +974,7 @@ on your desktop.")
        ("gtk-xfce-engine"      ,gtk-xfce-engine)
        ("hicolor-icon-theme"   ,hicolor-icon-theme)
        ("ristretto"            ,ristretto)
+       ("polkit-gnome"         ,polkit-gnome)
        ("shared-mime-info"     ,shared-mime-info)
        ("thunar"               ,thunar)
        ("thunar-volman"        ,thunar-volman)
-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Sun, 18 Apr 2021 13:18:01 GMT) Full text and rfc822 format available.

Message #11 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 47870 <at> debbugs.gnu.org
Subject: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Sun, 18 Apr 2021 23:17:26 +1000
* gnu/packages/polkit.scm (polkit-gnome):
[inputs]: Source a translated .desktop file from Arch Linux.
[arguments]: Install the .desktop file into /etc/autostart and set
OnlyShowIn to XFCE so it will be autostarted only by XFCE.
[description]: Add a note clarifying that this package is currently only
used for XFCE, not GNOME.
---
 gnu/packages/polkit.scm | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/polkit.scm b/gnu/packages/polkit.scm
index d868aceec2..1c5173921c 100644
--- a/gnu/packages/polkit.scm
+++ b/gnu/packages/polkit.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas <at> gmail.com>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2021 Brendan Tildesley <mail <at> brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -183,12 +184,42 @@ easily with PolicyKit.")
                 "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10p"))))
     (build-system gnu-build-system)
     (inputs `(("gtk+" ,gtk+)
-              ("polkit" ,polkit)))
+              ("polkit" ,polkit)
+              ("desktop-file"
+               ,(origin
+                  (method url-fetch)
+                  (uri
+                   (string-append
+                    "https://raw.githubusercontent.com/archlinux/svntogit-community/"
+                    "8963650797cfe0383ef510e9c0492b2cb22a2593/repos/community-x86_64/"
+                    "polkit-gnome-authentication-agent-1.desktop"))
+                  (sha256
+                   (base32
+                    "1rqy8jf01idaqnyrzjaapr7pzx8zg2x9kmw70n1p9cpalhiwfx2h"))))))
     (native-inputs `(("intltool"   ,intltool)
                      ("pkg-config" ,pkg-config)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-autostart-file
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (autostart-dir (string-append out "/etc/xdg/autostart"))
+                    (desktop (string-append
+                              autostart-dir
+                              "/polkit-gnome-authentication-agent-1.desktop")))
+               (mkdir-p autostart-dir)
+               (copy-file (assoc-ref inputs "desktop-file") desktop)
+               (substitute* desktop
+                 (("^Exec=.*")
+                  (string-append
+                   "Exec=" out "/libexec/polkit-gnome-authentication-agent-1\n"))
+                 ;; This will mean the agent will only be started in XFCE.
+                 (("^OnlyShowIn=.*") "OnlyShowIn=XFCE;\n"))))))))
     (synopsis "Legacy polkit authentication agent for GNOME")
-    (description "PolicyKit-gnome provides a D-Bus session bus service
-that is used to bring up authentication dialogs used for obtaining
-privileges.")
+    (description "PolicyKit-gnome provides a D-Bus session bus service that
+is used to bring up authentication dialogs used for obtaining privileges.
+PolicyKit-gnome is no longer used in GNOME but has become the default agent
+for XFCE.")
     (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
     (license lgpl2.0+)))
-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Sun, 18 Apr 2021 14:48:01 GMT) Full text and rfc822 format available.

Message #14 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Brendan Tildesley <mail <at> brendan.scot>, 47870 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Sun, 18 Apr 2021 16:47:44 +0200
Hi Brendan,

Am Sonntag, den 18.04.2021, 23:17 +1000 schrieb Brendan Tildesley:
> * gnu/packages/polkit.scm (polkit-gnome):
> [inputs]: Source a translated .desktop file from Arch Linux.
> [arguments]: Install the .desktop file into /etc/autostart and set
> OnlyShowIn to XFCE so it will be autostarted only by XFCE.
> [description]: Add a note clarifying that this package is currently
> only
> used for XFCE, not GNOME.
> ---
>  gnu/packages/polkit.scm | 39 +++++++++++++++++++++++++++++++++++----
>  1 file changed, 35 insertions(+), 4 deletions(-)
> 
> diff --git a/gnu/packages/polkit.scm b/gnu/packages/polkit.scm
> index d868aceec2..1c5173921c 100644
> --- a/gnu/packages/polkit.scm
> +++ b/gnu/packages/polkit.scm
> @@ -6,6 +6,7 @@
>  ;;; Copyright © 2017 Huang Ying <huang.ying.caritas <at> gmail.com>
>  ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
>  ;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
> +;;; Copyright © 2021 Brendan Tildesley <mail <at> brendan.scot>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -183,12 +184,42 @@ easily with PolicyKit.")
>                  "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10
> p"))))
>      (build-system gnu-build-system)
>      (inputs `(("gtk+" ,gtk+)
> -              ("polkit" ,polkit)))
> +              ("polkit" ,polkit)
> +              ("desktop-file"
> +               ,(origin
> +                  (method url-fetch)
> +                  (uri
> +                   (string-append
> +                    "
> https://raw.githubusercontent.com/archlinux/svntogit-community/"
> +                    "8963650797cfe0383ef510e9c0492b2cb22a2593/repos/
> community-x86_64/"
> +                    "polkit-gnome-authentication-agent-1.desktop"))
> +                  (sha256
> +                   (base32
> +                    "1rqy8jf01idaqnyrzjaapr7pzx8zg2x9kmw70n1p9cpalhi
> wfx2h"))))))
Instead of sourcing the desktop file from a really obscure location,
would it be possible to express this in terms of `make-desktop-entry-
file'?  This also has the added advantage, that it could be inlined
into the phase.
>      (native-inputs `(("intltool"   ,intltool)
>                       ("pkg-config" ,pkg-config)))
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'install 'install-autostart-file
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (autostart-dir (string-append out
> "/etc/xdg/autostart"))
> +                    (desktop (string-append
> +                              autostart-dir
> +                              "/polkit-gnome-authentication-agent-
> 1.desktop")))
> +               (mkdir-p autostart-dir)
> +               (copy-file (assoc-ref inputs "desktop-file") desktop)
> +               (substitute* desktop
> +                 (("^Exec=.*")
> +                  (string-append
> +                   "Exec=" out "/libexec/polkit-gnome-
> authentication-agent-1\n"))
> +                 ;; This will mean the agent will only be started in
> XFCE.
> +                 (("^OnlyShowIn=.*") "OnlyShowIn=XFCE;\n"))))))))
See above.
>      (synopsis "Legacy polkit authentication agent for GNOME")
> -    (description "PolicyKit-gnome provides a D-Bus session bus
> service
> -that is used to bring up authentication dialogs used for obtaining
> -privileges.")
> +    (description "PolicyKit-gnome provides a D-Bus session bus
> service that
> +is used to bring up authentication dialogs used for obtaining
> privileges.
> +PolicyKit-gnome is no longer used in GNOME but has become the
> default agent
> +for XFCE.")
Is that so?  Even if this holds for GNOME 40, it's not true for Guix'
GNOME until wip-gnome is merged, or does 3.34 already use something
else?
>      (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
>      (license lgpl2.0+)))

Regards,
Leo





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Sun, 18 Apr 2021 15:16:01 GMT) Full text and rfc822 format available.

Message #17 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 47870 <at> debbugs.gnu.org
Cc: Leo Prikler <leo.prikler <at> student.tugraz.at>
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Sun, 18 Apr 2021 17:15:31 +0200 (CEST)
> On 04/18/2021 4:47 PM Leo Prikler <leo.prikler <at> student.tugraz.at> wrote:
> 
>  
> Hi Brendan,
> 
[...]
> Instead of sourcing the desktop file from a really obscure location,
> would it be possible to express this in terms of `make-desktop-entry-
> file'?  This also has the added advantage, that it could be inlined
> into the phase.

I did this because the file has many translations, so it would be a lot
of lines: https://raw.githubusercontent.com/archlinux/svntogit-community/packages/polkit-gnome/trunk/polkit-gnome-authentication-agent-1.desktop
I was just trying to source it so translations weren't duplicated.

[...]
> > +PolicyKit-gnome is no longer used in GNOME but has become the
> > default agent
> > +for XFCE.")
> Is that so?  Even if this holds for GNOME 40, it's not true for Guix'
> GNOME until wip-gnome is merged, or does 3.34 already use something
> else?
It's much older than that. I think it was used for Gnome 2 and long since 
discarded. The release is years old and the repo untouched for 3 years.

On second thought perhaps another option is just to use the MATE polkit
agent instead? I tested it for changing network manager and it worked
just the same, only the GUI looks slightly different. I was searching
 What do you think?




Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Sun, 18 Apr 2021 15:53:02 GMT) Full text and rfc822 format available.

Message #20 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Brendan Tildesley <mail <at> brendan.scot>, 47870 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Sun, 18 Apr 2021 17:52:35 +0200
Hi,

Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > On 04/18/2021 4:47 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > wrote:
> > 
> >  
> > Hi Brendan,
> > 
> [...]
> > Instead of sourcing the desktop file from a really obscure
> > location,
> > would it be possible to express this in terms of `make-desktop-
> > entry-
> > file'?  This also has the added advantage, that it could be inlined
> > into the phase.
> 
> I did this because the file has many translations, so it would be a
> lot
> of lines: 
> https://raw.githubusercontent.com/archlinux/svntogit-community/packages/polkit-gnome/trunk/polkit-gnome-authentication-agent-1.desktop
> I was just trying to source it so translations weren't duplicated.
> 
> [...]
I still think we'd prefer to keep our own copy.  If not as code, then
perhaps as aux-file?

> > > +PolicyKit-gnome is no longer used in GNOME but has become the
> > > default agent
> > > +for XFCE.")
> > Is that so?  Even if this holds for GNOME 40, it's not true for
> > Guix'
> > GNOME until wip-gnome is merged, or does 3.34 already use something
> > else?
> It's much older than that. I think it was used for Gnome 2 and long
> since 
> discarded. The release is years old and the repo untouched for 3
> years.
Ah, thanks for clearing that up.
> On second thought perhaps another option is just to use the MATE
> polkit
> agent instead? I tested it for changing network manager and it worked
> just the same, only the GUI looks slightly different. I was searching
>  What do you think?
If it works for XFCE, why not?  Given that polkit-gnome has no
dependents other than itself, should we perhaps also look into removing
it?

Regards,
Leo





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 06:58:02 GMT) Full text and rfc822 format available.

Message #23 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 47870 <at> debbugs.gnu.org
Cc: Leo Prikler <leo.prikler <at> student.tugraz.at>
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 08:56:54 +0200 (CEST)
[Message part 1 (text/plain, inline)]
> On 04/18/2021 5:52 PM Leo Prikler <leo.prikler <at> student.tugraz.at> wrote:
> 
>  
> Hi,
> 
> Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > > On 04/18/2021 4:47 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > > wrote:
[...]
> > On second thought perhaps another option is just to use the MATE
> > polkit
> > agent instead? I tested it for changing network manager and it worked
> > just the same, only the GUI looks slightly different. I was searching
> >  What do you think?
> If it works for XFCE, why not?  Given that polkit-gnome has no
> dependents other than itself, should we perhaps also look into removing
> it?
> 
One issue is that mate-polkit's .desktop file has the line OnlyShowIn=MATE;
This prevents it from being launched in any other desktop. When multiple 
desktops are installed all these files sit in /run/current-desktop/profile/etc/
and rely these lines to make them not appear in other desktops.

I made a couple patches [attached] that adds XFCE to the the .desktop's OnlyShowIn.
It's a little ugly though. 
> Regards,
> Leo
[0002-gnu-xfce-Start-mate-polkit-agent-on-login.patch (text/x-patch, attachment)]
[0001-gnu-polkit-mate-Enable-autostarting-in-XFCE.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 07:37:01 GMT) Full text and rfc822 format available.

Message #26 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Brendan Tildesley <mail <at> brendan.scot>, 47870 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 09:36:05 +0200
Hi Brendan,

Am Montag, den 19.04.2021, 08:56 +0200 schrieb Brendan Tildesley:
> > On 04/18/2021 5:52 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > wrote:
> > 
> >  
> > Hi,
> > 
> > Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > > > On 04/18/2021 4:47 PM Leo Prikler <
> > > > leo.prikler <at> student.tugraz.at>
> > > > wrote:
> [...]
> > > On second thought perhaps another option is just to use the MATE
> > > polkit
> > > agent instead? I tested it for changing network manager and it
> > > worked
> > > just the same, only the GUI looks slightly different. I was
> > > searching
> > >  What do you think?
> > If it works for XFCE, why not?  Given that polkit-gnome has no
> > dependents other than itself, should we perhaps also look into
> > removing
> > it?
> > 
> One issue is that mate-polkit's .desktop file has the line
> OnlyShowIn=MATE;
> This prevents it from being launched in any other desktop. When
> multiple 
> desktops are installed all these files sit in /run/current-
> desktop/profile/etc/
> and rely these lines to make them not appear in other desktops.
> 
> I made a couple patches [attached] that adds XFCE to the the
> .desktop's OnlyShowIn.
> It's a little ugly though. 
This may potentially be bikeshedding, but what about defining a
(potentially hidden) package, that inherits from mate-polkit (call it
mate-polkit-for-xfce) and installs a .desktop file, that replaces MATE
with XFCE?  Ah, well, you'd also have to move the desktop file to a
different location for there not to be a name clash.

Other than that, the contents of your patches LGTM, but the ChangeLog
is on a pretty verbose end.  For instance, the message for 0001 should
likely be rewritten as:

----
gnu: polkit-mate: Enable autostarting in XFCE.

Add XFCE to the OnlyShowIn field of the autostart .desktop file so it
will be started by XFCE as well.  This is for the same of making
polkit-mate the de facto polkit agent for XFCE in Guix, since XFCE does
not ship its own.

A potential downside might be, that this desktop file ends up in the
current system profile and can therefore be seen in XFCE
configurations, that did not ask for it.

* gnu/packages/mate.scm (polkit-mate)[#:phases]: Add 'patch-desktop-
for-xfce'.
----

You could also write significantly shorter commit messages, since
"Enable autostarting in XFCE" already tells you everything the patch
does.

Regards, Leo





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 11:03:02 GMT) Full text and rfc822 format available.

Message #29 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 47870 <at> debbugs.gnu.org
Cc: Leo Prikler <leo.prikler <at> student.tugraz.at>
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 13:02:02 +0200 (CEST)
[Message part 1 (text/plain, inline)]
> On 04/19/2021 9:36 AM Leo Prikler <leo.prikler <at> student.tugraz.at> wrote:
> 
>  
> Hi Brendan,
> 
> Am Montag, den 19.04.2021, 08:56 +0200 schrieb Brendan Tildesley:
> > > On 04/18/2021 5:52 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > > wrote:
> > > 
> > >  
> > > Hi,
> > > 
> > > Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
> > > > > On 04/18/2021 4:47 PM Leo Prikler <
> > > > > leo.prikler <at> student.tugraz.at>
> > > > > wrote:
> > [...]
> > > > On second thought perhaps another option is just to use the MATE
> > > > polkit
> > > > agent instead? I tested it for changing network manager and it
> > > > worked
> > > > just the same, only the GUI looks slightly different. I was
> > > > searching
> > > >  What do you think?
> > > If it works for XFCE, why not?  Given that polkit-gnome has no
> > > dependents other than itself, should we perhaps also look into
> > > removing
> > > it?
> > > 
> > One issue is that mate-polkit's .desktop file has the line
> > OnlyShowIn=MATE;
> > This prevents it from being launched in any other desktop. When
> > multiple 
> > desktops are installed all these files sit in /run/current-
> > desktop/profile/etc/
> > and rely these lines to make them not appear in other desktops.
> > 
> > I made a couple patches [attached] that adds XFCE to the the
> > .desktop's OnlyShowIn.
> > It's a little ugly though. 
> This may potentially be bikeshedding, but what about defining a
> (potentially hidden) package, that inherits from mate-polkit (call it
> mate-polkit-for-xfce) and installs a .desktop file, that replaces MATE
> with XFCE?  Ah, well, you'd also have to move the desktop file to a
> different location for there not to be a name clash.
> 

I think it's good to think about. This way makes it more self contained.

> Other than that, the contents of your patches LGTM, but the ChangeLog
> is on a pretty verbose end.  For instance, the message for 0001 should
> likely be rewritten as:
> 
> ----
> gnu: polkit-mate: Enable autostarting in XFCE.
> 
> Add XFCE to the OnlyShowIn field of the autostart .desktop file so it
> will be started by XFCE as well.  This is for the same of making
> polkit-mate the de facto polkit agent for XFCE in Guix, since XFCE does
> not ship its own.
> 
> A potential downside might be, that this desktop file ends up in the
> current system profile and can therefore be seen in XFCE
> configurations, that did not ask for it.
> 
> * gnu/packages/mate.scm (polkit-mate)[#:phases]: Add 'patch-desktop-
> for-xfce'.
> ----
> 
> You could also write significantly shorter commit messages, since
> "Enable autostarting in XFCE" already tells you everything the patch
> does.
> 
> Regards, Leo
Yeah I suck at commit messages. I've attached new patches doing it this way
and confirmed it worked in a VM.
[0001-gnu-Add-xfce-mate-polkit-autostart.patch (text/x-patch, attachment)]
[0002-gnu-xfce-Add-xfce-mate-polkit-autostart-to-inputs.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 11:13:01 GMT) Full text and rfc822 format available.

Message #32 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Brendan Tildesley <mail <at> brendan.scot>, 47870 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 13:12:35 +0200
Hi Brendan,

Am Montag, den 19.04.2021, 13:02 +0200 schrieb Brendan Tildesley:
> gnu/packages/xfce.scm (xfce-mate-polkit-autostart) New symbol.
Scheme doesn't have symbols, it has variables.

> +(define-public xfce-mate-polkit-autostart
> +  (package
> +    (name "xfce-mate-polkit-autostart")
> +    (version "1")
> +    (inputs `(("mate-polkit" ,mate-polkit)))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'unpack)
> +         (delete 'bootstrap)
> +         (delete 'patch-usr-bin-file)
> +         (delete 'patch-source-shebangs)
> +         (delete 'configure)
> +         (delete 'patch-generated-file-shebangs)
> +         (delete 'check)
> +         (delete 'install)
> +         (delete 'patch-shebangs)
> +         (delete 'strip)
> +         (delete 'validate-runpath)
> +         (delete 'validate-documentation-location)
> +         (delete 'delete-info-dir-file)
> +         (delete 'patch-dot-desktop-files)
> +         (delete 'install-license-files)
> +         (delete 'reset-gzip-timestamps)
> +         (delete 'compress-documentation)
> +         (replace 'build
> +           (lambda _
> +             (let* ((mate-polkit (assoc-ref %build-inputs "mate-
> polkit"))
> +                    (out (assoc-ref %outputs "out"))
> +                    (dir (string-append out "/etc/xdg/autostart"))
> +                    (desktop (string-append
> +                              dir "/xfce4-polkit-mate-
> authentication-agent-1.desktop")))
> +               (mkdir-p dir)
> +               (copy-file (string-append
> +                           mate-polkit "/etc/xdg/autostart/"
> +                           "polkit-mate-authentication-agent-
> 1.desktop")
> +                          desktop)
> +               (substitute* desktop
> +                 (("^X-MATE.*") "")
> +                 (("MATE") "XFCE"))))))))
> +    (source #f) (home-page #f) (synopsis #f) (description #f)
> (license #f)
> +    (properties `((hidden? . #t)))))
That's a pretty large package description for something rather trivial.
Would the following work instead?

  (package/inherit mate-polkit
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-desktop-for-xfce
           (lambda _
             (substitute* "src/polkit-mate-authentication-agent-
1.desktop.in.in"
                 (("MATE;") "XFCE;"))))))))

Regards,
Leo





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 11:28:01 GMT) Full text and rfc822 format available.

Message #35 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 47870 <at> debbugs.gnu.org
Cc: Leo Prikler <leo.prikler <at> student.tugraz.at>
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 13:26:53 +0200 (CEST)
> On 04/19/2021 1:12 PM Leo Prikler <leo.prikler <at> student.tugraz.at> wrote:
> 
>  
> Hi Brendan,
> 

> That's a pretty large package description for something rather trivial.
> Would the following work instead?
> 
>   (package/inherit mate-polkit
>     (arguments
>      `(#:phases
>        (modify-phases %standard-phases
>          (add-after 'unpack 'patch-desktop-for-xfce
>            (lambda _
>              (substitute* "src/polkit-mate-authentication-agent-
> 1.desktop.in.in"
>                  (("MATE;") "XFCE;"))))))))
> 
> Regards,
> Leo
Uhh ok it's simpler source code but now we're building it twice,
potentially having two copies of it and the .desktop file will have
the same filename and thus conflict if both desktops are installed.




Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 12:02:01 GMT) Full text and rfc822 format available.

Message #38 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Brendan Tildesley <mail <at> brendan.scot>, 47870 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 14:01:02 +0200
Am Montag, den 19.04.2021, 13:26 +0200 schrieb Brendan Tildesley:
> > On 04/19/2021 1:12 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > wrote:
> > 
> >  
> > Hi Brendan,
> > 
> > That's a pretty large package description for something rather
> > trivial.
> > Would the following work instead?
> > 
> >   (package/inherit mate-polkit
> >     (arguments
> >      `(#:phases
> >        (modify-phases %standard-phases
> >          (add-after 'unpack 'patch-desktop-for-xfce
> >            (lambda _
> >              (substitute* "src/polkit-mate-authentication-agent-
> > 1.desktop.in.in"
> >                  (("MATE;") "XFCE;"))))))))
> > 
> > Regards,
> > Leo
> Uhh ok it's simpler source code but now we're building it twice,
> potentially having two copies of it and the .desktop file will have
> the same filename and thus conflict if both desktops are installed.
Oh, right, I was missing the part, in which we rename it.
W.r.t. "building it twice", that's only if you have both mate-polkit
and the new one in your profile, in which case I guess it would be
tolerable.  If you're using just MATE or just XFCE you'll build one or
the other.

FWIW, there is also xfce-polkit [1], but it was last updated 2020 with
the latest release in 2018 (which is still more recent than 2011,
though).  WDYT?

[1] https://github.com/ncopa/xfce-polkit





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 13:31:03 GMT) Full text and rfc822 format available.

Message #41 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: 47870 <at> debbugs.gnu.org
Cc: Leo Prikler <leo.prikler <at> student.tugraz.at>
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 15:30:43 +0200 (CEST)
> On 04/19/2021 2:01 PM Leo Prikler <leo.prikler <at> student.tugraz.at> wrote:
> 
>  
> Am Montag, den 19.04.2021, 13:26 +0200 schrieb Brendan Tildesley:
> > > On 04/19/2021 1:12 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > > wrote:
> > > 
> > >  
> > > Hi Brendan,
> > > 
> > > That's a pretty large package description for something rather
> > > trivial.
> > > Would the following work instead?
> > > 
> > >   (package/inherit mate-polkit
> > >     (arguments
> > >      `(#:phases
> > >        (modify-phases %standard-phases
> > >          (add-after 'unpack 'patch-desktop-for-xfce
> > >            (lambda _
> > >              (substitute* "src/polkit-mate-authentication-agent-
> > > 1.desktop.in.in"
> > >                  (("MATE;") "XFCE;"))))))))
> > > 
> > > Regards,
> > > Leo
> > Uhh ok it's simpler source code but now we're building it twice,
> > potentially having two copies of it and the .desktop file will have
> > the same filename and thus conflict if both desktops are installed.
> Oh, right, I was missing the part, in which we rename it.
> W.r.t. "building it twice", that's only if you have both mate-polkit
> and the new one in your profile, in which case I guess it would be
> tolerable.  If you're using just MATE or just XFCE you'll build one or
> the other.
> 
> FWIW, there is also xfce-polkit [1], but it was last updated 2020 with
> the latest release in 2018 (which is still more recent than 2011,
> though).  WDYT?
> 
> [1] https://github.com/ncopa/xfce-polkit

Yeah I saw these but there is next to zero information on them.
I packaged it and it seems worse. It doesn't even have OK/Cancel buttons
for mouse operation in the password entry dialogue. It uses libxfce4ui
and has "xfce" in the name but otherwise doesn't seem any more or less
suitable for xfce than other agents.

At this point I just want to pick one and get it done with. If you like
I can make mate-polkit like your suggestion but rename the desktop file
so it doesn't conflict.


Debian's package says this on gnome-polkit:
"This implementation was originally designed for GNOME 2, but most GNOME-based desktop environments, including GNOME 3, GNOME Flashback, and MATE, have their own built-in PolicyKit agents and no longer use this one. The remaining users of this implementation are Cinnamon, XFCE and Unity. "




Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Mon, 19 Apr 2021 13:49:02 GMT) Full text and rfc822 format available.

Message #44 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Brendan Tildesley <mail <at> brendan.scot>, 47870 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Mon, 19 Apr 2021 15:47:55 +0200
Hi,

Am Montag, den 19.04.2021, 15:30 +0200 schrieb Brendan Tildesley:
> > On 04/19/2021 2:01 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > wrote:
> > 
> >  
> > Am Montag, den 19.04.2021, 13:26 +0200 schrieb Brendan Tildesley:
> > > > On 04/19/2021 1:12 PM Leo Prikler <
> > > > leo.prikler <at> student.tugraz.at>
> > > > wrote:
> > > > 
> > > >  
> > > > Hi Brendan,
> > > > 
> > > > That's a pretty large package description for something rather
> > > > trivial.
> > > > Would the following work instead?
> > > > 
> > > >   (package/inherit mate-polkit
> > > >     (arguments
> > > >      `(#:phases
> > > >        (modify-phases %standard-phases
> > > >          (add-after 'unpack 'patch-desktop-for-xfce
> > > >            (lambda _
> > > >              (substitute* "src/polkit-mate-authentication-
> > > > agent-
> > > > 1.desktop.in.in"
> > > >                  (("MATE;") "XFCE;"))))))))
> > > > 
> > > > Regards,
> > > > Leo
> > > Uhh ok it's simpler source code but now we're building it twice,
> > > potentially having two copies of it and the .desktop file will
> > > have
> > > the same filename and thus conflict if both desktops are
> > > installed.
> > Oh, right, I was missing the part, in which we rename it.
> > W.r.t. "building it twice", that's only if you have both mate-
> > polkit
> > and the new one in your profile, in which case I guess it would be
> > tolerable.  If you're using just MATE or just XFCE you'll build one
> > or
> > the other.
> > 
> > FWIW, there is also xfce-polkit [1], but it was last updated 2020
> > with
> > the latest release in 2018 (which is still more recent than 2011,
> > though).  WDYT?
> > 
> > [1] https://github.com/ncopa/xfce-polkit
> 
> Yeah I saw these but there is next to zero information on them.
> I packaged it and it seems worse. It doesn't even have OK/Cancel
> buttons
> for mouse operation in the password entry dialogue. It uses
> libxfce4ui
> and has "xfce" in the name but otherwise doesn't seem any more or
> less
> suitable for xfce than other agents.
Fair enough, so it's either gnome or mate for XFCE.

> At this point I just want to pick one and get it done with. If you
> like
> I can make mate-polkit like your suggestion but rename the desktop
> file
> so it doesn't conflict.
It's your choice, what you want to implement:
1. gnome-polkit with an added desktop file (but please use an aux file
or make-desktop-file-entry instead of an origin pointing into the
aether)
2. mate-polkit-for-xfce with the renamed desktop file.
3. something completely else

I know that waiting long for your patch to be upstreamed can be
frustrating, but I'm not here to tease you; rather I want to ensure,
that whatever you do ends up not as a quick and dirty fix, but a proper
package.

> Debian's package says this on gnome-polkit:
> "This implementation was originally designed for GNOME 2, but most
> GNOME-based desktop environments, including GNOME 3, GNOME Flashback,
> and MATE, have their own built-in PolicyKit agents and no longer use
> this one. The remaining users of this implementation are Cinnamon,
> XFCE and Unity. "
Hmm, in that case keeping gnome-polkit around longer might be desirable
if people want to port Cinnamon or Unity.  What does Debian's desktop
file look like and could we port it over?

Regards,
Leo





Information forwarded to guix-patches <at> gnu.org:
bug#47870; Package guix-patches. (Wed, 21 Apr 2021 05:33:02 GMT) Full text and rfc822 format available.

Message #47 received at 47870 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: Leo Prikler <leo.prikler <at> student.tugraz.at>, 47870 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Wed, 21 Apr 2021 07:31:52 +0200 (CEST)
[Message part 1 (text/plain, inline)]
> On 04/19/2021 3:47 PM Leo Prikler <leo.prikler <at> student.tugraz.at> wrote:
[...]
> Fair enough, so it's either gnome or mate for XFCE.
> 
> > At this point I just want to pick one and get it done with. If you
> > like
> > I can make mate-polkit like your suggestion but rename the desktop
> > file
> > so it doesn't conflict.
> It's your choice, what you want to implement:
> 1. gnome-polkit with an added desktop file (but please use an aux file
> or make-desktop-file-entry instead of an origin pointing into the
> aether)
> 2. mate-polkit-for-xfce with the renamed desktop file.
> 3. something completely else

I made a patch for mate-polkit-for-xfce.



> > Debian's package says this on gnome-polkit:
> > "This implementation was originally designed for GNOME 2, but most
> > GNOME-based desktop environments, including GNOME 3, GNOME Flashback,
> > and MATE, have their own built-in PolicyKit agents and no longer use
> > this one. The remaining users of this implementation are Cinnamon,
> > XFCE and Unity. "
> Hmm, in that case keeping gnome-polkit around longer might be desirable
> if people want to port Cinnamon or Unity.  What does Debian's desktop
> file look like and could we port it over?

It has OnlyShowIn=XFCE;Unity;X-Cinnamon;

It also applies four patches of course
0001-Select-the-current-user-to-authenticate-with-by-defa.patch
0002-Auth-dialog-Make-the-label-wrap-at-70-chars.patch
0003-Get-user-icon-from-accountsservice-instead-of-lookin.patch
0004-Use-fresh-X11-timestamps-when-displaying-authenticat.patch
http://deb.debian.org/debian/pool/main/p/policykit-1-gnome/policykit-1-gnome_0.105-7.debian.tar.xz
[0001-gnu-Add-mate-polkit-for-xfce.patch (text/x-patch, attachment)]
[0002-gnu-xfce-Autostart-mate-polkit.patch (text/x-patch, attachment)]

Reply sent to Leo Prikler <leo.prikler <at> student.tugraz.at>:
You have taken responsibility. (Wed, 21 Apr 2021 08:46:01 GMT) Full text and rfc822 format available.

Notification sent to Brendan Tildesley <btild <at> mailbox.org>:
bug acknowledged by developer. (Wed, 21 Apr 2021 08:46:01 GMT) Full text and rfc822 format available.

Message #52 received at 47870-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: Brendan Tildesley <mail <at> brendan.scot>, 47870-done <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
Date: Wed, 21 Apr 2021 10:44:55 +0200
Hi,

Am Mittwoch, den 21.04.2021, 07:31 +0200 schrieb Brendan Tildesley:
> > On 04/19/2021 3:47 PM Leo Prikler <leo.prikler <at> student.tugraz.at>
> > wrote:
> [...]
> > Fair enough, so it's either gnome or mate for XFCE.
> > 
> > > At this point I just want to pick one and get it done with. If
> > > you
> > > like
> > > I can make mate-polkit like your suggestion but rename the
> > > desktop
> > > file
> > > so it doesn't conflict.
> > It's your choice, what you want to implement:
> > 1. gnome-polkit with an added desktop file (but please use an aux
> > file
> > or make-desktop-file-entry instead of an origin pointing into the
> > aether)
> > 2. mate-polkit-for-xfce with the renamed desktop file.
> > 3. something completely else
> 
> I made a patch for mate-polkit-for-xfce.
> 
Thanks.  I've pushed them with some slight changes.
> 
> > > Debian's package says this on gnome-polkit:
> > > "This implementation was originally designed for GNOME 2, but
> > > most
> > > GNOME-based desktop environments, including GNOME 3, GNOME
> > > Flashback,
> > > and MATE, have their own built-in PolicyKit agents and no longer
> > > use
> > > this one. The remaining users of this implementation are
> > > Cinnamon,
> > > XFCE and Unity. "
> > Hmm, in that case keeping gnome-polkit around longer might be
> > desirable
> > if people want to port Cinnamon or Unity.  What does Debian's
> > desktop
> > file look like and could we port it over?
> 
> It has OnlyShowIn=XFCE;Unity;X-Cinnamon;
> 
> It also applies four patches of course
> 0001-Select-the-current-user-to-authenticate-with-by-defa.patch
> 0002-Auth-dialog-Make-the-label-wrap-at-70-chars.patch
> 0003-Get-user-icon-from-accountsservice-instead-of-lookin.patch
> 0004-Use-fresh-X11-timestamps-when-displaying-authenticat.patch
> http://deb.debian.org/debian/pool/main/p/policykit-1-gnome/policykit-1-gnome_0.105-7.debian.tar.xz
That still looks reasonable imo.  If at some point you're dissatisfied
with MATE's polkit agent, feel free to package it.

Regards,
Leo





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 19 May 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 335 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.