[PATCH 1/2] gnu: xfce4-session: Fix xfce4-panel plugin detection.

  • Done
  • quality assurance status badge
Details
2 participants
  • ???
  • Kei Kebreau
Owner
unassigned
Submitted by
Kei Kebreau
Severity
normal
K
K
Kei Kebreau wrote on 6 Dec 2020 06:02
(address . guix-patches@gnu.org)(name . Kei Kebreau)(address . kkebreau@posteo.net)
20201206050224.5355-1-kkebreau@posteo.net
* gnu/packages/xfce.scm (xfce4-session)[source]: Add patch to append the path
to user-installed xfce4-panel plugins to the X_XFCE4_LIB_DIRS environment
variable.
* gnu/packages/patches/xfce4-session-xinitrc.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 3 ++-
.../patches/xfce4-session-xinitrc.patch | 19 +++++++++++++++++++
gnu/packages/xfce.scm | 1 +
3 files changed, 22 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/xfce4-session-xinitrc.patch

Toggle diff (60 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index cbfefccbb9..ca6d90cced 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -4,7 +4,7 @@
# Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org>
# Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
-# Copyright © 2016, 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
+# Copyright © 2016, 2017, 2018, 2020 Kei Kebreau <kkebreau@posteo.net>
# Copyright © 2016, 2017 Rene Saavedra <rennes@openmailbox.org>
# Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
# Copyright © 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
@@ -1721,6 +1721,7 @@ dist_patch_DATA = \
%D%/packages/patches/xf86-video-tga-remove-mibstore.patch \
%D%/packages/patches/xf86-video-voodoo-pcitag.patch \
%D%/packages/patches/xfce4-panel-plugins.patch \
+ %D%/packages/patches/xfce4-session-xinitrc.patch \
%D%/packages/patches/xfce4-settings-defaults.patch \
%D%/packages/patches/xmonad-dynamic-linking.patch \
%D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \
diff --git a/gnu/packages/patches/xfce4-session-xinitrc.patch b/gnu/packages/patches/xfce4-session-xinitrc.patch
new file mode 100644
index 0000000000..914890ff3d
--- /dev/null
+++ b/gnu/packages/patches/xfce4-session-xinitrc.patch
@@ -0,0 +1,19 @@
+Ensure that xfce4 panel plugins in the user's Guix profile can
+be found in the directories specified in X_XFCE4_LIB_DIRS.
+
+Partially fixes Guix bug #44916:
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44916.
+
+Patch by Kei Kebreau <kkebreau@posteo.net>
+
+--- xfce4-session-4.14.2/scripts/xinitrc.in.in.orig 2020-12-05 15:01:43.932285134 -0500
++++ xfce4-session-4.14.2/scripts/xinitrc.in.in 2020-12-05 15:22:06.171691694 -0500
+@@ -83,6 +83,8 @@
+ dbus-update-activation-environment --systemd XAUTHLOCALHOSTNAME=$XAUTHLOCALHOSTNAME
+ fi
+
++# load local Guix xfce4-panel plugins
++test -r "$HOME/.guix-profile/lib/xfce4" && export X_XFCE4_LIB_DIRS="$X_XFCE4_LIB_DIRS:$HOME/.guix-profile/lib/xfce4"
+
+ # check if we start xfce4-session with ck-launch-session. this is only
+ # required for starting from a console, not a login manager
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 4090372805..685ddd3e18 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -684,6 +684,7 @@ your system in categories, so you can quickly find and launch them.")
(sha256
(base32
"1bwpylcn7x9i301yz45wvkzah9bncv9b44nf4hh9ln4i1jka9qzv"))
+ (patches (search-patches "xfce4-session-xinitrc.patch"))
(modules '((guix build utils)))
(snippet
'(begin
--
2.29.2
K
K
Kei Kebreau wrote on 6 Dec 2020 06:04
[PATCH 2/2] gnu: xfce4-whiskermenu-plugin: Fix installed shell script.
(address . 45062@debbugs.gnu.org)
20201206050433.5774-1-kkebreau@posteo.net
From: Michael Rohleder <mike@rohleder.de>

* gnu/packages/xfce.scm (xfce4-whiskermenu-plugin): Fix installed shell script.
[arguments]: Add phase fix-shell-script to substitute paths to xfce4-panel and
gettext.
[inputs]: Add gettext-minimal.

Co-authored-by: Kei Kebreau <kkebreau@posteo.net>
Signed-off-by: Kei Kebreau <kkebreau@posteo.net>
---
gnu/packages/xfce.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 685ddd3e18..6f3fc34763 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -38,6 +38,7 @@
#:use-module (gnu packages cdrom)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop)
+ #:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gstreamer)
@@ -592,11 +593,21 @@ keys for controlling the audio volume.")
(inputs
`(("xfce4-panel" ,xfce4-panel)
("garcon" ,garcon)
+ ("gettext" ,gettext-minimal)
("exo" ,exo)
("gtk+" ,gtk+)
("libxfce4ui" ,libxfce4ui)))
(arguments
- `(#:tests? #f)) ; no tests
+ `(#:tests? #f ; no tests
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-shell-script
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* (string-append "panel-plugin/xfce4-popup-whiskermenu.in")
+ (("@CMAKE_INSTALL_FULL_BINDIR@")
+ (string-append (assoc-ref inputs "xfce4-panel") "/bin"))
+ (("gettext") (which "gettext")))
+ #t)))))
(home-page "https://goodies.xfce.org/projects/panel-plugins/xfce4-whiskermenu-plugin")
(synopsis "Application menu panel plugin for Xfce")
(description
--
2.29.2
?
Re: [bug#45062] [PATCH 1/2] gnu: xfce4-session: Fix xfce4-panel plugin detection.
(name . Kei Kebreau)(address . kkebreau@posteo.net)(address . 45062@debbugs.gnu.org)
TYAP286MB0185398F3DDC7183362FD61AA3CF0@TYAP286MB0185.JPNP286.PROD.OUTLOOK.COM
Kei Kebreau <kkebreau@posteo.net> writes:

Toggle quote (11 lines)
> * gnu/packages/xfce.scm (xfce4-session)[source]: Add patch to append the path
> to user-installed xfce4-panel plugins to the X_XFCE4_LIB_DIRS environment
> variable.
> [...]
> +Ensure that xfce4 panel plugins in the user's Guix profile can
> +be found in the directories specified in X_XFCE4_LIB_DIRS.
> +
> +Partially fixes Guix bug #44916:
> +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44916.
>

Quote from #44916:
Toggle quote (6 lines)
>> Aside from that, it seems like Xfce, when installed as a system-wide
>> desktop environment, does not look in the user's Guix profile for
>> plugins. Panel modules are located by Xfce in the directories listed in
>> the X_XFCE4_LIB_DIRS environment variable. For my Xfce configuration,
>> X_XFCE4_LIB_DIRS contains only /run/current-system/profile/lib/xfce4.

I think mix plugins from system and user profiles is a bad idea, the
system profile tend to be updated less than the user profile, so there
maybe some ABI problems between the xfce-panel in the system profile and
its plugins in the user profile due to mismatched versions.

Does install both ‘xfce4-panel’ and ‘xfce4-whiskermenu-plugin’ into the
user profile works (hopeful a system xfce4 session will first pickup a
user installed xfce4-panel)?
K
K
Kei Kebreau wrote on 6 Dec 2020 20:55
(name . ???)(address . iyzsong@outlook.com)(address . 45062@debbugs.gnu.org)
20201206145552.0cfe74d9@posteo.net
On Sun, 06 Dec 2020 14:50:32 +0800
??? <iyzsong@outlook.com> wrote:

Toggle quote (30 lines)
> Kei Kebreau <kkebreau@posteo.net> writes:
>
> > * gnu/packages/xfce.scm (xfce4-session)[source]: Add patch to
> > append the path to user-installed xfce4-panel plugins to the
> > X_XFCE4_LIB_DIRS environment variable.
> > [...]
> > +Ensure that xfce4 panel plugins in the user's Guix profile can
> > +be found in the directories specified in X_XFCE4_LIB_DIRS.
> > +
> > +Partially fixes Guix bug #44916:
> > +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44916.
> >
>
> Quote from #44916:
> >> Aside from that, it seems like Xfce, when installed as a
> >> system-wide desktop environment, does not look in the user's Guix
> >> profile for plugins. Panel modules are located by Xfce in the
> >> directories listed in the X_XFCE4_LIB_DIRS environment variable.
> >> For my Xfce configuration, X_XFCE4_LIB_DIRS contains only
> >> /run/current-system/profile/lib/xfce4.
>
> I think mix plugins from system and user profiles is a bad idea, the
> system profile tend to be updated less than the user profile, so there
> maybe some ABI problems between the xfce-panel in the system profile
> and its plugins in the user profile due to mismatched versions.
>
> Does install both ‘xfce4-panel’ and ‘xfce4-whiskermenu-plugin’ into
> the user profile works (hopeful a system xfce4 session will first
> pickup a user installed xfce4-panel)?

Installing both 'xfce4-panel' and 'xfce4-whiskermenu-plugin' into the
user profile does work! Is there a way to make clear to users and
administrators that xfce4-panel and its plugins should both be
installed at the user or system level to ensure proper function? I
don't think it's obvious since our Xfce desktop service implicitly
installs the xfce4-panel.
?
(name . Kei Kebreau)(address . kkebreau@posteo.net)(address . 45062@debbugs.gnu.org)
TYAP286MB018505ABD00FEB55EB99B34AA3CE0@TYAP286MB0185.JPNP286.PROD.OUTLOOK.COM
Kei Kebreau <kkebreau@posteo.net> writes:

Toggle quote (2 lines)
> Installing both 'xfce4-panel' and 'xfce4-whiskermenu-plugin' into the
> user profile does work!
Okay, but I guess that will be some problem too, since then
X_XFCE4_LIB_DIRS would contain both system and user paths...

Toggle quote (6 lines)
> Is there a way to make clear to users and
> administrators that xfce4-panel and its plugins should both be
> installed at the user or system level to ensure proper function? I
> don't think it's obvious since our Xfce desktop service implicitly
> installs the xfce4-panel.

Yes, how about document it like this:
From 75fdb19ea4f68d7e8af899ef4611d269d4821f29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Mon, 7 Dec 2020 19:11:03 +0800
Subject: [PATCH] doc: Document about xfce4-panel plugins.

* doc/guix.texi (Desktop Services): Document that xfce4-panel plugin packages
should be added to the 'packages' field of OS.
---
doc/guix.texi | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (19 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index a21c4d614e..5eb5b47e14 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18563,6 +18563,12 @@ This service adds the @code{xfce} package to the system profile, and
extends polkit with the ability for @code{thunar} to manipulate the file
system as root from within a user session, after the user has authenticated
with the administrator's password.
+
+Note that @code{xfce4-panel} and its plugin packages should in the same
+profile to ensure compatibility, when use this @code{xfce} service, you
+should add extra plugins (xfce4-whiskermenu-plugin,
+xfce4-weather-plugin, etc.) to the @code{packages} field of your
+@code{operating-system}.
@end defvr
@deftp {Data Type} xfce-desktop-configuration
--
2.29.2
BTW, your second patch for xfce4-whiskermenu-plugin LGTM, please push.

Thank you!
K
K
Kei Kebreau wrote on 7 Dec 2020 22:17
(name . ???)(address . iyzsong@outlook.com)(address . 45062-done@debbugs.gnu.org)
20201207161756.27f3609c@posteo.net
I've edited your documentation patch a little bit and pushed it to
master along with my second patch. Thanks for your input and patch!

Kei

On Mon, 07 Dec 2020 19:21:51 +0800
??? <iyzsong@outlook.com> wrote:

Toggle quote (15 lines)
> Kei Kebreau <kkebreau@posteo.net> writes:
>
> > Installing both 'xfce4-panel' and 'xfce4-whiskermenu-plugin' into
> > the user profile does work!
> Okay, but I guess that will be some problem too, since then
> X_XFCE4_LIB_DIRS would contain both system and user paths...
>
> > Is there a way to make clear to users and
> > administrators that xfce4-panel and its plugins should both be
> > installed at the user or system level to ensure proper function? I
> > don't think it's obvious since our Xfce desktop service implicitly
> > installs the xfce4-panel.
>
> Yes, how about document it like this:
>
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 45062@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 45062
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch