* [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
@ 2012-08-27 22:19 Michał Górny
2012-08-27 22:23 ` Ciaran McCreesh
` (3 more replies)
0 siblings, 4 replies; 26+ messages in thread
From: Michał Górny @ 2012-08-27 22:19 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Right now, it just contains the function Tiziano listed in his post[1].
I'd appreciate further ideas, feedback, and possibly an example from
someone who will actually need it.
---
gx86/eclass/boost-utils.eclass | 43 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 gx86/eclass/boost-utils.eclass
diff --git a/gx86/eclass/boost-utils.eclass b/gx86/eclass/boost-utils.eclass
new file mode 100644
index 0000000..b5a9f55
--- /dev/null
+++ b/gx86/eclass/boost-utils.eclass
@@ -0,0 +1,43 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+if [[ ! ${_BOOST_ECLASS} ]]; then
+
+# @ECLASS: boost-utils.eclass
+# @MAINTAINER:
+# mgorny@gentoo.org
+# @BLURB: helper functions for packages using Boost C++ library
+# @DESCRIPTION:
+# Helper functions to be used when building packages using the Boost C++
+# library collection.
+
+case ${EAPI:-0} in
+ 0|1|2|3|4) ;;
+ *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
+esac
+
+inherit versionator
+
+# @FUNCTION: boost-utils_get_best_slot
+# @DESCRIPTION:
+# Get newest SLOT (major version) of Boost.
+boost-utils_get_best_slot() {
+ local pkg=dev-libs/boost
+ local atom=$(best_version ${pkg})
+ get_version_component_range 1-2 ${atom#${pkg}}
+}
+
+# @FUNCTION: boost-utils_get_includedir
+# @DESCRIPTION:
+# Get correct includedir for best Boost version. Outputs the sole path
+# (without -I).
+boost-utils_get_includedir() {
+ local slot=$(boost-utils_get_best_slot)
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
+}
+
+_BOOST_ECLASS=1
+fi # _BOOST_ECLASS
--
1.7.12
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-27 22:19 [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost Michał Górny
@ 2012-08-27 22:23 ` Ciaran McCreesh
2012-08-27 22:31 ` Michał Górny
2012-08-27 23:03 ` Andreas K. Huettel
` (2 subsequent siblings)
3 siblings, 1 reply; 26+ messages in thread
From: Ciaran McCreesh @ 2012-08-27 22:23 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
On Tue, 28 Aug 2012 00:19:28 +0200
Michał Górny <mgorny@gentoo.org> wrote:
> + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
Until EAPI 5 is available with support for IUSE_IMPLICIT, if you 'use
prefix', then prefix has to be listed in IUSE.
--
Ciaran McCreesh
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-27 22:23 ` Ciaran McCreesh
@ 2012-08-27 22:31 ` Michał Górny
0 siblings, 0 replies; 26+ messages in thread
From: Michał Górny @ 2012-08-27 22:31 UTC (permalink / raw
To: gentoo-dev; +Cc: ciaran.mccreesh
[-- Attachment #1: Type: text/plain, Size: 507 bytes --]
On Mon, 27 Aug 2012 23:23:31 +0100
Ciaran McCreesh <ciaran.mccreesh@googlemail.com> wrote:
> On Tue, 28 Aug 2012 00:19:28 +0200
> Michał Górny <mgorny@gentoo.org> wrote:
> > + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
>
> Until EAPI 5 is available with support for IUSE_IMPLICIT, if you 'use
> prefix', then prefix has to be listed in IUSE.
Great. Please report a bug, one for each existing eclass. I will copy
their solution then. Thank you.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-27 22:19 [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost Michał Górny
2012-08-27 22:23 ` Ciaran McCreesh
@ 2012-08-27 23:03 ` Andreas K. Huettel
2012-08-28 8:02 ` Michał Górny
2012-08-28 4:26 ` Arfrever Frehtes Taifersar Arahesis
2012-08-31 9:27 ` Michał Górny
3 siblings, 1 reply; 26+ messages in thread
From: Andreas K. Huettel @ 2012-08-27 23:03 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: Text/Plain, Size: 1270 bytes --]
Am Dienstag, 28. August 2012, 00:19:28 schrieb Michał Górny:
> Right now, it just contains the function Tiziano listed in his post[1].
> I'd appreciate further ideas, feedback, and possibly an example from
> someone who will actually need it.
How about a function that just outputs the entire required dependency string?
Such that we can (similar to add_kdebase_dep) write
DEPEND="$(add_boost_dep)"
(Probably we may want to pass parameters here for useflags and version, here's
the doc for kdebase_dep from kde4-functions.eclass (and for boost we would not
need a package name):
# @FUNCTION: add_kdebase_dep
# @DESCRIPTION:
# Create proper dependency for kde-base/ dependencies.
# This takes 1 to 3 arguments. The first being the package name, the optional
# second is additional USE flags to append, and the optional third is the
# version to use instead of the automatic version (use sparingly).
# The output of this should be added directly to DEPEND/RDEPEND, and may be
# wrapped in a USE conditional (but not an || conditional without an extra set
# of parentheses).
)
Cheers,
Andreas
--
Andreas K. Huettel
Gentoo Linux developer
kde (team lead), sci, tex, arm, printing
dilfridge@gentoo.org
http://www.akhuettel.de/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-27 22:19 [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost Michał Górny
2012-08-27 22:23 ` Ciaran McCreesh
2012-08-27 23:03 ` Andreas K. Huettel
@ 2012-08-28 4:26 ` Arfrever Frehtes Taifersar Arahesis
2012-08-28 7:43 ` hasufell
2012-08-28 8:06 ` Michał Górny
2012-08-31 9:27 ` Michał Górny
3 siblings, 2 replies; 26+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-08-28 4:26 UTC (permalink / raw
To: Gentoo Development
[-- Attachment #1: Type: Text/Plain, Size: 1736 bytes --]
2012-08-28 00:19:28 Michał Górny napisał(a):
> --- /dev/null
> +++ b/gx86/eclass/boost-utils.eclass
> @@ -0,0 +1,43 @@
> +# Copyright 1999-2012 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +# $Header: $
> +
> +if [[ ! ${_BOOST_ECLASS} ]]; then
> +
> +# @ECLASS: boost-utils.eclass
> +# @MAINTAINER:
> +# mgorny@gentoo.org
It is better to copy list of maintainers from gentoo-x86/dev-libs/boost/metadata.xml.
> +# @BLURB: helper functions for packages using Boost C++ library
> +# @DESCRIPTION:
> +# Helper functions to be used when building packages using the Boost C++
> +# library collection.
> +
> +case ${EAPI:-0} in
> + 0|1|2|3|4) ;;
> + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
> +esac
Please accept all EAPIs.
> +inherit versionator
> +
> +# @FUNCTION: boost-utils_get_best_slot
> +# @DESCRIPTION:
> +# Get newest SLOT (major version) of Boost.
> +boost-utils_get_best_slot() {
> + local pkg=dev-libs/boost
> + local atom=$(best_version ${pkg})
> + get_version_component_range 1-2 ${atom#${pkg}}
> +}
> +
> +# @FUNCTION: boost-utils_get_includedir
> +# @DESCRIPTION:
> +# Get correct includedir for best Boost version. Outputs the sole path
> +# (without -I).
> +boost-utils_get_includedir() {
> + local slot=$(boost-utils_get_best_slot)
> + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
> +
> + echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
> +}
There needs to be a way to specify maximal accepted slot of Boost. Examples of some possibilities:
* BOOST_MAX_SLOT="1.49" global variable
* '--max 1.49' arguments for boost-utils_get_* functions
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 4:26 ` Arfrever Frehtes Taifersar Arahesis
@ 2012-08-28 7:43 ` hasufell
2012-08-28 8:07 ` Michał Górny
2012-08-28 8:10 ` Tiziano Müller
2012-08-28 8:06 ` Michał Górny
1 sibling, 2 replies; 26+ messages in thread
From: hasufell @ 2012-08-28 7:43 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/28/2012 06:26 AM, Arfrever Frehtes Taifersar Arahesis wrote:
>
> There needs to be a way to specify maximal accepted slot of Boost.
> Examples of some possibilities: * BOOST_MAX_SLOT="1.49" global
> variable * '--max 1.49' arguments for boost-utils_get_* functions
>
Exactly. I don't see any reason for this eclass except this feature.
The current expected behavior of boost and build systems is that
always the latest installed will be picked.
In fact this breaks packages in 3 of 4 cases on new boost versions.
And while we are it it, we can punt the useless eselect implementation.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJQPHapAAoJEFpvPKfnPDWzAz8H/0/57b9AiYMxPM9APK5nSLCl
UGuaeh+Jnz8kTIzaVE0BNP2QSNkMZqVMa9hWnHgZHG+9Ne1zgCPU2PP8hijnwWb3
JWI02t/iWfsMqY8KNMNlCbyL21r5FurIXS66KHB90bygnaZZxgGZZJ6GUNEqKH5F
qPZUA++4NXnRbAU2dotaJH77v6fUXuzB/fhcrz9YmlDss+VGgxGSEGx2YJDU7WKu
4U4kawNRFxc5eJaj4ciOOeGMk4mnwq6459p9F/Kjzx3XniNCuKEA0G81Fn2GmOxe
fLurBlzj2gwsg8dy+TL9VwLDwESELLZ645u3Y0SEqp34Zo+OAFdytmYg6uxP8l0=
=o3qr
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-27 23:03 ` Andreas K. Huettel
@ 2012-08-28 8:02 ` Michał Górny
0 siblings, 0 replies; 26+ messages in thread
From: Michał Górny @ 2012-08-28 8:02 UTC (permalink / raw
To: gentoo-dev; +Cc: dilfridge
[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]
On Tue, 28 Aug 2012 01:03:53 +0200
"Andreas K. Huettel" <dilfridge@gentoo.org> wrote:
> Am Dienstag, 28. August 2012, 00:19:28 schrieb Michał Górny:
> > Right now, it just contains the function Tiziano listed in his
> > post[1]. I'd appreciate further ideas, feedback, and possibly an
> > example from someone who will actually need it.
>
> How about a function that just outputs the entire required dependency
> string? Such that we can (similar to add_kdebase_dep) write
>
> DEPEND="$(add_boost_dep)"
No, that won't work (soon). Boost is going to be split into smaller
parts, so I don't want to introduce any dependency generation API which
will have to change then.
> (Probably we may want to pass parameters here for useflags and
> version, here's the doc for kdebase_dep from kde4-functions.eclass
> (and for boost we would not need a package name):
Yes, and that makes it utterly pointless to have a function which just
converts some random magic string to random magic string + one word :P.
I'd rather give ${BOOST_PKG} to be used in *DEPEND if someone feels
that being really necessary. But as I said, it's going to be more
libraries soon.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 4:26 ` Arfrever Frehtes Taifersar Arahesis
2012-08-28 7:43 ` hasufell
@ 2012-08-28 8:06 ` Michał Górny
2012-08-28 8:10 ` Tiziano Müller
2012-08-28 14:35 ` Mike Gilbert
1 sibling, 2 replies; 26+ messages in thread
From: Michał Górny @ 2012-08-28 8:06 UTC (permalink / raw
To: gentoo-dev; +Cc: arfrever.fta
[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]
On Tue, 28 Aug 2012 06:26:02 +0200
Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:
> 2012-08-28 00:19:28 Michał Górny napisał(a):
> > --- /dev/null
> > +++ b/gx86/eclass/boost-utils.eclass
> > @@ -0,0 +1,43 @@
> > +# Copyright 1999-2012 Gentoo Foundation
> > +# Distributed under the terms of the GNU General Public License v2
> > +# $Header: $
> > +
> > +if [[ ! ${_BOOST_ECLASS} ]]; then
> > +
> > +# @ECLASS: boost-utils.eclass
> > +# @MAINTAINER:
> > +# mgorny@gentoo.org
>
> It is better to copy list of maintainers from
> gentoo-x86/dev-libs/boost/metadata.xml.
>
> > +# @BLURB: helper functions for packages using Boost C++ library
> > +# @DESCRIPTION:
> > +# Helper functions to be used when building packages using the
> > Boost C++ +# library collection.
> > +
> > +case ${EAPI:-0} in
> > + 0|1|2|3|4) ;;
> > + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet
> > established." +esac
>
> Please accept all EAPIs.
These are EAPIs which are allowed throughout the tree, sorry. Feel free
to ping Council about adding non-standard EAPIs to eclasses.
> > +inherit versionator
> > +
> > +# @FUNCTION: boost-utils_get_best_slot
> > +# @DESCRIPTION:
> > +# Get newest SLOT (major version) of Boost.
> > +boost-utils_get_best_slot() {
> > + local pkg=dev-libs/boost
> > + local atom=$(best_version ${pkg})
> > + get_version_component_range 1-2 ${atom#${pkg}}
> > +}
> > +
> > +# @FUNCTION: boost-utils_get_includedir
> > +# @DESCRIPTION:
> > +# Get correct includedir for best Boost version. Outputs the sole
> > path +# (without -I).
> > +boost-utils_get_includedir() {
> > + local slot=$(boost-utils_get_best_slot)
> > + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
> > +
> > + echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
> > +}
>
> There needs to be a way to specify maximal accepted slot of Boost.
> Examples of some possibilities:
> * BOOST_MAX_SLOT="1.49" global variable
> * '--max 1.49' arguments for boost-utils_get_* functions
I'd rather wait with that till Tiziano expresses his opinion. I think
the policy ought to be 'always prefer newest version' but I guess
that's hard with boost.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 7:43 ` hasufell
@ 2012-08-28 8:07 ` Michał Górny
2012-08-28 8:10 ` Tiziano Müller
1 sibling, 0 replies; 26+ messages in thread
From: Michał Górny @ 2012-08-28 8:07 UTC (permalink / raw
To: gentoo-dev; +Cc: hasufell
[-- Attachment #1: Type: text/plain, Size: 853 bytes --]
On Tue, 28 Aug 2012 09:43:37 +0200
hasufell <hasufell@gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 08/28/2012 06:26 AM, Arfrever Frehtes Taifersar Arahesis wrote:
> >
> > There needs to be a way to specify maximal accepted slot of Boost.
> > Examples of some possibilities: * BOOST_MAX_SLOT="1.49" global
> > variable * '--max 1.49' arguments for boost-utils_get_* functions
> >
>
> Exactly. I don't see any reason for this eclass except this feature.
> The current expected behavior of boost and build systems is that
> always the latest installed will be picked.
>
> In fact this breaks packages in 3 of 4 cases on new boost versions.
>
> And while we are it it, we can punt the useless eselect
It was queued for punting. That's reason for the eclass.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 8:06 ` Michał Górny
@ 2012-08-28 8:10 ` Tiziano Müller
2012-08-28 14:43 ` Michał Górny
2012-08-28 14:35 ` Mike Gilbert
1 sibling, 1 reply; 26+ messages in thread
From: Tiziano Müller @ 2012-08-28 8:10 UTC (permalink / raw
To: gentoo-dev
Am Dienstag, den 28.08.2012, 10:06 +0200 schrieb Michał Górny:
> On Tue, 28 Aug 2012 06:26:02 +0200
> Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:
>
> > 2012-08-28 00:19:28 Michał Górny napisał(a):
> > > --- /dev/null
> > > +++ b/gx86/eclass/boost-utils.eclass
> > > @@ -0,0 +1,43 @@
> > > +# Copyright 1999-2012 Gentoo Foundation
> > > +# Distributed under the terms of the GNU General Public License v2
> > > +# $Header: $
> > > +
> > > +if [[ ! ${_BOOST_ECLASS} ]]; then
> > > +
> > > +# @ECLASS: boost-utils.eclass
> > > +# @MAINTAINER:
> > > +# mgorny@gentoo.org
> >
> > It is better to copy list of maintainers from
> > gentoo-x86/dev-libs/boost/metadata.xml.
> >
> > > +# @BLURB: helper functions for packages using Boost C++ library
> > > +# @DESCRIPTION:
> > > +# Helper functions to be used when building packages using the
> > > Boost C++ +# library collection.
> > > +
> > > +case ${EAPI:-0} in
> > > + 0|1|2|3|4) ;;
> > > + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet
> > > established." +esac
> >
> > Please accept all EAPIs.
>
> These are EAPIs which are allowed throughout the tree, sorry. Feel free
> to ping Council about adding non-standard EAPIs to eclasses.
>
> > > +inherit versionator
> > > +
> > > +# @FUNCTION: boost-utils_get_best_slot
> > > +# @DESCRIPTION:
> > > +# Get newest SLOT (major version) of Boost.
> > > +boost-utils_get_best_slot() {
> > > + local pkg=dev-libs/boost
> > > + local atom=$(best_version ${pkg})
> > > + get_version_component_range 1-2 ${atom#${pkg}}
> > > +}
> > > +
> > > +# @FUNCTION: boost-utils_get_includedir
> > > +# @DESCRIPTION:
> > > +# Get correct includedir for best Boost version. Outputs the sole
> > > path +# (without -I).
> > > +boost-utils_get_includedir() {
> > > + local slot=$(boost-utils_get_best_slot)
> > > + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
> > > +
> > > + echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
> > > +}
> >
> > There needs to be a way to specify maximal accepted slot of Boost.
> > Examples of some possibilities:
> > * BOOST_MAX_SLOT="1.49" global variable
> > * '--max 1.49' arguments for boost-utils_get_* functions
>
> I'd rather wait with that till Tiziano expresses his opinion. I think
> the policy ought to be 'always prefer newest version' but I guess
> that's hard with boost.
>
one of the points of having a slotted boost (besides solving the rebuild
when API/ABI breakages occur) is that a package may also use an older
boost slot (currently it only would make sense if we'd backport the
glibc-2.16 patches but that's a different story). So I'd prefer if we'd
have a BOOST_MAX_SLOT variable.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 7:43 ` hasufell
2012-08-28 8:07 ` Michał Górny
@ 2012-08-28 8:10 ` Tiziano Müller
1 sibling, 0 replies; 26+ messages in thread
From: Tiziano Müller @ 2012-08-28 8:10 UTC (permalink / raw
To: gentoo-dev
Am Dienstag, den 28.08.2012, 09:43 +0200 schrieb hasufell:
> On 08/28/2012 06:26 AM, Arfrever Frehtes Taifersar Arahesis wrote:
> >
> > There needs to be a way to specify maximal accepted slot of Boost.
> > Examples of some possibilities: * BOOST_MAX_SLOT="1.49" global
> > variable * '--max 1.49' arguments for boost-utils_get_* functions
> >
>
> Exactly. I don't see any reason for this eclass except this feature.
> The current expected behavior of boost and build systems is that
> always the latest installed will be picked.
>
> In fact this breaks packages in 3 of 4 cases on new boost versions.
>
> And while we are it it, we can punt the useless eselect implementation.
boost-1.50 already removes symlinks created by eselect-boost and doesn't
depend on it anymore.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 8:06 ` Michał Górny
2012-08-28 8:10 ` Tiziano Müller
@ 2012-08-28 14:35 ` Mike Gilbert
2012-08-28 14:44 ` Ian Stakenvicius
1 sibling, 1 reply; 26+ messages in thread
From: Mike Gilbert @ 2012-08-28 14:35 UTC (permalink / raw
To: gentoo-dev
On Tue, Aug 28, 2012 at 4:06 AM, Michał Górny <mgorny@gentoo.org> wrote:
> On Tue, 28 Aug 2012 06:26:02 +0200
> Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:
>
>> 2012-08-28 00:19:28 Michał Górny napisał(a):
>> > --- /dev/null
>> > +++ b/gx86/eclass/boost-utils.eclass
>> > @@ -0,0 +1,43 @@
>> > +# Copyright 1999-2012 Gentoo Foundation
>> > +# Distributed under the terms of the GNU General Public License v2
>> > +# $Header: $
>> > +
>> > +if [[ ! ${_BOOST_ECLASS} ]]; then
>> > +
>> > +# @ECLASS: boost-utils.eclass
>> > +# @MAINTAINER:
>> > +# mgorny@gentoo.org
>>
>> It is better to copy list of maintainers from
>> gentoo-x86/dev-libs/boost/metadata.xml.
>>
>> > +# @BLURB: helper functions for packages using Boost C++ library
>> > +# @DESCRIPTION:
>> > +# Helper functions to be used when building packages using the
>> > Boost C++ +# library collection.
>> > +
>> > +case ${EAPI:-0} in
>> > + 0|1|2|3|4) ;;
>> > + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet
>> > established." +esac
>>
>> Please accept all EAPIs.
>
> These are EAPIs which are allowed throughout the tree, sorry. Feel free
> to ping Council about adding non-standard EAPIs to eclasses.
>
Is the eclass likely to be incompatible with future EAPIs? If not, I
think it is reasonable to remove this check.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 8:10 ` Tiziano Müller
@ 2012-08-28 14:43 ` Michał Górny
2012-08-28 14:45 ` Ian Stakenvicius
0 siblings, 1 reply; 26+ messages in thread
From: Michał Górny @ 2012-08-28 14:43 UTC (permalink / raw
To: gentoo-dev; +Cc: dev-zero
[-- Attachment #1: Type: text/plain, Size: 3226 bytes --]
On Tue, 28 Aug 2012 10:10:01 +0200
Tiziano Müller <dev-zero@gentoo.org> wrote:
> Am Dienstag, den 28.08.2012, 10:06 +0200 schrieb Michał Górny:
> > On Tue, 28 Aug 2012 06:26:02 +0200
> > Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:
> >
> > > 2012-08-28 00:19:28 Michał Górny napisał(a):
> > > > --- /dev/null
> > > > +++ b/gx86/eclass/boost-utils.eclass
> > > > @@ -0,0 +1,43 @@
> > > > +# Copyright 1999-2012 Gentoo Foundation
> > > > +# Distributed under the terms of the GNU General Public
> > > > License v2 +# $Header: $
> > > > +
> > > > +if [[ ! ${_BOOST_ECLASS} ]]; then
> > > > +
> > > > +# @ECLASS: boost-utils.eclass
> > > > +# @MAINTAINER:
> > > > +# mgorny@gentoo.org
> > >
> > > It is better to copy list of maintainers from
> > > gentoo-x86/dev-libs/boost/metadata.xml.
> > >
> > > > +# @BLURB: helper functions for packages using Boost C++ library
> > > > +# @DESCRIPTION:
> > > > +# Helper functions to be used when building packages using the
> > > > Boost C++ +# library collection.
> > > > +
> > > > +case ${EAPI:-0} in
> > > > + 0|1|2|3|4) ;;
> > > > + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet
> > > > established." +esac
> > >
> > > Please accept all EAPIs.
> >
> > These are EAPIs which are allowed throughout the tree, sorry. Feel
> > free to ping Council about adding non-standard EAPIs to eclasses.
> >
> > > > +inherit versionator
> > > > +
> > > > +# @FUNCTION: boost-utils_get_best_slot
> > > > +# @DESCRIPTION:
> > > > +# Get newest SLOT (major version) of Boost.
> > > > +boost-utils_get_best_slot() {
> > > > + local pkg=dev-libs/boost
> > > > + local atom=$(best_version ${pkg})
> > > > + get_version_component_range 1-2 ${atom#${pkg}}
> > > > +}
> > > > +
> > > > +# @FUNCTION: boost-utils_get_includedir
> > > > +# @DESCRIPTION:
> > > > +# Get correct includedir for best Boost version. Outputs the
> > > > sole path +# (without -I).
> > > > +boost-utils_get_includedir() {
> > > > + local slot=$(boost-utils_get_best_slot)
> > > > + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
> > > > +
> > > > + echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
> > > > +}
> > >
> > > There needs to be a way to specify maximal accepted slot of Boost.
> > > Examples of some possibilities:
> > > * BOOST_MAX_SLOT="1.49" global variable
> > > * '--max 1.49' arguments for boost-utils_get_* functions
> >
> > I'd rather wait with that till Tiziano expresses his opinion. I
> > think the policy ought to be 'always prefer newest version' but I
> > guess that's hard with boost.
> >
>
> one of the points of having a slotted boost (besides solving the
> rebuild when API/ABI breakages occur) is that a package may also use
> an older boost slot (currently it only would make sense if we'd
> backport the glibc-2.16 patches but that's a different story). So I'd
> prefer if we'd have a BOOST_MAX_SLOT variable.
Do we want to support using random old versions of boost then or just
the newest supported SLOT? If the latter, we could get away without
using best_version, and just request devs to depend on specific boost
slot then.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 14:35 ` Mike Gilbert
@ 2012-08-28 14:44 ` Ian Stakenvicius
0 siblings, 0 replies; 26+ messages in thread
From: Ian Stakenvicius @ 2012-08-28 14:44 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 28/08/12 10:35 AM, Mike Gilbert wrote:
> On Tue, Aug 28, 2012 at 4:06 AM, Michał Górny <mgorny@gentoo.org>
> wrote:
>> On Tue, 28 Aug 2012 06:26:02 +0200 Arfrever Frehtes Taifersar
>> Arahesis <arfrever.fta@gmail.com> wrote:
>>
>>> 2012-08-28 00:19:28 Michał Górny napisał(a):
>>>> +case ${EAPI:-0} in + 0|1|2|3|4) ;; + *) die
>>>> "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
>>>> +esac
>>>
>>> Please accept all EAPIs.
>>
>> These are EAPIs which are allowed throughout the tree, sorry.
>> Feel free to ping Council about adding non-standard EAPIs to
>> eclasses.
>>
>
> Is the eclass likely to be incompatible with future EAPIs? If not,
> I think it is reasonable to remove this check.
>
It's quite standard to have the above check in place; and since there
is no guarantee that new EAPIs *won't* break something, I think it
would be a good idea to leave this as-is.
Yes this will add a touch more work when it comes to bumping eclasses
to accept EAPI=5 or newer, but forcing a dev to check the eclass's
compatibility when a new EAPI rolls out is a good thing imo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iF4EAREIAAYFAlA82ToACgkQ2ugaI38ACPA4LQEAhoW6FtSwDqTdsV84XOjsibOp
TdM1B3sE8Gpp8WnfFhgA/3MvQy9oq+y/0U1cqMByiSAH4wN/12f0yuvGiWYD5pXf
=GQ4U
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 14:43 ` Michał Górny
@ 2012-08-28 14:45 ` Ian Stakenvicius
2012-08-28 14:54 ` Michał Górny
0 siblings, 1 reply; 26+ messages in thread
From: Ian Stakenvicius @ 2012-08-28 14:45 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 28/08/12 10:43 AM, Michał Górny wrote:
> On Tue, 28 Aug 2012 10:10:01 +0200 Tiziano Müller
> <dev-zero@gentoo.org> wrote:
>
>> Am Dienstag, den 28.08.2012, 10:06 +0200 schrieb Michał Górny:
>>> On Tue, 28 Aug 2012 06:26:02 +0200 Arfrever Frehtes Taifersar
>>> Arahesis <arfrever.fta@gmail.com> wrote:
>>>
>>>> 2012-08-28 00:19:28 Michał Górny napisał(a):
>>>>> --- /dev/null +++ b/gx86/eclass/boost-utils.eclass @@ -0,0
>>>>> +1,43 @@ +# Copyright 1999-2012 Gentoo Foundation +#
>>>>> Distributed under the terms of the GNU General Public
>>>>> License v2 +# $Header: $ + +if [[ ! ${_BOOST_ECLASS} ]];
>>>>> then + +# @ECLASS: boost-utils.eclass +# @MAINTAINER: +#
>>>>> mgorny@gentoo.org
>>>>
>>>> It is better to copy list of maintainers from
>>>> gentoo-x86/dev-libs/boost/metadata.xml.
>>>>
>>>>> +# @BLURB: helper functions for packages using Boost C++
>>>>> library +# @DESCRIPTION: +# Helper functions to be used
>>>>> when building packages using the Boost C++ +# library
>>>>> collection. + +case ${EAPI:-0} in + 0|1|2|3|4) ;; + *) die
>>>>> "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
>>>>> +esac
>>>>
>>>> Please accept all EAPIs.
>>>
>>> These are EAPIs which are allowed throughout the tree, sorry.
>>> Feel free to ping Council about adding non-standard EAPIs to
>>> eclasses.
>>>
>>>>> +inherit versionator + +# @FUNCTION:
>>>>> boost-utils_get_best_slot +# @DESCRIPTION: +# Get newest
>>>>> SLOT (major version) of Boost. +boost-utils_get_best_slot()
>>>>> { + local pkg=dev-libs/boost + local atom=$(best_version
>>>>> ${pkg}) + get_version_component_range 1-2 ${atom#${pkg}}
>>>>> +} + +# @FUNCTION: boost-utils_get_includedir +#
>>>>> @DESCRIPTION: +# Get correct includedir for best Boost
>>>>> version. Outputs the sole path +# (without -I).
>>>>> +boost-utils_get_includedir() { + local
>>>>> slot=$(boost-utils_get_best_slot) + has "${EAPI:-0}" 0 1 2
>>>>> && ! use prefix && EPREFIX= + + echo -n
>>>>> "${EPREFIX}/usr/include/boost-${slot/./_}" +}
>>>>
>>>> There needs to be a way to specify maximal accepted slot of
>>>> Boost. Examples of some possibilities: *
>>>> BOOST_MAX_SLOT="1.49" global variable * '--max 1.49'
>>>> arguments for boost-utils_get_* functions
>>>
>>> I'd rather wait with that till Tiziano expresses his opinion.
>>> I think the policy ought to be 'always prefer newest version'
>>> but I guess that's hard with boost.
>>>
>>
>> one of the points of having a slotted boost (besides solving the
>> rebuild when API/ABI breakages occur) is that a package may also
>> use an older boost slot (currently it only would make sense if
>> we'd backport the glibc-2.16 patches but that's a different
>> story). So I'd prefer if we'd have a BOOST_MAX_SLOT variable.
>
> Do we want to support using random old versions of boost then or
> just the newest supported SLOT? If the latter, we could get away
> without using best_version, and just request devs to depend on
> specific boost slot then.
>
IIRC from comments on IRC, the idea with boost is that "newest
available" is what is recommended to be used, but obviously "newest
supported by ebuild" would take precedence, if a package can't be
built against a newer boost.
Otherwise why would we bother to slot in the first place?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iF4EAREIAAYFAlA82acACgkQ2ugaI38ACPAc0gD+Ohokg0d6MAikZfLsyenyBnb6
PMIRVUI3VtHXcOz1cG4BALV9qTK1qSSUnNenRjjJxktdZ0f1Jatb69R+x9JXVM2m
=cIfW
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 14:45 ` Ian Stakenvicius
@ 2012-08-28 14:54 ` Michał Górny
2012-08-29 9:02 ` hasufell
0 siblings, 1 reply; 26+ messages in thread
From: Michał Górny @ 2012-08-28 14:54 UTC (permalink / raw
To: gentoo-dev; +Cc: axs
[-- Attachment #1: Type: text/plain, Size: 3753 bytes --]
On Tue, 28 Aug 2012 10:45:59 -0400
Ian Stakenvicius <axs@gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 28/08/12 10:43 AM, Michał Górny wrote:
> > On Tue, 28 Aug 2012 10:10:01 +0200 Tiziano Müller
> > <dev-zero@gentoo.org> wrote:
> >
> >> Am Dienstag, den 28.08.2012, 10:06 +0200 schrieb Michał Górny:
> >>> On Tue, 28 Aug 2012 06:26:02 +0200 Arfrever Frehtes Taifersar
> >>> Arahesis <arfrever.fta@gmail.com> wrote:
> >>>
> >>>> 2012-08-28 00:19:28 Michał Górny napisał(a):
> >>>>> --- /dev/null +++ b/gx86/eclass/boost-utils.eclass @@ -0,0
> >>>>> +1,43 @@ +# Copyright 1999-2012 Gentoo Foundation +#
> >>>>> Distributed under the terms of the GNU General Public
> >>>>> License v2 +# $Header: $ + +if [[ ! ${_BOOST_ECLASS} ]];
> >>>>> then + +# @ECLASS: boost-utils.eclass +# @MAINTAINER: +#
> >>>>> mgorny@gentoo.org
> >>>>
> >>>> It is better to copy list of maintainers from
> >>>> gentoo-x86/dev-libs/boost/metadata.xml.
> >>>>
> >>>>> +# @BLURB: helper functions for packages using Boost C++
> >>>>> library +# @DESCRIPTION: +# Helper functions to be used
> >>>>> when building packages using the Boost C++ +# library
> >>>>> collection. + +case ${EAPI:-0} in + 0|1|2|3|4) ;;
> >>>>> + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet
> >>>>> established." +esac
> >>>>
> >>>> Please accept all EAPIs.
> >>>
> >>> These are EAPIs which are allowed throughout the tree, sorry.
> >>> Feel free to ping Council about adding non-standard EAPIs to
> >>> eclasses.
> >>>
> >>>>> +inherit versionator + +# @FUNCTION:
> >>>>> boost-utils_get_best_slot +# @DESCRIPTION: +# Get newest
> >>>>> SLOT (major version) of Boost. +boost-utils_get_best_slot()
> >>>>> { + local pkg=dev-libs/boost + local
> >>>>> atom=$(best_version ${pkg}) +
> >>>>> get_version_component_range 1-2 ${atom#${pkg}} +} + +#
> >>>>> @FUNCTION: boost-utils_get_includedir +# @DESCRIPTION: +# Get
> >>>>> correct includedir for best Boost version. Outputs the sole
> >>>>> path +# (without -I). +boost-utils_get_includedir() { +
> >>>>> local slot=$(boost-utils_get_best_slot) + has
> >>>>> "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= + + echo
> >>>>> -n "${EPREFIX}/usr/include/boost-${slot/./_}" +}
> >>>>
> >>>> There needs to be a way to specify maximal accepted slot of
> >>>> Boost. Examples of some possibilities: *
> >>>> BOOST_MAX_SLOT="1.49" global variable * '--max 1.49'
> >>>> arguments for boost-utils_get_* functions
> >>>
> >>> I'd rather wait with that till Tiziano expresses his opinion.
> >>> I think the policy ought to be 'always prefer newest version'
> >>> but I guess that's hard with boost.
> >>>
> >>
> >> one of the points of having a slotted boost (besides solving the
> >> rebuild when API/ABI breakages occur) is that a package may also
> >> use an older boost slot (currently it only would make sense if
> >> we'd backport the glibc-2.16 patches but that's a different
> >> story). So I'd prefer if we'd have a BOOST_MAX_SLOT variable.
> >
> > Do we want to support using random old versions of boost then or
> > just the newest supported SLOT? If the latter, we could get away
> > without using best_version, and just request devs to depend on
> > specific boost slot then.
> >
>
> IIRC from comments on IRC, the idea with boost is that "newest
> available" is what is recommended to be used, but obviously "newest
> supported by ebuild" would take precedence, if a package can't be
> built against a newer boost.
>
> Otherwise why would we bother to slot in the first place?
I meant 'require only newest slot supported by package' vs 'any older
slot would work'.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-28 14:54 ` Michał Górny
@ 2012-08-29 9:02 ` hasufell
0 siblings, 0 replies; 26+ messages in thread
From: hasufell @ 2012-08-29 9:02 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/28/2012 04:54 PM, Michał Górny wrote:
>
> I meant 'require only newest slot supported by package' vs 'any
> older slot would work'.
>
hmm, imo that depends on the question if we can safely assume that the
application compiles with boost 1.35.0 up to 1.48.0 when we set
BOOST_MAX_SLOT=1.48
otherwise we would end up supporting a range of slots which seems
unneccessary, no?
Maybe we should rather do something like
WANT_BOOST=${WANT_BOOST:-1.48}
which will force the dependencies and the rest, but the user will
still be able to handle this per-package through /etc/portage/env if
he sees fit.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJQPdq3AAoJEFpvPKfnPDWzh4YIAJzjACoHfQCQ1a8fUIxcMNw4
Y2rknN/BR9ZdGWLL3+JqnAXGHJLgufOXPJuDtobUQdVWmZeyYgXdbO89FKFRjQPR
/bHio0DWppeJLAMHpyYtHJy5TSmsQU8V7075riCBGmq5cQLblLey+vdDKavONSm5
WUjvkTxiaaiOs5VIOOzY5951UU4WH9CHpICr73sqY9A3ll/A32+uH2HjrsLV1LiV
lPjdXVnM/KQ2QSQ5E9BID17JBiI2Pvbd6u4BdzCNIcB/3by4D0gwgph9hihKrbky
FR/uF80jiF2ySE/AedZT2wvp32Vhs5Nsqhbsp0KuaN7WAge7qbxv7VccqzetpN0=
=kjd7
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-27 22:19 [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost Michał Górny
` (2 preceding siblings ...)
2012-08-28 4:26 ` Arfrever Frehtes Taifersar Arahesis
@ 2012-08-31 9:27 ` Michał Górny
2012-09-02 19:30 ` Michał Górny
2012-09-04 20:50 ` Michał Górny
3 siblings, 2 replies; 26+ messages in thread
From: Michał Górny @ 2012-08-31 9:27 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Right now, it just contains the function Tiziano listed in his post[1].
I'd appreciate further ideas, feedback, and possibly an example from
someone who will actually need it.
---
gx86/eclass/boost-utils.eclass | 47 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 gx86/eclass/boost-utils.eclass
diff --git a/gx86/eclass/boost-utils.eclass b/gx86/eclass/boost-utils.eclass
new file mode 100644
index 0000000..b57a400
--- /dev/null
+++ b/gx86/eclass/boost-utils.eclass
@@ -0,0 +1,47 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+if [[ ! ${_BOOST_ECLASS} ]]; then
+
+# @ECLASS: boost-utils.eclass
+# @MAINTAINER:
+# Michał Górny <mgorny@gentoo.org>
+# Tiziano Müller <dev-zero@gentoo.org>
+# Sebastian Luther <SebastianLuther@gmx.de>
+# Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
+# @BLURB: helper functions for packages using Boost C++ library
+# @DESCRIPTION:
+# Helper functions to be used when building packages using the Boost C++
+# library collection.
+
+case ${EAPI:-0} in
+ 0|1|2|3|4) ;;
+ *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
+esac
+
+inherit versionator
+
+# @FUNCTION: boost-utils_get_best_slot
+# @DESCRIPTION:
+# Get newest SLOT (major version) of Boost.
+boost-utils_get_best_slot() {
+ local pkg=dev-libs/boost
+ local atom=$(best_version ${pkg})
+ get_version_component_range 1-2 ${atom#${pkg}}
+}
+
+# @FUNCTION: boost-utils_get_includedir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the includedir for given Boost slot, or the best slot installed
+# (if no slot given). Outputs the sole path (without -I).
+boost-utils_get_includedir() {
+ local slot=${1:-$(boost-utils_get_best_slot)}
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
+}
+
+_BOOST_ECLASS=1
+fi # _BOOST_ECLASS
--
1.7.12
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-31 9:27 ` Michał Górny
@ 2012-09-02 19:30 ` Michał Górny
2012-09-04 20:50 ` Michał Górny
1 sibling, 0 replies; 26+ messages in thread
From: Michał Górny @ 2012-09-02 19:30 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
It just covers the basic idea of getting includedir/libdir. As many
different packages require different hackeries, there is probably no
good way of handling that.
I'd appreciate further ideas, feedback, and possibly an example from
someone who will use it.
---
gx86/eclass/boost-utils.eclass | 76 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
create mode 100644 gx86/eclass/boost-utils.eclass
diff --git a/gx86/eclass/boost-utils.eclass b/gx86/eclass/boost-utils.eclass
new file mode 100644
index 0000000..c878b16
--- /dev/null
+++ b/gx86/eclass/boost-utils.eclass
@@ -0,0 +1,76 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+if [[ ! ${_BOOST_ECLASS} ]]; then
+
+# @ECLASS: boost-utils.eclass
+# @MAINTAINER:
+# Michał Górny <mgorny@gentoo.org>
+# Tiziano Müller <dev-zero@gentoo.org>
+# Sebastian Luther <SebastianLuther@gmx.de>
+# Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
+# @BLURB: helper functions for packages using Boost C++ library
+# @DESCRIPTION:
+# Helper functions to be used when building packages using the Boost C++
+# library collection.
+
+case ${EAPI:-0} in
+ 0|1|2|3|4) ;;
+ *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
+esac
+
+inherit multilib versionator
+
+# @ECLASS-VARIABLE: BOOST_MAX_VERSION
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The maximal (newest) boost version supported by the package. If unset,
+# the newest installed version will be used.
+#
+# Please note that if BOOST_MAX_VERSION is set, the package should
+# depend on boost packages with *exactly* that slot (i.e. boost:1.47);
+# otherwise, the package should depend on boost without a slot
+# specified (i.e. >=boost-1.45).
+
+# @FUNCTION: boost-utils_get_best_slot
+# @DESCRIPTION:
+# Get newest installed slot of Boost.
+boost-utils_get_best_slot() {
+ local pkg=dev-libs/boost
+ local atom=$(best_version ${pkg})
+ get_version_component_range 1-2 ${atom#${pkg}}
+}
+
+# @FUNCTION: boost-utils_get_includedir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the includedir for given Boost slot. If no slot is given, defaults
+# to ${BOOST_MAX_VERSION}. If that variable is unset, newest installed
+# slot will be used.
+#
+# Output the sole path (without -I).
+boost-utils_get_includedir() {
+ local slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
+}
+
+# @FUNCTION: boost-utils_get_libdir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the libdir for given Boost slot. If no slot is given, defaults
+# to ${BOOST_MAX_VERSION}. If that variable is unset, newest installed
+# slot will be used.
+#
+# Output the sole path (without -L).
+boost-utils_get_libdir() {
+ local slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/$(get_libdir)/boost-${slot/./_}"
+}
+
+_BOOST_ECLASS=1
+fi # _BOOST_ECLASS
--
1.7.12
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-08-31 9:27 ` Michał Górny
2012-09-02 19:30 ` Michał Górny
@ 2012-09-04 20:50 ` Michał Górny
2012-09-09 5:26 ` Arfrever Frehtes Taifersar Arahesis
1 sibling, 1 reply; 26+ messages in thread
From: Michał Górny @ 2012-09-04 20:50 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Now with a handy function for cmake & autotools! And a more complete
description.
---
gx86/eclass/boost-utils.eclass | 99 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 99 insertions(+)
create mode 100644 gx86/eclass/boost-utils.eclass
diff --git a/gx86/eclass/boost-utils.eclass b/gx86/eclass/boost-utils.eclass
new file mode 100644
index 0000000..c720fe7
--- /dev/null
+++ b/gx86/eclass/boost-utils.eclass
@@ -0,0 +1,99 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+if [[ ! ${_BOOST_ECLASS} ]]; then
+
+# @ECLASS: boost-utils.eclass
+# @MAINTAINER:
+# Michał Górny <mgorny@gentoo.org>
+# Tiziano Müller <dev-zero@gentoo.org>
+# Sebastian Luther <SebastianLuther@gmx.de>
+# Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
+# @BLURB: helper functions for packages using Boost C++ library
+# @DESCRIPTION:
+# Helper functions to be used when building packages using the Boost C++
+# library collection.
+#
+# For cmake & autotools it is usually necessary to set BOOST_ROOT using
+# boost-utils_export_root. However, other build system may require more
+# hackery or even appending -I$(boost-utils_get_includedir) to CFLAGS
+# and -L$(boost-utils_get_libdir) to LDFLAGS.
+#
+# If the package supports the newest version of boost, it should depend
+# on >=dev-libs/boost-x.y.z (min version) or just dev-libs/boost. If it
+# doesn't, you should set BOOST_MAX_VERSION (or just pass the correct
+# slot to the used function) and depend on dev-libs/boost:x.y.
+
+case ${EAPI:-0} in
+ 0|1|2|3|4) ;;
+ *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
+esac
+
+inherit multilib versionator
+
+# @ECLASS-VARIABLE: BOOST_MAX_VERSION
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The maximal (newest) boost version supported by the package. If unset,
+# the newest installed version will be used.
+#
+# Please note that if BOOST_MAX_VERSION is set, the package should
+# depend on boost packages with *exactly* that slot (i.e. boost:1.47);
+# otherwise, the package should depend on boost without a slot
+# specified (i.e. >=boost-1.45).
+
+# @FUNCTION: boost-utils_get_best_slot
+# @DESCRIPTION:
+# Get newest installed slot of Boost.
+boost-utils_get_best_slot() {
+ local pkg=dev-libs/boost
+ local atom=$(best_version ${pkg})
+ get_version_component_range 1-2 ${atom#${pkg}}
+}
+
+# @FUNCTION: boost-utils_get_includedir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the includedir for the given Boost slot. If no slot is given,
+# defaults to ${BOOST_MAX_VERSION}. If that variable is unset,
+# the newest installed slot will be used.
+#
+# Outputs the sole path (without -I).
+boost-utils_get_includedir() {
+ local slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
+}
+
+# @FUNCTION: boost-utils_get_libdir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the libdir for the given Boost slot. If no slot is given, defaults
+# to ${BOOST_MAX_VERSION}. If that variable is unset, the newest
+# installed slot will be used.
+#
+# Outputs the sole path (without -L).
+boost-utils_get_libdir() {
+ local slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/$(get_libdir)/boost-${slot/./_}"
+}
+
+# @FUNCTION: boost-utils_export_root
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Set the BOOST_ROOT variable to includedir for the given Boost slot.
+# If no slot is given, defaults to ${BOOST_MAX_VERSION}. If that
+# variable is unset, the newest installed slot will be used.
+#
+# This variable satisfies both cmake and sys-devel/boost-m4 autoconf
+# macros.
+boost-utils_export_root() {
+ export BOOST_ROOT=$(boost-utils_get_includedir "${@}")
+}
+
+_BOOST_ECLASS=1
+fi # _BOOST_ECLASS
--
1.7.12
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-09-04 20:50 ` Michał Górny
@ 2012-09-09 5:26 ` Arfrever Frehtes Taifersar Arahesis
2012-09-09 8:06 ` Michał Górny
0 siblings, 1 reply; 26+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-09-09 5:26 UTC (permalink / raw
To: Gentoo Development
[-- Attachment #1: Type: Text/Plain, Size: 526 bytes --]
2012-09-04 22:50:16 Michał Górny napisał(a):
> + local slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}
When BOOST_MAX_VERSION is non-empty, then it should be used in the following way:
[[ "${BOOST_MAX_VERSION}" =~ ^[[:digit:]]+\.[[:digit:]]+$ ]] || die "Invalid BOOST_MAX_VERSION"
atom="$(best_version "<dev-libs/boost-${BOOST_MAX_VERSION%.*}.$((${BOOST_MAX_VERSION#*.}+1))_alpha")"
slot="$(get_version_component_range 1-2 ${atom#dev-libs/boost-})"
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-09-09 5:26 ` Arfrever Frehtes Taifersar Arahesis
@ 2012-09-09 8:06 ` Michał Górny
2012-09-09 17:47 ` Arfrever Frehtes Taifersar Arahesis
0 siblings, 1 reply; 26+ messages in thread
From: Michał Górny @ 2012-09-09 8:06 UTC (permalink / raw
To: gentoo-dev; +Cc: arfrever.fta
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
On Sun, 9 Sep 2012 07:26:23 +0200
Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:
> 2012-09-04 22:50:16 Michał Górny napisał(a):
> > + local
> > slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}
>
> When BOOST_MAX_VERSION is non-empty, then it should be used in the
> following way:
>
> [[ "${BOOST_MAX_VERSION}" =~ ^[[:digit:]]+\.[[:digit:]]+$ ]] || die
> "Invalid BOOST_MAX_VERSION" atom="$(best_version
> "<dev-libs/boost-${BOOST_MAX_VERSION%.*}.$((${BOOST_MAX_VERSION#*.}+1))_alpha")"
> slot="$(get_version_component_range 1-2 ${atom#dev-libs/boost-})"
No, we don't support older versions. The eclassdoc says it all.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-09-09 8:06 ` Michał Górny
@ 2012-09-09 17:47 ` Arfrever Frehtes Taifersar Arahesis
2012-09-09 18:10 ` Michał Górny
2012-09-09 21:41 ` Michał Górny
0 siblings, 2 replies; 26+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-09-09 17:47 UTC (permalink / raw
To: Gentoo Development
[-- Attachment #1: Type: Text/Plain, Size: 564 bytes --]
2012-09-09 10:06:43 Michał Górny napisał(a):
> No, we don't support older versions.
Older versions must be supported to easily handle the situation when Boost 1.49 is stable and
Boost 1.50 and 1.51 are unstable and not package.masked and package X has only stable ebuilds
and all of them currently fail to build/work with Boost >=1.51, so BOOST_MAX_VERSION="1.50" would
have to be used in all ebuilds of package X.
(Boost 1.49 would be used for stable users and Boost 1.50 would be used for unstable users.)
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-09-09 17:47 ` Arfrever Frehtes Taifersar Arahesis
@ 2012-09-09 18:10 ` Michał Górny
2012-09-09 21:41 ` Michał Górny
1 sibling, 0 replies; 26+ messages in thread
From: Michał Górny @ 2012-09-09 18:10 UTC (permalink / raw
To: gentoo-dev; +Cc: arfrever.fta
[-- Attachment #1: Type: text/plain, Size: 837 bytes --]
On Sun, 9 Sep 2012 19:47:07 +0200
Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:
> 2012-09-09 10:06:43 Michał Górny napisał(a):
> > No, we don't support older versions.
>
> Older versions must be supported to easily handle the situation when Boost 1.49 is stable and
> Boost 1.50 and 1.51 are unstable and not package.masked and package X has only stable ebuilds
> and all of them currently fail to build/work with Boost >=1.51, so BOOST_MAX_VERSION="1.50" would
> have to be used in all ebuilds of package X.
> (Boost 1.49 would be used for stable users and Boost 1.50 would be used for unstable users.)
You are probably right. Even though I believe that we should treat
'older slot' support only as an interim solution before people fix
their packages...
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-09-09 17:47 ` Arfrever Frehtes Taifersar Arahesis
2012-09-09 18:10 ` Michał Górny
@ 2012-09-09 21:41 ` Michał Górny
2012-09-19 9:38 ` Michał Górny
1 sibling, 1 reply; 26+ messages in thread
From: Michał Górny @ 2012-09-09 21:41 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Fixed to support any slot older than specified correctly.
---
gx86/eclass/boost-utils.eclass | 95 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 95 insertions(+)
create mode 100644 gx86/eclass/boost-utils.eclass
diff --git a/gx86/eclass/boost-utils.eclass b/gx86/eclass/boost-utils.eclass
new file mode 100644
index 0000000..0d6eec3
--- /dev/null
+++ b/gx86/eclass/boost-utils.eclass
@@ -0,0 +1,95 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+if [[ ! ${_BOOST_ECLASS} ]]; then
+
+# @ECLASS: boost-utils.eclass
+# @MAINTAINER:
+# Michał Górny <mgorny@gentoo.org>
+# Tiziano Müller <dev-zero@gentoo.org>
+# Sebastian Luther <SebastianLuther@gmx.de>
+# Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
+# @BLURB: helper functions for packages using Boost C++ library
+# @DESCRIPTION:
+# Helper functions to be used when building packages using the Boost C++
+# library collection.
+#
+# Please note that this eclass does not set the dependencies for you.
+# You need to do that yourself.
+#
+# For cmake & autotools it is usually necessary to set BOOST_ROOT using
+# boost-utils_export_root. However, other build system may require more
+# hackery or even appending -I$(boost-utils_get_includedir) to CFLAGS
+# and -L$(boost-utils_get_libdir) to LDFLAGS.
+
+case ${EAPI:-0} in
+ 0|1|2|3|4) ;;
+ *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
+esac
+
+inherit multilib versionator
+
+# @ECLASS-VARIABLE: BOOST_MAX_SLOT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The maximal (newest) boost slot supported by the package. If unset,
+# there is no limit (the newest installed version will be used).
+
+# @FUNCTION: boost-utils_get_best_slot
+# @DESCRIPTION:
+# Get newest installed slot of Boost. If BOOST_MAX_SLOT is set, the version
+# returned will be at most in the specified slot.
+boost-utils_get_best_slot() {
+ local pkg=dev-libs/boost
+ [[ ${BOOST_MAX_SLOT} ]] && pkg="<=${pkg}-${BOOST_MAX_SLOT}.9999"
+
+ local cpv=$(best_version ${pkg})
+ get_version_component_range 1-2 ${cpv#${pkg}-}
+}
+
+# @FUNCTION: boost-utils_get_includedir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the includedir for the given Boost slot. If no slot is given,
+# defaults to the newest installed Boost slot (but not newer than
+# BOOST_MAX_SLOT if that variable is set).
+#
+# Outputs the sole path (without -I).
+boost-utils_get_includedir() {
+ local slot=${1:-$(boost-utils_get_best_slot)}
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
+}
+
+# @FUNCTION: boost-utils_get_libdir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the libdir for the given Boost slot. If no slot is given, defaults
+# to the newest installed Boost slot (but not newer than BOOST_MAX_SLOT
+# if that variable is set).
+#
+# Outputs the sole path (without -L).
+boost-utils_get_libdir() {
+ local slot=${1:-$(boost-utils_get_best_slot)}
+ has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+
+ echo -n "${EPREFIX}/usr/$(get_libdir)/boost-${slot/./_}"
+}
+
+# @FUNCTION: boost-utils_export_root
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Set the BOOST_ROOT variable to includedir for the given Boost slot.
+# If no slot is given, defaults to the newest installed Boost slot(but
+# not newer than BOOST_MAX_SLOT if that variable is set).
+#
+# This variable satisfies both cmake and sys-devel/boost-m4 autoconf
+# macros.
+boost-utils_export_root() {
+ export BOOST_ROOT=$(boost-utils_get_includedir "${@}")
+}
+
+_BOOST_ECLASS=1
+fi # _BOOST_ECLASS
--
1.7.12
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
2012-09-09 21:41 ` Michał Górny
@ 2012-09-19 9:38 ` Michał Górny
0 siblings, 0 replies; 26+ messages in thread
From: Michał Górny @ 2012-09-19 9:38 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 194 bytes --]
On Sun, 9 Sep 2012 23:41:28 +0200
Michał Górny <mgorny@gentoo.org> wrote:
> Fixed to support any slot older than specified correctly.
Committed.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2012-09-19 9:40 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 22:19 [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost Michał Górny
2012-08-27 22:23 ` Ciaran McCreesh
2012-08-27 22:31 ` Michał Górny
2012-08-27 23:03 ` Andreas K. Huettel
2012-08-28 8:02 ` Michał Górny
2012-08-28 4:26 ` Arfrever Frehtes Taifersar Arahesis
2012-08-28 7:43 ` hasufell
2012-08-28 8:07 ` Michał Górny
2012-08-28 8:10 ` Tiziano Müller
2012-08-28 8:06 ` Michał Górny
2012-08-28 8:10 ` Tiziano Müller
2012-08-28 14:43 ` Michał Górny
2012-08-28 14:45 ` Ian Stakenvicius
2012-08-28 14:54 ` Michał Górny
2012-08-29 9:02 ` hasufell
2012-08-28 14:35 ` Mike Gilbert
2012-08-28 14:44 ` Ian Stakenvicius
2012-08-31 9:27 ` Michał Górny
2012-09-02 19:30 ` Michał Górny
2012-09-04 20:50 ` Michał Górny
2012-09-09 5:26 ` Arfrever Frehtes Taifersar Arahesis
2012-09-09 8:06 ` Michał Górny
2012-09-09 17:47 ` Arfrever Frehtes Taifersar Arahesis
2012-09-09 18:10 ` Michał Górny
2012-09-09 21:41 ` Michał Górny
2012-09-19 9:38 ` Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox