Gentoo Archives: gentoo-dev

From: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@×××××.com>
To: Gentoo Development <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost.
Date: Tue, 28 Aug 2012 04:27:49
Message-Id: 201208280626.06972.Arfrever.FTA@gmail.com
In Reply to: [gentoo-dev] [PATCH] boost-utils.eclass -- for building against newest boost. by "Michał Górny"
1 2012-08-28 00:19:28 Michał Górny napisał(a):
2 > --- /dev/null
3 > +++ b/gx86/eclass/boost-utils.eclass
4 > @@ -0,0 +1,43 @@
5 > +# Copyright 1999-2012 Gentoo Foundation
6 > +# Distributed under the terms of the GNU General Public License v2
7 > +# $Header: $
8 > +
9 > +if [[ ! ${_BOOST_ECLASS} ]]; then
10 > +
11 > +# @ECLASS: boost-utils.eclass
12 > +# @MAINTAINER:
13 > +# mgorny@g.o
14
15 It is better to copy list of maintainers from gentoo-x86/dev-libs/boost/metadata.xml.
16
17 > +# @BLURB: helper functions for packages using Boost C++ library
18 > +# @DESCRIPTION:
19 > +# Helper functions to be used when building packages using the Boost C++
20 > +# library collection.
21 > +
22 > +case ${EAPI:-0} in
23 > + 0|1|2|3|4) ;;
24 > + *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
25 > +esac
26
27 Please accept all EAPIs.
28
29 > +inherit versionator
30 > +
31 > +# @FUNCTION: boost-utils_get_best_slot
32 > +# @DESCRIPTION:
33 > +# Get newest SLOT (major version) of Boost.
34 > +boost-utils_get_best_slot() {
35 > + local pkg=dev-libs/boost
36 > + local atom=$(best_version ${pkg})
37 > + get_version_component_range 1-2 ${atom#${pkg}}
38 > +}
39 > +
40 > +# @FUNCTION: boost-utils_get_includedir
41 > +# @DESCRIPTION:
42 > +# Get correct includedir for best Boost version. Outputs the sole path
43 > +# (without -I).
44 > +boost-utils_get_includedir() {
45 > + local slot=$(boost-utils_get_best_slot)
46 > + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
47 > +
48 > + echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
49 > +}
50
51 There needs to be a way to specify maximal accepted slot of Boost. Examples of some possibilities:
52 * BOOST_MAX_SLOT="1.49" global variable
53 * '--max 1.49' arguments for boost-utils_get_* functions
54
55 --
56 Arfrever Frehtes Taifersar Arahesis

Attachments

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

Replies