Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   boost-utils.eclass -- for building against newest boost. (http://www.linux-archive.org/gentoo-development/698242-boost-utils-eclass-building-against-newest-boost.html)

Michał Górny 08-27-2012 10:19 PM

boost-utils.eclass -- for building against newest boost.
 
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

Ciaran McCreesh 08-27-2012 10:23 PM

boost-utils.eclass -- for building against newest boost.
 
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

Michał Górny 08-27-2012 10:31 PM

boost-utils.eclass -- for building against newest boost.
 
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

"Andreas K. Huettel" 08-27-2012 11:03 PM

boost-utils.eclass -- for building against newest boost.
 
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/

Arfrever Frehtes Taifersar Arahesis 08-28-2012 04:26 AM

boost-utils.eclass -- for building against newest boost.
 
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

hasufell 08-28-2012 07:43 AM

boost-utils.eclass -- for building against newest boost.
 
-----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+9Ne1zgC PU2PP8hijnwWb3
JWI02t/iWfsMqY8KNMNlCbyL21r5FurIXS66KHB90bygnaZZxgGZZJ6GU NEqKH5F
qPZUA++4NXnRbAU2dotaJH77v6fUXuzB/fhcrz9YmlDss+VGgxGSEGx2YJDU7WKu
4U4kawNRFxc5eJaj4ciOOeGMk4mnwq6459p9F/Kjzx3XniNCuKEA0G81Fn2GmOxe
fLurBlzj2gwsg8dy+TL9VwLDwESELLZ645u3Y0SEqp34Zo+OAF dytmYg6uxP8l0=
=o3qr
-----END PGP SIGNATURE-----

Michał Górny 08-28-2012 08:02 AM

boost-utils.eclass -- for building against newest boost.
 
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

Michał Górny 08-28-2012 08:06 AM

boost-utils.eclass -- for building against newest boost.
 
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

Michał Górny 08-28-2012 08:07 AM

boost-utils.eclass -- for building against newest boost.
 
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

Tiziano Müller 08-28-2012 08:10 AM

boost-utils.eclass -- for building against newest boost.
 
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.


All times are GMT. The time now is 01:06 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.