public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] rfc: patch systemd.eclass to use pkg-config if available
@ 2013-03-11 21:18 William Hubbs
  2013-03-11 21:37 ` Mike Gilbert
  0 siblings, 1 reply; 5+ messages in thread
From: William Hubbs @ 2013-03-11 21:18 UTC (permalink / raw
  To: gentoo development; +Cc: systemd, ssuominen


[-- Attachment #1.1: Type: text/plain, Size: 338 bytes --]

All,

systemd, like udev, stores directory paths in a way that they can be
queried from pkg-config. However, the systemd.eclass currently does not
use this ability.

The following patch models the systemd eclass after the udev eclass and
leaves the current defaults in place if there is an issue with
pkg-config.

Any thoughts?

William


[-- Attachment #1.2: systemd.eclass.patch --]
[-- Type: text/x-diff, Size: 2182 bytes --]

Index: eclass/systemd.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v
retrieving revision 1.21
diff -u -b -B -r1.21 systemd.eclass
--- eclass/systemd.eclass	31 Dec 2012 13:09:09 -0000	1.21
+++ eclass/systemd.eclass	11 Mar 2013 21:04:16 -0000
@@ -25,17 +25,25 @@
 # }
 # @CODE
 
+inherit toolchain-funcs
+
 case ${EAPI:-0} in
 	0|1|2|3|4|5) ;;
 	*) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
 esac
 
+DEPEND="virtual/pkgconfig"
+
 # @FUNCTION: _systemd_get_unitdir
 # @INTERNAL
 # @DESCRIPTION:
 # Get unprefixed unitdir.
 _systemd_get_unitdir() {
+	if $($(tc-getPKG_CONFIG) --exists systemd); then
+		echo "$($(tc-getPKG_CONFIG) --variable=systemdsystemunitdir systemd)"
+	else
 	echo /usr/lib/systemd/system
+	fi
 }
 
 # @FUNCTION: systemd_get_unitdir
@@ -49,6 +57,18 @@
 	echo "${EPREFIX}$(_systemd_get_unitdir)"
 }
 
+# @FUNCTION: _systemd_get_userunitdir
+# @INTERNAL
+# @DESCRIPTION:
+# Get unprefixed userunitdir.
+_systemd_get_userunitdir() {
+	if $($(tc-getPKG_CONFIG) --exists systemd); then
+		echo "$($(tc-getPKG_CONFIG) --variable=systemduserunitdir systemd)"
+	else
+		echo /usr/lib/systemd/user
+	fi
+}
+
 # @FUNCTION: systemd_get_userunitdir
 # @DESCRIPTION:
 # Output the path for the systemd user unit directory (not including
@@ -58,7 +78,19 @@
 	has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
 	debug-print-function ${FUNCNAME} "${@}"
 
-	echo "${EPREFIX}/usr/lib/systemd/user"
+	echo "${EPREFIX}$(_systemd_get_userunitdir)"
+}
+
+# @FUNCTION: _systemd_get_utildir
+# @INTERNAL
+# @DESCRIPTION:
+# Get unprefixed utildir.
+_systemd_get_utildir() {
+	if $($(tc-getPKG_CONFIG) --exists systemd); then
+		echo "$($(tc-getPKG_CONFIG) --variable=systemdutildir systemd)"
+	else
+		echo /usr/lib/systemd
+	fi
 }
 
 # @FUNCTION: systemd_get_utildir
@@ -70,7 +102,7 @@
 	has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
 	debug-print-function ${FUNCNAME} "${@}"
 
-	echo "${EPREFIX}/usr/lib/systemd"
+	echo "${EPREFIX}$(_systemd_get_utildir)"
 }
 
 # @FUNCTION: systemd_dounit

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] rfc: patch systemd.eclass to use pkg-config if available
  2013-03-11 21:18 [gentoo-dev] rfc: patch systemd.eclass to use pkg-config if available William Hubbs
@ 2013-03-11 21:37 ` Mike Gilbert
  2013-03-11 22:28   ` William Hubbs
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Gilbert @ 2013-03-11 21:37 UTC (permalink / raw
  To: gentoo-dev, systemd, ssuominen

On Mon, Mar 11, 2013 at 5:18 PM, William Hubbs <williamh@gentoo.org> wrote:
> All,
>
> systemd, like udev, stores directory paths in a way that they can be
> queried from pkg-config. However, the systemd.eclass currently does not
> use this ability.
>
> The following patch models the systemd eclass after the udev eclass and
> leaves the current defaults in place if there is an issue with
> pkg-config.
>
> Any thoughts?
>
> William
>

What problem are you trying to solve here?

We already know the values that pkg-config will return, so I fail to
see the advantage of calling pkg-config in the eclass.

If we were to move the /usr/lib/systemd directory between two versions
of systemd, then yes, using pkg-config would be helpful. Until/unless
such a change occurs, I just don't see the point.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] rfc: patch systemd.eclass to use pkg-config if available
  2013-03-11 21:37 ` Mike Gilbert
@ 2013-03-11 22:28   ` William Hubbs
  2013-03-11 22:47     ` Michał Górny
  0 siblings, 1 reply; 5+ messages in thread
From: William Hubbs @ 2013-03-11 22:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: systemd, ssuominen

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

On Mon, Mar 11, 2013 at 05:37:12PM -0400, Mike Gilbert wrote:
> On Mon, Mar 11, 2013 at 5:18 PM, William Hubbs <williamh@gentoo.org> wrote:
> > All,
> >
> > systemd, like udev, stores directory paths in a way that they can be
> > queried from pkg-config. However, the systemd.eclass currently does not
> > use this ability.
> >
> > The following patch models the systemd eclass after the udev eclass and
> > leaves the current defaults in place if there is an issue with
> > pkg-config.
> >
> > Any thoughts?
> >
> > William
> >
> 
> What problem are you trying to solve here?
> 
> We already know the values that pkg-config will return, so I fail to
> see the advantage of calling pkg-config in the eclass.
> 
> If we were to move the /usr/lib/systemd directory between two versions
> of systemd, then yes, using pkg-config would be helpful. Until/unless
> such a change occurs, I just don't see the point.

The reason for this is a topic that Samuli and I want to discuss with
the systemd team, probably on irc, but, basically, since gentoo does not
have the /usr merge, we think parts of systemd which are in /usr
should go in /, and this goes along with systemd upstream's recommendations
as well (look at how the autogen.sh script in the systemd git repo works
to see what I'm talking about).

This would also allow udev and systemd to share the /lib/systemd
directory, and we could install compatibility symlinks where necessary
to not break users' systems.

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] rfc: patch systemd.eclass to use pkg-config if available
  2013-03-11 22:28   ` William Hubbs
@ 2013-03-11 22:47     ` Michał Górny
  2013-03-11 23:05       ` William Hubbs
  0 siblings, 1 reply; 5+ messages in thread
From: Michał Górny @ 2013-03-11 22:47 UTC (permalink / raw
  To: gentoo-dev; +Cc: williamh, systemd, ssuominen

[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]

On Mon, 11 Mar 2013 17:28:08 -0500
William Hubbs <williamh@gentoo.org> wrote:

> On Mon, Mar 11, 2013 at 05:37:12PM -0400, Mike Gilbert wrote:
> > On Mon, Mar 11, 2013 at 5:18 PM, William Hubbs <williamh@gentoo.org> wrote:
> > > All,
> > >
> > > systemd, like udev, stores directory paths in a way that they can be
> > > queried from pkg-config. However, the systemd.eclass currently does not
> > > use this ability.
> > >
> > > The following patch models the systemd eclass after the udev eclass and
> > > leaves the current defaults in place if there is an issue with
> > > pkg-config.
> > >
> > > Any thoughts?
> > >
> > > William
> > >
> > 
> > What problem are you trying to solve here?
> > 
> > We already know the values that pkg-config will return, so I fail to
> > see the advantage of calling pkg-config in the eclass.
> > 
> > If we were to move the /usr/lib/systemd directory between two versions
> > of systemd, then yes, using pkg-config would be helpful. Until/unless
> > such a change occurs, I just don't see the point.
> 
> The reason for this is a topic that Samuli and I want to discuss with
> the systemd team, probably on irc, but, basically, since gentoo does not
> have the /usr merge, we think parts of systemd which are in /usr
> should go in /, and this goes along with systemd upstream's recommendations
> as well (look at how the autogen.sh script in the systemd git repo works
> to see what I'm talking about).
> 
> This would also allow udev and systemd to share the /lib/systemd
> directory, and we could install compatibility symlinks where necessary
> to not break users' systems.

No. And I don't have the time to repeat that discussion again. Just no.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] rfc: patch systemd.eclass to use pkg-config if available
  2013-03-11 22:47     ` Michał Górny
@ 2013-03-11 23:05       ` William Hubbs
  0 siblings, 0 replies; 5+ messages in thread
From: William Hubbs @ 2013-03-11 23:05 UTC (permalink / raw
  To: gentoo-dev; +Cc: systemd, ssuominen

[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]

On Mon, Mar 11, 2013 at 11:47:47PM +0100, Michał Górny wrote:
> On Mon, 11 Mar 2013 17:28:08 -0500
> William Hubbs <williamh@gentoo.org> wrote:
> 
> > On Mon, Mar 11, 2013 at 05:37:12PM -0400, Mike Gilbert wrote:
> > > On Mon, Mar 11, 2013 at 5:18 PM, William Hubbs <williamh@gentoo.org> wrote:
> > > > All,
> > > >
> > > > systemd, like udev, stores directory paths in a way that they can be
> > > > queried from pkg-config. However, the systemd.eclass currently does not
> > > > use this ability.
> > > >
> > > > The following patch models the systemd eclass after the udev eclass and
> > > > leaves the current defaults in place if there is an issue with
> > > > pkg-config.
> > > >
> > > > Any thoughts?
> > > >
> > > > William
> > > >
> > > 
> > > What problem are you trying to solve here?
> > > 
> > > We already know the values that pkg-config will return, so I fail to
> > > see the advantage of calling pkg-config in the eclass.
> > > 
> > > If we were to move the /usr/lib/systemd directory between two versions
> > > of systemd, then yes, using pkg-config would be helpful. Until/unless
> > > such a change occurs, I just don't see the point.
> > 
> > The reason for this is a topic that Samuli and I want to discuss with
> > the systemd team, probably on irc, but, basically, since gentoo does not
> > have the /usr merge, we think parts of systemd which are in /usr
> > should go in /, and this goes along with systemd upstream's recommendations
> > as well (look at how the autogen.sh script in the systemd git repo works
> > to see what I'm talking about).
> > 
> > This would also allow udev and systemd to share the /lib/systemd
> > directory, and we could install compatibility symlinks where necessary
> > to not break users' systems.
> 
> No. And I don't have the time to repeat that discussion again. Just no.

This was also the extent of your objections when I did bring it up to
you informally before. It would really help if you would explain your
position.

Thanks,

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-11 23:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 21:18 [gentoo-dev] rfc: patch systemd.eclass to use pkg-config if available William Hubbs
2013-03-11 21:37 ` Mike Gilbert
2013-03-11 22:28   ` William Hubbs
2013-03-11 22:47     ` Michał Górny
2013-03-11 23:05       ` William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox