From: Samuli Suominen <ssuominen@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] systemd.eclass: Patch for new function systemd_get_udevdir()
Date: Mon, 06 Aug 2012 14:02:41 +0300 [thread overview]
Message-ID: <501FA451.4070005@gentoo.org> (raw)
In-Reply-To: <20120806104208.GH24104@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 792 bytes --]
On 08/06/2012 01:42 PM, Fabian Groffen wrote:
> On 06-08-2012 13:37:55 +0300, Samuli Suominen wrote:
>>> Also, I'm not so sure if this will work correctly for Prefix.
>>
>> I'm sure that is easily checked and we will get feedback quickly.
>
> I'm sure systemd/udev will never run in (a) Prefix, so perhaps it is
> more sensical not to pseudo-provide support for it.
>
after thinking about this over:
rules files are often small and often get always installed, yet the
package might be running just fine without udev, the installed rules
files just don't get used
therefore adding sys-fs/udev dependency to the eclass is out of question
and should be left for ebuilds
therefore pseudo-prefix support should be left in place too... right?
attaching latest based on mgorny's feedback...
[-- Attachment #2: udev.eclass --]
[-- Type: text/plain, Size: 1272 bytes --]
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# @ECLASS: udev.eclass
# @MAINTAINER:
# udev-bugs@gentoo.org
# @BLURB: helper function to determine udevdir
# @DESCRIPTION:
# This eclass provides a function to get the default udev path.
# @EXAMPLE:
#
# @CODE
# inherit udev
#
# src_configure() {
# econf --with-udevdir="$(udev_get_udevdir)"
# }
# @CODE
inherit toolchain-funcs
case ${EAPI:-0} in
0|1|2|3|4) ;;
*) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
esac
RDEPEND=""
DEPEND="virtual/pkgconfig"
# @FUNCTION: _udev_get_udevdir
# @INTERNAL
# @DESCRIPTION:
# Get unprefixed udevdir.
_udev_get_udevdir() {
if $($(tc-getPKG_CONFIG) --exists udev); then
echo -n "$($(tc-getPKG_CONFIG) --variable=udevdir udev)"
else
echo -n /lib/udev
fi
}
# @FUNCTION: udev_get_udevdir
# @DESCRIPTION:
# Output the path for the udev directory (not including ${D}).
# This function always succeeds, even if udev is not installed.
# The fallback value is set to /lib/udev while waiting for
# >=sys-fs/udev-187-r1 to stabilize.
udev_get_udevdir() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
debug-print-function ${FUNCNAME} "${@}"
echo -n "${EPREFIX}$(_udev_get_udevdir)"
}
next prev parent reply other threads:[~2012-08-06 11:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 10:00 [gentoo-dev] [RFC] systemd.eclass: Patch for new function systemd_get_udevdir() Samuli Suominen
2012-08-06 10:20 ` Michał Górny
2012-08-06 10:37 ` Samuli Suominen
2012-08-06 10:42 ` Fabian Groffen
2012-08-06 11:02 ` Samuli Suominen [this message]
2012-08-06 11:20 ` Fabian Groffen
2012-08-06 11:49 ` Rich Freeman
2012-08-06 11:56 ` Fabian Groffen
2012-08-06 12:05 ` Rich Freeman
2012-08-06 12:15 ` Michał Górny
2012-08-06 18:16 ` Olivier Crête
2012-08-06 18:28 ` Fabian Groffen
2012-08-06 18:40 ` Olivier Crête
2012-08-06 18:44 ` Fabian Groffen
2012-08-06 12:10 ` Michał Górny
2012-08-06 11:10 ` Samuli Suominen
2012-08-06 11:44 ` Rich Freeman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=501FA451.4070005@gentoo.org \
--to=ssuominen@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox