Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 668156 - x11-misc/xdg-utils-1.1.3-r1 hard dbus requirement
Summary: x11-misc/xdg-utils-1.1.3-r1 hard dbus requirement
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords: PullRequest
: 668200 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-09 11:38 UTC by Tom Dexter
Modified: 2020-07-25 17:54 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild (xdg-utils-1.1.3-r2.ebuild,2.29 KB, text/plain)
2018-10-21 02:58 UTC, Anthony Segredo
Details
patch to remove dbus (xdg-noflatpak.patch,2.25 KB, patch)
2018-10-21 03:00 UTC, Anthony Segredo
Details | Diff
patch to remove screensaver (xdg-noscreensaver.patch,591 bytes, patch)
2018-10-21 03:01 UTC, Anthony Segredo
Details | Diff
Add dbus and gnome USE flags (xdg-utils-1.1.3-r2.ebuild,2.16 KB, text/plain)
2018-11-16 20:18 UTC, Matthew Turnbull
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Dexter 2018-10-09 11:38:39 UTC
Between x11-misc/xdg-utils-1.1.1-r1 and x11-misc/xdg-utils-1.1.3-r1 a hard requirement for dbus was added. My understanding is that the only component of x11-misc/xdg-utils that requires it is xdg-screensaver which has always required dbus.

Many of us don't use dbus and have no need for xdg-screensaver, but use packages that require x11-misc/xdg-utils. Could that requirement at least be optional based on perhaps the existing dbus USE or the like?

Thanks!
Comment 1 Hadrien Lacour 2018-10-09 14:34:58 UTC
By the way, it may help some, I just copied xdg-screensaver to ~/bin and commented the lines from `detectDE` to `xautolock -enable > /dev/null 2>&1 && DE="xautolock_screensaver"` (1389-1397) and just set the DE myself (`DE=xscreensaver`) so mpv can still inhibit xscreensaver without relying on heartbeat-cmd and the dbus cancer can be avoided.
Comment 2 Mike Gilbert gentoo-dev 2018-10-09 15:15:31 UTC
I would accept a patch to add a "screensaver" USE flag, which would control the installation the xdg-screensaver program.
Comment 3 Andreas Sturmlechner gentoo-dev 2018-10-10 17:44:55 UTC
*** Bug 668200 has been marked as a duplicate of this bug. ***
Comment 4 Tom Dexter 2018-10-11 18:25:34 UTC
Maybe someone can come up with that. Looking at it I'm not clear what that would involve. Clearly the configure script has no option related to that, and offhand I don't follow exactly how the install process there works.
Comment 5 Anthony Segredo 2018-10-12 13:02:40 UTC
The other utils also use dbus-send but the notes indicate that it is needed for gnome. I've patched it out and am happily using it on Mate-1.12
I can easily mark it up to use the existing gnome flag and the new screensaver flag if you wish. Perhaps you would want them to be default ON ?
Comment 6 Mike Gilbert gentoo-dev 2018-10-12 14:47:39 UTC
(In reply to Anthony Segredo from comment #5)
> I can easily mark it up to use the existing gnome flag and the new
> screensaver flag if you wish.

Yeah, I guess that makes sense.

> Perhaps you would want them to be default ON ?

gnome should default to off, screensaver should default to on.
Comment 7 Garry Filakhtov 2018-10-12 22:34:08 UTC
Hi everyone!

Super late to the party, sorry. Had a busy week. Is anyone actively working on this issue? I would be willing to modify what is necessary, introduce configure flags and patch involved files to skip GNOME-specific checks if "gnome" flag is disabled and skip xdg-screensaver installation if "screensaver" flag is disabled.

I would also like to send all this work to an upstream, but I'm not sure how to do so?..
Comment 8 Anthony Segredo 2018-10-21 02:58:49 UTC
Created attachment 552030 [details]
ebuild
Comment 9 Anthony Segredo 2018-10-21 03:00:00 UTC
Created attachment 552032 [details, diff]
patch to remove dbus
Comment 10 Anthony Segredo 2018-10-21 03:01:03 UTC
Created attachment 552034 [details, diff]
patch to remove screensaver
Comment 11 Anthony Segredo 2018-10-21 03:15:34 UTC
Looks like my comment got lost! Not used to working with Bugzilla.

1. Although the documentation says dbus is needed for gnome, the actual code shows dbus (actually gdbus) called directly only for something called "flatpak".
I there fore called the flag dbus instead of gnome because I think it's a misnomer. If the DE is gnome, the code makes a gnome call. Similarly KDE and Mate make their own unique calls. Also, repoman complained about screensaver as a flag so I went with xscreensaver. Of course, Mike as the dev can call them whatever. It's his call.

2. Repoman (2.3.9) called a fatal error on Line 1 (copyright) so I changed it from "Gentoo authors" back to "Gentoo Foundation" solely for that reason.

3. I updated the EAPI to 7. It only needed the edit. It works as either 6 or 7.

4. I haven't updated metadata.xml. Waiting for Mike's final say on the flag names.

5. I had lost my work, so I had to recreate it. I'm sorry for the delay.


Tom and Garry, why don't you put this ebuild in your local overlay and see how they work for you. I've tested the three new flag combos and they seem to work for me.
Comment 12 Mike Gilbert gentoo-dev 2018-10-21 15:26:40 UTC
Comment on attachment 552032 [details, diff]
patch to remove dbus

This patch seems mostly pointless. We can just let the gdbus calls fail if gdbus is not available.

Removing the dbus-send call from xdg-utils-common seems wrong.
Comment 13 Mike Gilbert gentoo-dev 2018-10-21 15:29:44 UTC
Comment on attachment 552034 [details, diff]
patch to remove screensaver

It would be simpler to just remove the script in src_install.
Comment 14 Mike Gilbert gentoo-dev 2018-10-21 15:32:48 UTC
Upon further review, I think we can just drop the gnome/dbus USE flag, and let it get pulled in implicitly if the user happens to be running gnome.

I would still like to see a "screensaver" USE flag to control installation of the xdg-screensaver script since that utilizes dbus more extensively than the others.
Comment 15 Don O 2018-10-23 14:07:04 UTC
re. comment 13, it would be even simpler to just make 1.1.3 be like 1.1.1, ie no dbus "dependency" and if screensaver script fails, it'll spit out a message. I would imagine the number of people that actually use that script could be counted on my fingers.

As far as the dbus-send call in the other scripts, if it's not there, then the if-else just falls through to the next choice. It's always worked that way, when dbus wasn't installed.

So all that really needs to be done is remove dev-perl/Net-DBus and sys-apps/dbus from the RDEPEND section. 

All my opinion, of course.
Comment 16 Mike Gilbert gentoo-dev 2018-10-23 14:16:17 UTC
The simplest solution is for me to close this as WONTFIX; I'm trying to reach a compromise here.
Comment 17 Martin Cihlář 2018-10-23 14:27:05 UTC
(In reply to Mike Gilbert from comment #16)
> The simplest solution is for me to close this as WONTFIX; I'm trying to
> reach a compromise here.

That's disappointing, why isn't what you said in comment #13 about having a "screensaver" flag do nothing more but exclude the screensaver script from src_install() a good solution?
Comment 18 Mike Gilbert gentoo-dev 2018-10-23 14:36:48 UTC
(In reply to Martin Cihlář from comment #17)

I never said it wasn't a good solution. Please consider comment 16 in the context of comment 15.
Comment 19 Martin Cihlář 2018-10-23 16:36:54 UTC
I apologise, I see what you meant now.

The option of installing the screensaver script and just having it fail if D-Bus is absent as outlined in comment #15 feels inherently wrong to me; I would personally like to see the aforementioned solution of the script's inclusion be controlled by a corresponding USE flag implemented.

Sidenote, I have x11-misc/xdg-utils-1.1.1-r1 installed, xdg-screensaver as a script is present and working (xdg-screensaver activate, xdg-screensaver lock with XScreensaver 5.40); what changed in the 1.1.3 version to warrant the D-Bus dependency? (Something in this bug that I missed?)
Comment 20 Don O 2018-10-23 19:01:33 UTC
Sorry if I offended you, Mike, that certainly wasn't my intention. re comment 15
Comment 21 Don O 2018-10-23 19:58:57 UTC
I hope I don't offend again, but let me try and explain what I see in xscreensaver.

It tries to find which DE is running
gnome
mate
cinnamon
kde3
xfce
generic
and a couple of other choices.

It only uses dbus IF gnome, mate or cinnamon are used, and they likely have it installed already.

It uses dcop for kde3

For generic ie. xfce and non-main DE (openbox, etc) it uses xset which works without dbus.



I hope I explained it well, enough.
Comment 22 Mike Gilbert gentoo-dev 2018-10-23 20:00:19 UTC
(In reply to Don O from comment #20)

No offense taken.
Comment 23 Mike Gilbert gentoo-dev 2018-10-23 20:07:08 UTC
(In reply to Don O from comment #21)

It looks like dbus-send is also used for modern KDE environment.

Point taken though: the xdg-screeensaver script doesn't completely depend on dbus. Maybe a "dbus" USE flag to control optional runtime deps would suffice. Or we emit a message in pkg_postinst.
Comment 24 Hadrien Lacour 2018-10-24 16:46:45 UTC
The USE flag sounds like the best option, since some GNOME/KDE stuff will probably need to depends on it.
Comment 25 Matthew Turnbull 2018-11-16 20:18:44 UTC
Created attachment 555360 [details]
Add dbus and gnome USE flags

So, I was poking around in xdg-screensaver, and just to summarize:
* Multiple DE are supported.
* Most rely on dbus-send.
* Some use a command provided by the DE or screensaver (xset, dcop, xscreensaver-command)
* Only gnome relies on perl Net::DBus and X11::Protocol.

IMHO, gnome warrants its own USE flag because it is a special case. If the user already has gnome installed, they probably have the gnome USE flag set as well.

Regarding general dbus-send support, I see two options. Add a dbus USE flag, or drop the dependency and let the screensaver/DE pull it in.

This ebuild adds dbus and gnome to the USE flags. These flags only control dependencies.
Comment 26 Nuno Silva 2019-10-27 14:47:49 UTC
What is the current status of this? Is any of the attached ebuilds acceptable or should it be done in a different way?
Comment 27 Larry the Git Cow gentoo-dev 2020-07-25 17:54:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=233397e2e14c07337bddcf0ed68007a240444d54

commit 233397e2e14c07337bddcf0ed68007a240444d54
Author:     Volkmar W. Pogatzki <gentoo@pogatzki.net>
AuthorDate: 2020-07-25 16:06:14 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-07-25 17:53:02 +0000

    x11-misc/xdg-utils: dbus and gnome optional
    
    Taking over changes from attachment
    https://bugs.gentoo.org/attachment.cgi?id=555360
    
    Closes: https://bugs.gentoo.org/668156
    Closes: https://github.com/gentoo/gentoo/pull/16815
    Package-Manager: Portage-2.3.103, Repoman-2.3.23
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../xdg-utils/xdg-utils-1.1.3_p20200220-r1.ebuild  | 75 ++++++++++++++++++++++
 1 file changed, 75 insertions(+)