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 09-09-2012, 05:26 AM
Arfrever Frehtes Taifersar Arahesis
 
Default boost-utils.eclass -- for building against newest boost.

2012-09-04 22:50:16 Michał Górny napisał(a):
> + local slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}

When BOOST_MAX_VERSION is non-empty, then it should be used in the following way:

[[ "${BOOST_MAX_VERSION}" =~ ^[[:digit:]]+.[[:digit:]]+$ ]] || die "Invalid BOOST_MAX_VERSION"
atom="$(best_version "<dev-libs/boost-${BOOST_MAX_VERSION%.*}.$((${BOOST_MAX_VERSION#*.} +1))_alpha")"
slot="$(get_version_component_range 1-2 ${atom#dev-libs/boost-})"

--
Arfrever Frehtes Taifersar Arahesis
 
Old 09-09-2012, 08:06 AM
Michał Górny
 
Default boost-utils.eclass -- for building against newest boost.

On Sun, 9 Sep 2012 07:26:23 +0200
Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:

> 2012-09-04 22:50:16 Michał Górny napisał(a):
> > + local
> > slot=${1:-${BOOST_MAX_VERSION:-$(boost-utils_get_best_slot)}}
>
> When BOOST_MAX_VERSION is non-empty, then it should be used in the
> following way:
>
> [[ "${BOOST_MAX_VERSION}" =~ ^[[:digit:]]+.[[:digit:]]+$ ]] || die
> "Invalid BOOST_MAX_VERSION" atom="$(best_version
> "<dev-libs/boost-${BOOST_MAX_VERSION%.*}.$((${BOOST_MAX_VERSION#*.} +1))_alpha")"
> slot="$(get_version_component_range 1-2 ${atom#dev-libs/boost-})"

No, we don't support older versions. The eclassdoc says it all.

--
Best regards,
Michał Górny
 
Old 09-09-2012, 05:47 PM
Arfrever Frehtes Taifersar Arahesis
 
Default boost-utils.eclass -- for building against newest boost.

2012-09-09 10:06:43 Michał Górny napisał(a):
> No, we don't support older versions.

Older versions must be supported to easily handle the situation when Boost 1.49 is stable and
Boost 1.50 and 1.51 are unstable and not package.masked and package X has only stable ebuilds
and all of them currently fail to build/work with Boost >=1.51, so BOOST_MAX_VERSION="1.50" would
have to be used in all ebuilds of package X.
(Boost 1.49 would be used for stable users and Boost 1.50 would be used for unstable users.)

--
Arfrever Frehtes Taifersar Arahesis
 
Old 09-09-2012, 06:10 PM
Michał Górny
 
Default boost-utils.eclass -- for building against newest boost.

On Sun, 9 Sep 2012 19:47:07 +0200
Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> wrote:

> 2012-09-09 10:06:43 Michał Górny napisał(a):
> > No, we don't support older versions.
>
> Older versions must be supported to easily handle the situation when Boost 1.49 is stable and
> Boost 1.50 and 1.51 are unstable and not package.masked and package X has only stable ebuilds
> and all of them currently fail to build/work with Boost >=1.51, so BOOST_MAX_VERSION="1.50" would
> have to be used in all ebuilds of package X.
> (Boost 1.49 would be used for stable users and Boost 1.50 would be used for unstable users.)

You are probably right. Even though I believe that we should treat
'older slot' support only as an interim solution before people fix
their packages...

--
Best regards,
Michał Górny
 
Old 09-09-2012, 09:41 PM
Michał Górny
 
Default boost-utils.eclass -- for building against newest boost.

Fixed to support any slot older than specified correctly.
---
gx86/eclass/boost-utils.eclass | 95 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 95 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..0d6eec3
--- /dev/null
+++ b/gx86/eclass/boost-utils.eclass
@@ -0,0 +1,95 @@
+# 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.
+#
+# Please note that this eclass does not set the dependencies for you.
+# You need to do that yourself.
+#
+# 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.
+
+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_SLOT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The maximal (newest) boost slot supported by the package. If unset,
+# there is no limit (the newest installed version will be used).
+
+# @FUNCTION: boost-utils_get_best_slot
+# @DESCRIPTION:
+# Get newest installed slot of Boost. If BOOST_MAX_SLOT is set, the version
+# returned will be at most in the specified slot.
+boost-utils_get_best_slot() {
+ local pkg=dev-libs/boost
+ [[ ${BOOST_MAX_SLOT} ]] && pkg="<=${pkg}-${BOOST_MAX_SLOT}.9999"
+
+ local cpv=$(best_version ${pkg})
+ get_version_component_range 1-2 ${cpv#${pkg}-}
+}
+
+# @FUNCTION: boost-utils_get_includedir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the includedir for the given Boost slot. If no slot is given,
+# defaults to the newest installed Boost slot (but not newer than
+# BOOST_MAX_SLOT if that variable is set).
+#
+# 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/./_}"
+}
+
+# @FUNCTION: boost-utils_get_libdir
+# @USAGE: [slot]
+# @DESCRIPTION:
+# Get the libdir for the given Boost slot. If no slot is given, defaults
+# to the newest installed Boost slot (but not newer than BOOST_MAX_SLOT
+# if that variable is set).
+#
+# Outputs the sole path (without -L).
+boost-utils_get_libdir() {
+ local slot=${1:-$(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 the newest installed Boost slot(but
+# not newer than BOOST_MAX_SLOT if that variable is set).
+#
+# 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
 
Old 09-19-2012, 09:38 AM
Michał Górny
 
Default boost-utils.eclass -- for building against newest boost.

On Sun, 9 Sep 2012 23:41:28 +0200
Michał Górny <mgorny@gentoo.org> wrote:

> Fixed to support any slot older than specified correctly.

Committed.

--
Best regards,
Michał Górny
 

Thread Tools




All times are GMT. The time now is 03:50 AM.

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