Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916677 - sys-power/upower-0.99.20 define -Dudevhwdbdir
Summary: sys-power/upower-0.99.20 define -Dudevhwdbdir
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-01 21:07 UTC by Esteve Varela Colominas
Modified: 2024-01-29 20:09 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esteve Varela Colominas 2023-11-01 21:07:56 UTC
-Dudevhwdbdir should be defined similar to how -Dudevrulesdir is. As is, the behavior of both variables is inconsistent. On my system, this is currently causing the rules to be installed in /usr/hwdb.d, as the `udev_dir` variable is missing from libudev.pc
Comment 1 Esteve Varela Colominas 2023-11-01 21:16:30 UTC
Workaround that works when put in /etc/portage/env/sys-power/upower:

pre_src_configure() {
	MYMESONARGS="-Dudevhwdbdir='$EPREFIX$(get_udevdir)/hwdb.d' $MYMESONARGS"
}
Comment 2 Pacho Ramos gentoo-dev 2023-11-12 10:32:07 UTC
This looks solved in 1.90.2 as upstream installs them under udev_dir by default:
udevhwdbdir = get_option('udevhwdbdir')
if udevhwdbdir == 'auto'
    udev_dep = dependency('udev', required: true)
    udevhwdbdir = udev_dep.get_variable(pkgconfig: 'udev_dir') / 'hwdb.d'
endif
Comment 3 Esteve Varela Colominas 2023-11-12 11:01:28 UTC
Not exactly, the udev_dir variable is missing from libudev.pc[1], so it just ends up empty.

[1]: https://github.com/systemd/systemd/blob/main/src/libudev/libudev.pc.in
Comment 4 Pacho Ramos gentoo-dev 2023-11-12 11:06:44 UTC
I get the file properly installed in /usr/lib/udev/hwdb.d/95-upower-hid.hwdb because we are setting udev_dir in the ebuild
Comment 5 Esteve Varela Colominas 2023-11-12 12:05:41 UTC
It's grabbing udev_dir from pkg-config, not from the ebuild. I'm suggesting adding it to the ebuild for good measure, just like -Dudevrulesdir is (which has the same fallback when unset).
Comment 6 Esteve Varela Colominas 2024-01-29 19:41:59 UTC
Turns out the bug is specific to eudev, though I'm not entirely sure how. I'll file it to upstream, though it'd still be good to have consistent behavior for both -Dudevrulesdir and -Dudevhwdbdir in this ebuild (either define both or define none).
Comment 7 Esteve Varela Colominas 2024-01-29 19:46:47 UTC
Nevermind, it was fixed upstream in udev as well.
Comment 8 Esteve Varela Colominas 2024-01-29 19:47:02 UTC
*eudev...
Comment 9 Mike Gilbert gentoo-dev 2024-01-29 19:55:40 UTC
(In reply to Esteve Varela Colominas from comment #3)
> Not exactly, the udev_dir variable is missing from libudev.pc[1], so it just
> ends up empty.

The variable comes from udev.pc, not libudev.pc.

https://github.com/systemd/systemd/blob/v255/src/udev/udev.pc.in
Comment 10 Larry the Git Cow gentoo-dev 2024-01-29 20:05:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=359c32e4437f309b2050cc7fe9723fb2ebf04c00

commit 359c32e4437f309b2050cc7fe9723fb2ebf04c00
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-01-29 20:04:06 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-01-29 20:04:06 +0000

    sys-power/upower: drop -Dudevrulesdir
    
    We depend on virtual/udev, which should ensure that udev.pc is
    available.
    
    Bug: https://bugs.gentoo.org/916677
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-power/upower/upower-0.99.20.ebuild | 3 +--
 sys-power/upower/upower-1.90.2.ebuild  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
Comment 11 Esteve Varela Colominas 2024-01-29 20:09:00 UTC
I see, thanks. I traced the issue back and apparently it was fixed a few years ago. I think I reported it when I still had 3.2.11, the last stable available in ::gentoo at the time, which is even older...