[PATCH 0/2] Autostart polkit-gnome in XFCE

  • Done
  • quality assurance status badge
Details
3 participants
  • Brendan Tildesley
  • Leo Prikler
  • Brendan Tildesley
Owner
unassigned
Submitted by
Brendan Tildesley
Severity
normal
B
B
Brendan Tildesley wrote on 18 Apr 2021 15:13
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
35342344.77101.1618751631600@office.mailbox.org
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?
Attachment: file
B
B
Brendan Tildesley wrote on 18 Apr 2021 15:17
[PATCH 2/2] gnu: xfce: Start polkit-gnome agent on login.
(address . 47870@debbugs.gnu.org)
20210418131727.6104-2-mail@brendan.scot
* 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(+)

Toggle diff (14 lines)
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
B
B
Brendan Tildesley wrote on 18 Apr 2021 15:17
[PATCH 1/2] gnu: polkit-gnome: Add autostart .desktop file.
(address . 47870@debbugs.gnu.org)
20210418131727.6104-1-mail@brendan.scot
* 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(-)

Toggle diff (61 lines)
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@gmail.com>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Brendan Tildesley <mail@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
L
L
Leo Prikler wrote on 18 Apr 2021 16:47
b3ce4381e7436997df786da721fe101804c54ad7.camel@student.tugraz.at
Hi Brendan,

Am Sonntag, den 18.04.2021, 23:17 +1000 schrieb Brendan Tildesley:
Toggle quote (44 lines)
> * 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@gmail.com>
> ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
> ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
> +;;; Copyright © 2021 Brendan Tildesley <mail@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.
Toggle quote (24 lines)
> (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.
Toggle quote (12 lines)
> (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?
Toggle quote (3 lines)
> (license lgpl2.0+)))

Regards,
Leo
B
B
Brendan Tildesley wrote on 18 Apr 2021 17:15
(address . 47870@debbugs.gnu.org)(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
687049384.78340.1618758931217@office.mailbox.org
Toggle quote (5 lines)
> On 04/18/2021 4:47 PM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
>
>
> Hi Brendan,
>
[...]
Toggle quote (5 lines)
> 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
I was just trying to source it so translations weren't duplicated.

[...]
Toggle quote (6 lines)
> > +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?
L
L
Leo Prikler wrote on 18 Apr 2021 17:52
f1e47d74bd425ffe396681c14f37a0245405b826.camel@student.tugraz.at
Hi,

Am Sonntag, den 18.04.2021, 17:15 +0200 schrieb Brendan Tildesley:
Toggle quote (21 lines)
> > On 04/18/2021 4:47 PM Leo Prikler <leo.prikler@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?

Toggle quote (11 lines)
> > > +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.
Toggle quote (5 lines)
> 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
B
B
Brendan Tildesley wrote on 19 Apr 2021 08:56
(address . 47870@debbugs.gnu.org)(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
1897089617.84042.1618815414259@office.mailbox.org
Toggle quote (8 lines)
> On 04/18/2021 5:52 PM Leo Prikler <leo.prikler@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@student.tugraz.at>
> > > wrote:
[...]
Toggle quote (9 lines)
> > 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.
Toggle quote (2 lines)
> Regards,
> Leo
From 835d0748ca4c0738d777aed8f895622759ea4f8d Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 16:45:15 +1000
Subject: [PATCH 2/2] gnu: xfce: Start mate-polkit agent on login.

* gnu/packages/xfce.scm (xfce): Add mate-polkit to the xfce union
package. This will cause the authentication agent to be run on login.
This fixes users in XFCE not being able to edit NetworkManager settings.
---
gnu/packages/xfce.scm | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (22 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 38240d7b9f..786a8cf243 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -48,6 +48,7 @@
#:use-module (gnu packages inkscape)
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages mate)
#:use-module (gnu packages pcre)
#:use-module (gnu packages pdf)
#:use-module (gnu packages photo)
@@ -971,6 +972,7 @@ on your desktop.")
("gnome-icon-theme" ,gnome-icon-theme)
("gtk-xfce-engine" ,gtk-xfce-engine)
("hicolor-icon-theme" ,hicolor-icon-theme)
+ ("mate-polkit" ,mate-polkit)
("ristretto" ,ristretto)
("shared-mime-info" ,shared-mime-info)
("thunar" ,thunar)
--
2.31.1
From ef20e6422cea8089a4ecf2e7b0293c27bc71a56b Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 16:37:55 +1000
Subject: [PATCH 1/2] gnu: polkit-mate: Enable autostarting in XFCE.

* gnu/packages/mate.scm (polkit-mate): Add XFCE to the OnlyShowIn field
of the autostart .desktop file so it will be started by XFCE too. This
is for the same of making polkit-mate the de facto agent for XFCE in
Guix, since XFCE does not have it's own official one.

One downside of this is that since all these .desktop files end up in
/run/current-system/profile/etc/, if a user for some reasons wants to have
MATE installed, plus an XFCE that doesn't include mate-polkit, this cause
XFCE to start it anyway. Not sure if that is a big deal.
---
gnu/packages/mate.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (29 lines)
diff --git a/gnu/packages/mate.scm b/gnu/packages/mate.scm
index 44420147a3..1a8a268cc9 100644
--- a/gnu/packages/mate.scm
+++ b/gnu/packages/mate.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1511,6 +1512,14 @@ MATE Desktop to monitor your system resources and usage.")
("gtk+" ,gtk+)
("gdk-pixbuf" ,gdk-pixbuf)
("polkit" ,polkit)))
+ ;; This will allow mate-polkit to be used with XFCE too.
+ (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;") "MATE;XFCE;")))))))
(home-page "https://mate-desktop.org/")
(synopsis "DBus specific service for MATE")
(description
--
2.31.1
L
L
Leo Prikler wrote on 19 Apr 2021 09:36
758fbca893846a643f5478972867e01d620b89dc.camel@student.tugraz.at
Hi Brendan,

Am Montag, den 19.04.2021, 08:56 +0200 schrieb Brendan Tildesley:
Toggle quote (34 lines)
> > On 04/18/2021 5:52 PM Leo Prikler <leo.prikler@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@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
B
B
Brendan Tildesley wrote on 19 Apr 2021 13:02
(address . 47870@debbugs.gnu.org)(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
563816062.89942.1618830123011@office.mailbox.org
Toggle quote (47 lines)
> On 04/19/2021 9:36 AM Leo Prikler <leo.prikler@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@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@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.

Toggle quote (25 lines)
> 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.
From 9eab32585fb16b41f2158ad21b43a032ca3c914d Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 18:26:31 +1000
Subject: [PATCH 1/2] gnu: Add xfce-mate-polkit-autostart.

gnu/packages/xfce.scm (xfce-mate-polkit-autostart) New symbol.
---
gnu/packages/xfce.scm | 45 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

Toggle diff (65 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 38240d7b9f..c7ba6218f1 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -48,6 +48,7 @@
#:use-module (gnu packages inkscape)
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages mate)
#:use-module (gnu packages pcre)
#:use-module (gnu packages pdf)
#:use-module (gnu packages photo)
@@ -948,6 +949,50 @@ menubar and the window decorations are hidden) that helps you to save space
on your desktop.")
(license gpl2+)))
+(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)))))
+
(define-public xfce
(package
(name "xfce")
--
2.31.1
From d18093a93f34f7d134a6f97e58aa4abaadbe33a6 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 20:16:05 +1000
Subject: [PATCH 2/2] gnu: xfce: Add xfce-mate-polkit-autostart to inputs.

* gnu/packages/xfce.scm (xfce):[inputs]: Add xfce-mate-polkit-autostart.
---
gnu/packages/xfce.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index c7ba6218f1..974259306e 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -1016,6 +1016,7 @@ on your desktop.")
("gnome-icon-theme" ,gnome-icon-theme)
("gtk-xfce-engine" ,gtk-xfce-engine)
("hicolor-icon-theme" ,hicolor-icon-theme)
+ ("xfce-mate-polkit-autostart" ,xfce-mate-polkit-autostart)
("ristretto" ,ristretto)
("shared-mime-info" ,shared-mime-info)
("thunar" ,thunar)
--
2.31.1
L
L
Leo Prikler wrote on 19 Apr 2021 13:12
6366c8d3227b63cda7bb9b7895fb4a70889155d0.camel@student.tugraz.at
Hi Brendan,

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

Toggle quote (47 lines)
> +(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
B
B
Brendan Tildesley wrote on 19 Apr 2021 13:26
(address . 47870@debbugs.gnu.org)(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
752594641.90411.1618831613893@office.mailbox.org
Toggle quote (21 lines)
> On 04/19/2021 1:12 PM Leo Prikler <leo.prikler@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.
L
L
Leo Prikler wrote on 19 Apr 2021 14:01
10ddc05d03469890073e218715a1a6c74151e2a9.camel@student.tugraz.at
Am Montag, den 19.04.2021, 13:26 +0200 schrieb Brendan Tildesley:
Toggle quote (25 lines)
> > On 04/19/2021 1:12 PM Leo Prikler <leo.prikler@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?

B
B
Brendan Tildesley wrote on 19 Apr 2021 15:30
(address . 47870@debbugs.gnu.org)(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
1196699337.93185.1618839043709@office.mailbox.org
Toggle quote (41 lines)
> On 04/19/2021 2:01 PM Leo Prikler <leo.prikler@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@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. "
L
L
Leo Prikler wrote on 19 Apr 2021 15:47
c5f46a7f1679fccb5635311db40ceda6ecbd698e.camel@student.tugraz.at
Hi,

Am Montag, den 19.04.2021, 15:30 +0200 schrieb Brendan Tildesley:
Toggle quote (57 lines)
> > On 04/19/2021 2:01 PM Leo Prikler <leo.prikler@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@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.

Toggle quote (5 lines)
> 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.

Toggle quote (6 lines)
> 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
B
B
Brendan Tildesley wrote on 21 Apr 2021 07:31
1945027116.9867.1618983112546@office.mailbox.org
Toggle quote (1 lines)
> On 04/19/2021 3:47 PM Leo Prikler <leo.prikler@student.tugraz.at> wrote:
[...]
Toggle quote (14 lines)
> 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.



Toggle quote (10 lines)
> > 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
From eb7c6275699e9e8615ac8abf0cef768d96fe9da0 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 18:26:31 +1000
Subject: [PATCH 1/2] gnu: Add mate-polkit-for-xfce.

gnu/packages/xfce.scm (mate-polkit-for-xfce) New variable.
---
gnu/packages/xfce.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 38240d7b9f..6d272a74ac 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -14,6 +14,7 @@
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -48,6 +49,7 @@
#:use-module (gnu packages inkscape)
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages mate)
#:use-module (gnu packages pcre)
#:use-module (gnu packages pdf)
#:use-module (gnu packages photo)
@@ -948,6 +950,23 @@ menubar and the window decorations are hidden) that helps you to save space
on your desktop.")
(license gpl2+)))
+(define-public mate-polkit-for-xfce
+ (package/inherit mate-polkit
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'patch-desktop
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((a (string-append
+ (assoc-ref outputs "out") "/etc/xdg/autostart/"
+ "polkit-mate-authentication-agent-"))
+ (b (string-append a "1.desktop"))
+ (c (string-append a "for-xfce-1.desktop")))
+ (substitute* b (("MATE;") "XFCE;"))
+ ;; To avoid a conflict if both MATE and XFCE are installed.
+ (rename-file b c)))))))
+ (properties `((hidden? . #t)))))
+
(define-public xfce
(package
(name "xfce")
--
2.31.1
From ccfd8c55472d9af3050d27c9b151d12323d728ce Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Mon, 19 Apr 2021 20:16:05 +1000
Subject: [PATCH 2/2] gnu: xfce: Autostart mate-polkit.

* gnu/packages/xfce.scm (xfce):[inputs]: Add mate-polkit-for-xfce.
---
gnu/packages/xfce.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 6d272a74ac..0d38649024 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -990,6 +990,7 @@ on your desktop.")
("gnome-icon-theme" ,gnome-icon-theme)
("gtk-xfce-engine" ,gtk-xfce-engine)
("hicolor-icon-theme" ,hicolor-icon-theme)
+ ("mate-polkit-for-xfce" ,mate-polkit-for-xfce)
("ristretto" ,ristretto)
("shared-mime-info" ,shared-mime-info)
("thunar" ,thunar)
--
2.31.1
L
L
Leo Prikler wrote on 21 Apr 2021 10:44
b9b1512a528b2b3dfb164bcab5f5d03b2f09315e.camel@student.tugraz.at
Hi,

Am Mittwoch, den 21.04.2021, 07:31 +0200 schrieb Brendan Tildesley:
Toggle quote (22 lines)
> > On 04/19/2021 3:47 PM Leo Prikler <leo.prikler@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.
Toggle quote (25 lines)
>
> > > 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
Closed
?