| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-util/boost-build/boost-build-1.50.0.ebuild,v 1.1 2012/07/06 22:18:47 floppym Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
PYTHON_DEPEND="python? *" |
| 7 |
|
| 8 |
inherit eutils flag-o-matic python toolchain-funcs versionator |
| 9 |
|
| 10 |
MY_PV=$(replace_all_version_separators _) |
| 11 |
MAJOR_PV="$(replace_all_version_separators _ $(get_version_component_range 1-2))" |
| 12 |
|
| 13 |
DESCRIPTION="A system for large project software construction, which is simple to use and powerful." |
| 14 |
HOMEPAGE="http://www.boost.org/doc/tools/build/index.html" |
| 15 |
SRC_URI="mirror://sourceforge/boost/boost_${MY_PV}.tar.bz2" |
| 16 |
|
| 17 |
LICENSE="Boost-1.0" |
| 18 |
SLOT="$(get_version_component_range 1-2)" |
| 19 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" |
| 20 |
IUSE="examples python" |
| 21 |
|
| 22 |
DEPEND="!<dev-libs/boost-1.34.0 |
| 23 |
!<=dev-util/boost-build-1.35.0-r1" |
| 24 |
RDEPEND="${DEPEND}" |
| 25 |
|
| 26 |
S="${WORKDIR}/boost_${MY_PV}/tools/build/v2" |
| 27 |
|
| 28 |
src_unpack() { |
| 29 |
tar xjpf "${DISTDIR}/${A}" boost_${MY_PV}/tools/build/v2 || die "unpacking tar failed" |
| 30 |
} |
| 31 |
|
| 32 |
src_prepare() { |
| 33 |
epatch "${FILESDIR}/${PN}-1.48.0-support_dots_in_python-buildid.patch" |
| 34 |
epatch "${FILESDIR}/${PN}-1.48.0-disable_python_rpath.patch" |
| 35 |
|
| 36 |
# Remove stripping option |
| 37 |
cd "${S}/engine" |
| 38 |
sed -i -e 's|-s\b||' \ |
| 39 |
build.jam || die "sed failed" |
| 40 |
|
| 41 |
# Force regeneration |
| 42 |
rm jambase.c || die |
| 43 |
|
| 44 |
# This patch allows us to fully control optimization |
| 45 |
# and stripping flags when bjam is used as build-system |
| 46 |
# We simply extend the optimization and debug-symbols feature |
| 47 |
# with empty dummies called 'none' |
| 48 |
cd "${S}" |
| 49 |
sed -i \ |
| 50 |
-e 's/\(off speed space\)/\1 none/' \ |
| 51 |
-e 's/\(debug-symbols : on off\)/\1 none/' \ |
| 52 |
tools/builtin.jam || die "sed failed" |
| 53 |
} |
| 54 |
|
| 55 |
src_compile() { |
| 56 |
cd engine |
| 57 |
local toolset |
| 58 |
|
| 59 |
if [[ ${CHOST} == *-darwin* ]] ; then |
| 60 |
toolset=darwin |
| 61 |
else |
| 62 |
# Using boost's generic toolset here, which respects CC and CFLAGS |
| 63 |
toolset=cc |
| 64 |
fi |
| 65 |
|
| 66 |
# For slotting |
| 67 |
sed -i \ |
| 68 |
-e "s|/usr/share/boost-build|/usr/share/boost-build-${MAJOR_PV}|" \ |
| 69 |
Jambase || die "sed failed" |
| 70 |
|
| 71 |
# The build.jam file for building bjam using a bootstrapped jam0 ignores |
| 72 |
# the LDFLAGS env var (bug #209794). We have now two options: |
| 73 |
# a) change the cc-target definition in build.jam to include separate compile |
| 74 |
# and link targets to make it use the LDFLAGS var, or |
| 75 |
# b) a simple dirty workaround by injecting the LDFLAGS in the LIBS env var |
| 76 |
# (which should not be set by us). |
| 77 |
if [[ -z "${LDFLAGS}" ]] ; then |
| 78 |
CC=$(tc-getCC) ./build.sh ${toolset} $(use_with python) \ |
| 79 |
|| die "building bjam failed" |
| 80 |
else |
| 81 |
LDFLAGS=$(echo ${LDFLAGS}) # 293652 |
| 82 |
LIBS=${LDFLAGS} CC=$(tc-getCC) ./build.sh ${toolset} \ |
| 83 |
$(use_with python) || die "building bjam failed" |
| 84 |
fi |
| 85 |
} |
| 86 |
|
| 87 |
src_install() { |
| 88 |
newbin engine/bin.*/bjam bjam-${MAJOR_PV} |
| 89 |
newbin engine/bin.*/b2 b2-${MAJOR_PV} |
| 90 |
|
| 91 |
cd "${S}" |
| 92 |
insinto /usr/share/boost-build-${MAJOR_PV} |
| 93 |
doins -r boost-build.jam bootstrap.jam build-system.jam site-config.jam user-config.jam \ |
| 94 |
build kernel options tools util || die |
| 95 |
|
| 96 |
dodoc changes.txt hacking.txt release_procedure.txt \ |
| 97 |
notes/build_dir_option.txt notes/relative_source_paths.txt |
| 98 |
|
| 99 |
if use examples ; then |
| 100 |
insinto /usr/share/doc/${PF} |
| 101 |
doins -r example |
| 102 |
fi |
| 103 |
} |
| 104 |
|
| 105 |
src_test() { |
| 106 |
cd test/engine |
| 107 |
|
| 108 |
# FIXME: Replace the ls call with the proper way of doing this. |
| 109 |
|
| 110 |
BJAM_BIN=$(ls ../../engine/bin.*/b2) |
| 111 |
${BJAM_BIN} -f test.jam "-sBJAM=${BJAM_BIN}" || die "tests failed" |
| 112 |
} |