Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies