Gentoo Archives: gentoo-dev

From: "Tiziano Müller" <dev-zero@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
Date: Tue, 28 Aug 2012 08:13:53
Message-Id: 1346141401.190464.3.camel@storm
In Reply to: Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost. by "Michał Górny"
1 Am Dienstag, den 28.08.2012, 10:06 +0200 schrieb Michał Górny:
2 > On Tue, 28 Aug 2012 06:26:02 +0200
3 > Arfrever Frehtes Taifersar Arahesis <arfrever.fta@×××××.com> wrote:
4 >
5 > > 2012-08-28 00:19:28 Michał Górny napisał(a):
6 > > > --- /dev/null
7 > > > +++ b/gx86/eclass/boost-utils.eclass
8 > > > @@ -0,0 +1,43 @@
9 > > > +# Copyright 1999-2012 Gentoo Foundation
10 > > > +# Distributed under the terms of the GNU General Public License v2
11 > > > +# $Header: $
12 > > > +
13 > > > +if [[ ! ${_BOOST_ECLASS} ]]; then
14 > > > +
15 > > > +# @ECLASS: boost-utils.eclass
16 > > > +# @MAINTAINER:
17 > > > +# mgorny@g.o
18 > >
19 > > It is better to copy list of maintainers from
20 > > gentoo-x86/dev-libs/boost/metadata.xml.
21 > >
22 > > > +# @BLURB: helper functions for packages using Boost C++ library
23 > > > +# @DESCRIPTION:
24 > > > +# Helper functions to be used when building packages using the
25 > > > Boost C++ +# library collection.
26 > > > +
27 > > > +case ${EAPI:-0} in
28 > > > + 0|1|2|3|4) ;;
29 > > > + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet
30 > > > established." +esac
31 > >
32 > > Please accept all EAPIs.
33 >
34 > These are EAPIs which are allowed throughout the tree, sorry. Feel free
35 > to ping Council about adding non-standard EAPIs to eclasses.
36 >
37 > > > +inherit versionator
38 > > > +
39 > > > +# @FUNCTION: boost-utils_get_best_slot
40 > > > +# @DESCRIPTION:
41 > > > +# Get newest SLOT (major version) of Boost.
42 > > > +boost-utils_get_best_slot() {
43 > > > + local pkg=dev-libs/boost
44 > > > + local atom=$(best_version ${pkg})
45 > > > + get_version_component_range 1-2 ${atom#${pkg}}
46 > > > +}
47 > > > +
48 > > > +# @FUNCTION: boost-utils_get_includedir
49 > > > +# @DESCRIPTION:
50 > > > +# Get correct includedir for best Boost version. Outputs the sole
51 > > > path +# (without -I).
52 > > > +boost-utils_get_includedir() {
53 > > > + local slot=$(boost-utils_get_best_slot)
54 > > > + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
55 > > > +
56 > > > + echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
57 > > > +}
58 > >
59 > > There needs to be a way to specify maximal accepted slot of Boost.
60 > > Examples of some possibilities:
61 > > * BOOST_MAX_SLOT="1.49" global variable
62 > > * '--max 1.49' arguments for boost-utils_get_* functions
63 >
64 > I'd rather wait with that till Tiziano expresses his opinion. I think
65 > the policy ought to be 'always prefer newest version' but I guess
66 > that's hard with boost.
67 >
68
69 one of the points of having a slotted boost (besides solving the rebuild
70 when API/ABI breakages occur) is that a package may also use an older
71 boost slot (currently it only would make sense if we'd backport the
72 glibc-2.16 patches but that's a different story). So I'd prefer if we'd
73 have a BOOST_MAX_SLOT variable.

Replies