FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 08-28-2012, 08:10 AM
Tiziano M黮ler
 
Default boost-utils.eclass -- for building against newest boost.

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.
 
Old 08-28-2012, 02:35 PM
Mike Gilbert
 
Default boost-utils.eclass -- for building against newest boost.

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.
 
Old 08-28-2012, 02:43 PM
Micha艂 G贸rny
 
Default boost-utils.eclass -- for building against newest boost.

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
 
Old 08-28-2012, 02:44 PM
Ian Stakenvicius
 
Default boost-utils.eclass -- for building against newest boost.

-----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)

iF4EAREIAAYFAlA82ToACgkQ2ugaI38ACPA4LQEAhoW6FtSwDq TdsV84XOjsibOp
TdM1B3sE8Gpp8WnfFhgA/3MvQy9oq+y/0U1cqMByiSAH4wN/12f0yuvGiWYD5pXf
=GQ4U
-----END PGP SIGNATURE-----
 
Old 08-28-2012, 02:45 PM
Ian Stakenvicius
 
Default boost-utils.eclass -- for building against newest boost.

-----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+Ohokg0d6MA ikZfLsyenyBnb6
PMIRVUI3VtHXcOz1cG4BALV9qTK1qSSUnNenRjjJxktdZ0f1Ja tb69R+x9JXVM2m
=cIfW
-----END PGP SIGNATURE-----
 
Old 08-28-2012, 02:54 PM
Micha艂 G贸rny
 
Default boost-utils.eclass -- for building against newest boost.

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
 
Old 08-29-2012, 09:02 AM
hasufell
 
Default boost-utils.eclass -- for building against newest boost.

-----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/

iQEcBAEBAgAGBQJQPdq3AAoJEFpvPKfnPDWzh4YIAJzjACoHfQ CQ1a8fUIxcMNw4
Y2rknN/BR9ZdGWLL3+JqnAXGHJLgufOXPJuDtobUQdVWmZeyYgXdbO89F KFRjQPR
/bHio0DWppeJLAMHpyYtHJy5TSmsQU8V7075riCBGmq5cQLblLe y+vdDKavONSm5
WUjvkTxiaaiOs5VIOOzY5951UU4WH9CHpICr73sqY9A3ll/A32+uH2HjrsLV1LiV
lPjdXVnM/KQ2QSQ5E9BID17JBiI2Pvbd6u4BdzCNIcB/3by4D0gwgph9hihKrbky
FR/uF80jiF2ySE/AedZT2wvp32Vhs5Nsqhbsp0KuaN7WAge7qbxv7VccqzetpN0=
=kjd7
-----END PGP SIGNATURE-----
 
Old 08-31-2012, 09:27 AM
Micha艂 G贸rny
 
Default 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 | 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
 
Old 09-02-2012, 07:30 PM
Micha艂 G贸rny
 
Default boost-utils.eclass -- for building against newest boost.

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
 
Old 09-04-2012, 08:50 PM
Micha艂 G贸rny
 
Default boost-utils.eclass -- for building against newest boost.

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
 

Thread Tools




All times are GMT. The time now is 07:11 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org