/[gentoo-x86]/eclass/boost-utils.eclass
Gentoo

Contents of /eclass/boost-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon May 12 11:53:28 2014 UTC (5 months, 2 weeks ago) by kensington
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Remove last-rited eclasses.

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/boost-utils.eclass,v 1.4 2014/03/18 10:35:39 mgorny Exp $
4
5 if [[ ! ${_BOOST_ECLASS} ]]; then
6
7 # @DEAD
8
9 # @ECLASS: boost-utils.eclass
10 # @MAINTAINER:
11 # Michał Górny <mgorny@gentoo.org>
12 # Tiziano Müller <dev-zero@gentoo.org>
13 # Sebastian Luther <SebastianLuther@gmx.de>
14 # Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
15 # @BLURB: helper functions for packages using Boost C++ library
16 # @DESCRIPTION:
17 # Helper functions to be used when building packages using the Boost C++
18 # library collection.
19 #
20 # Please note that this eclass does not set the dependencies for you.
21 # You need to do that yourself.
22 #
23 # For cmake & autotools it is usually necessary to set BOOST_ROOT using
24 # boost-utils_export_root. However, other build system may require more
25 # hackery or even appending -I$(boost-utils_get_includedir) to CFLAGS
26 # and -L$(boost-utils_get_libdir) to LDFLAGS.
27
28 case ${EAPI:-0} in
29 0|1|2|3|4|5) ;;
30 *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
31 esac
32
33 inherit multilib versionator
34
35 # @ECLASS-VARIABLE: BOOST_MAX_SLOT
36 # @DEFAULT_UNSET
37 # @DESCRIPTION:
38 # The maximal (newest) boost slot supported by the package. If unset,
39 # there is no limit (the newest installed version will be used).
40
41 # @FUNCTION: boost-utils_get_best_slot
42 # @DESCRIPTION:
43 # Get newest installed slot of Boost. If BOOST_MAX_SLOT is set, the version
44 # returned will be at most in the specified slot.
45 boost-utils_get_best_slot() {
46 local pkg=dev-libs/boost
47 [[ ${BOOST_MAX_SLOT} ]] && pkg="<=${pkg}-${BOOST_MAX_SLOT}.9999"
48
49 local cpv=$(best_version ${pkg})
50 get_version_component_range 1-2 ${cpv#dev-libs/boost-}
51 }
52
53 # @FUNCTION: boost-utils_get_includedir
54 # @USAGE: [slot]
55 # @DESCRIPTION:
56 # Get the includedir for the given Boost slot. If no slot is given,
57 # defaults to the newest installed Boost slot (but not newer than
58 # BOOST_MAX_SLOT if that variable is set).
59 #
60 # Outputs the sole path (without -I).
61 boost-utils_get_includedir() {
62 local slot=${1:-$(boost-utils_get_best_slot)}
63 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
64
65 echo -n "${EPREFIX}/usr/include/boost-${slot/./_}"
66 }
67
68 # @FUNCTION: boost-utils_get_libdir
69 # @USAGE: [slot]
70 # @DESCRIPTION:
71 # Get the libdir for the given Boost slot. If no slot is given, defaults
72 # to the newest installed Boost slot (but not newer than BOOST_MAX_SLOT
73 # if that variable is set).
74 #
75 # Outputs the sole path (without -L).
76 boost-utils_get_libdir() {
77 local slot=${1:-$(boost-utils_get_best_slot)}
78 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
79
80 echo -n "${EPREFIX}/usr/$(get_libdir)/boost-${slot/./_}"
81 }
82
83 # @FUNCTION: boost-utils_export_root
84 # @USAGE: [slot]
85 # @DESCRIPTION:
86 # Set the BOOST_ROOT variable to includedir for the given Boost slot.
87 # If no slot is given, defaults to the newest installed Boost slot(but
88 # not newer than BOOST_MAX_SLOT if that variable is set).
89 #
90 # This variable satisfies both cmake and sys-devel/boost-m4 autoconf
91 # macros.
92 boost-utils_export_root() {
93 export BOOST_ROOT=$(boost-utils_get_includedir "${@}")
94 }
95
96 _BOOST_ECLASS=1
97 fi # _BOOST_ECLASS

  ViewVC Help
Powered by ViewVC 1.1.20