| 1 |
hwoarang |
1.1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
jer |
1.4 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.49.0-r1.ebuild,v 1.3 2012/07/19 20:45:11 maekke Exp $
|
| 4 |
hwoarang |
1.1 |
|
| 5 |
|
|
EAPI="4"
|
| 6 |
|
|
PYTHON_DEPEND="python? *"
|
| 7 |
|
|
SUPPORT_PYTHON_ABIS="1"
|
| 8 |
|
|
RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
|
| 9 |
|
|
|
| 10 |
|
|
inherit check-reqs flag-o-matic multilib python toolchain-funcs versionator
|
| 11 |
|
|
|
| 12 |
|
|
MY_P=${PN}_$(replace_all_version_separators _)
|
| 13 |
|
|
|
| 14 |
|
|
DESCRIPTION="Boost Libraries for C++"
|
| 15 |
|
|
HOMEPAGE="http://www.boost.org/"
|
| 16 |
|
|
SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2"
|
| 17 |
|
|
|
| 18 |
|
|
LICENSE="Boost-1.0"
|
| 19 |
|
|
SLOT="$(get_version_component_range 1-2)"
|
| 20 |
jer |
1.4 |
KEYWORDS="~alpha ~amd64 arm hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
|
| 21 |
hwoarang |
1.1 |
IUSE="debug doc +eselect icu mpi python static-libs test tools"
|
| 22 |
|
|
|
| 23 |
|
|
RDEPEND="icu? ( >=dev-libs/icu-3.3 )
|
| 24 |
|
|
mpi? ( || ( sys-cluster/openmpi[cxx] sys-cluster/mpich2[cxx,threads] ) )
|
| 25 |
|
|
sys-libs/zlib
|
| 26 |
|
|
!!<=dev-libs/boost-1.35.0-r2
|
| 27 |
|
|
>=app-admin/eselect-boost-0.4"
|
| 28 |
|
|
DEPEND="${RDEPEND}
|
| 29 |
|
|
dev-util/boost-build:${SLOT}"
|
| 30 |
|
|
|
| 31 |
|
|
S=${WORKDIR}/${MY_P}
|
| 32 |
|
|
|
| 33 |
|
|
MAJOR_PV=$(replace_all_version_separators _ ${SLOT})
|
| 34 |
|
|
BJAM="b2-${MAJOR_PV}"
|
| 35 |
|
|
|
| 36 |
|
|
# Usage:
|
| 37 |
|
|
# _add_line <line-to-add> <profile>
|
| 38 |
|
|
# ... to add to specific profile
|
| 39 |
|
|
# or
|
| 40 |
|
|
# _add_line <line-to-add>
|
| 41 |
|
|
# ... to add to all profiles for which the use flag set
|
| 42 |
|
|
|
| 43 |
|
|
_add_line() {
|
| 44 |
|
|
if [[ -z "$2" ]]; then
|
| 45 |
|
|
echo "${1}" >> "${D}usr/share/boost-eselect/profiles/${SLOT}/default"
|
| 46 |
|
|
if use debug; then
|
| 47 |
|
|
echo "${1}" >> "${D}usr/share/boost-eselect/profiles/${SLOT}/debug"
|
| 48 |
|
|
fi
|
| 49 |
|
|
else
|
| 50 |
|
|
echo "${1}" >> "${D}usr/share/boost-eselect/profiles/${SLOT}/${2}"
|
| 51 |
|
|
fi
|
| 52 |
|
|
}
|
| 53 |
|
|
|
| 54 |
|
|
create_user-config.jam() {
|
| 55 |
|
|
local compiler compiler_version compiler_executable
|
| 56 |
|
|
|
| 57 |
|
|
if [[ ${CHOST} == *-darwin* ]]; then
|
| 58 |
|
|
compiler="darwin"
|
| 59 |
|
|
compiler_version="$(gcc-fullversion)"
|
| 60 |
|
|
compiler_executable="$(tc-getCXX)"
|
| 61 |
|
|
else
|
| 62 |
|
|
compiler="gcc"
|
| 63 |
|
|
compiler_version="$(gcc-version)"
|
| 64 |
|
|
compiler_executable="$(tc-getCXX)"
|
| 65 |
|
|
fi
|
| 66 |
|
|
local mpi_configuration python_configuration
|
| 67 |
|
|
|
| 68 |
|
|
if use mpi; then
|
| 69 |
|
|
mpi_configuration="using mpi ;"
|
| 70 |
|
|
fi
|
| 71 |
|
|
|
| 72 |
|
|
if use python; then
|
| 73 |
|
|
python_configuration="using python : $(python_get_version) : /usr : $(python_get_includedir) : /usr/$(get_libdir) ;"
|
| 74 |
|
|
fi
|
| 75 |
|
|
|
| 76 |
|
|
# The debug-symbols=none and optimization=none are not official upstream flags but a Gentoo
|
| 77 |
|
|
# specific patch to make sure that all our CFLAGS/CXXFLAGS/LDFLAGS are being respected.
|
| 78 |
|
|
# Using optimization=off would for example add "-O0" and override "-O2" set by the user.
|
| 79 |
|
|
# Please take a look at the boost-build ebuild for more information.
|
| 80 |
|
|
cat > user-config.jam << __EOF__
|
| 81 |
|
|
variant gentoorelease : release : <optimization>none <debug-symbols>none ;
|
| 82 |
|
|
variant gentoodebug : debug : <optimization>none ;
|
| 83 |
|
|
|
| 84 |
|
|
using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
|
| 85 |
|
|
${mpi_configuration}
|
| 86 |
|
|
${python_configuration}
|
| 87 |
|
|
__EOF__
|
| 88 |
|
|
}
|
| 89 |
|
|
|
| 90 |
|
|
pkg_pretend() {
|
| 91 |
|
|
if use test; then
|
| 92 |
|
|
CHECKREQS_DISK_BUILD="15G" check-reqs_pkg_pretend
|
| 93 |
|
|
|
| 94 |
|
|
ewarn "The tests may take several hours on a recent machine"
|
| 95 |
|
|
ewarn "but they will not fail (unless something weird happens ;-)"
|
| 96 |
|
|
ewarn "This is because the tests depend on the used compiler version"
|
| 97 |
|
|
ewarn "and the platform and upstream says that this is normal."
|
| 98 |
|
|
ewarn "If you are interested in the results, please take a look at the"
|
| 99 |
|
|
ewarn "generated results page:"
|
| 100 |
|
|
ewarn " ${ROOT}usr/share/doc/${PF}/status/cs-$(uname).html"
|
| 101 |
|
|
fi
|
| 102 |
|
|
}
|
| 103 |
|
|
|
| 104 |
|
|
pkg_setup() {
|
| 105 |
|
|
if use python; then
|
| 106 |
|
|
python_pkg_setup
|
| 107 |
|
|
fi
|
| 108 |
|
|
|
| 109 |
|
|
if use debug; then
|
| 110 |
|
|
ewarn "The debug USE flag means that a second set of the boost libraries"
|
| 111 |
|
|
ewarn "will be built containing debug symbols. You'll be able to select them"
|
| 112 |
|
|
ewarn "using the boost-eselect module. But even though the optimization flags"
|
| 113 |
|
|
ewarn "you might have set are not stripped, there will be a performance"
|
| 114 |
|
|
ewarn "penalty and linking other packages against the debug version"
|
| 115 |
|
|
ewarn "of boost is _not_ recommended."
|
| 116 |
|
|
fi
|
| 117 |
|
|
}
|
| 118 |
|
|
|
| 119 |
|
|
src_prepare() {
|
| 120 |
|
|
epatch "${FILESDIR}/${PN}-1.48.0-mpi_python3.patch"
|
| 121 |
|
|
epatch "${FILESDIR}/${PN}-1.48.0-respect_python-buildid.patch"
|
| 122 |
|
|
epatch "${FILESDIR}/${PN}-1.48.0-support_dots_in_python-buildid.patch"
|
| 123 |
|
|
epatch "${FILESDIR}/${PN}-1.48.0-no_strict_aliasing_python2.patch"
|
| 124 |
|
|
epatch "${FILESDIR}/${PN}-1.48.0-disable_libboost_python3.patch"
|
| 125 |
|
|
epatch "${FILESDIR}/${PN}-1.48.0-python_linking.patch"
|
| 126 |
|
|
epatch "${FILESDIR}/${PN}-1.48.0-disable_icu_rpath.patch"
|
| 127 |
|
|
epatch "${FILESDIR}/remove-toolset-1.48.0.patch"
|
| 128 |
|
|
}
|
| 129 |
|
|
|
| 130 |
|
|
src_configure() {
|
| 131 |
|
|
OPTIONS=""
|
| 132 |
|
|
|
| 133 |
|
|
if [[ ${CHOST} == *-darwin* ]]; then
|
| 134 |
|
|
# We need to add the prefix, and in two cases this exceeds, so prepare
|
| 135 |
|
|
# for the largest possible space allocation.
|
| 136 |
|
|
append-ldflags -Wl,-headerpad_max_install_names
|
| 137 |
|
|
fi
|
| 138 |
|
|
|
| 139 |
|
|
# bug 298489
|
| 140 |
|
|
if use ppc || use ppc64; then
|
| 141 |
|
|
[[ $(gcc-version) > 4.3 ]] && append-flags -mno-altivec
|
| 142 |
|
|
fi
|
| 143 |
|
|
|
| 144 |
|
|
use icu && OPTIONS+=" -sICU_PATH=/usr"
|
| 145 |
|
|
use icu || OPTIONS+=" --disable-icu boost.locale.icu=off"
|
| 146 |
|
|
use mpi || OPTIONS+=" --without-mpi"
|
| 147 |
|
|
use python || OPTIONS+=" --without-python"
|
| 148 |
|
|
|
| 149 |
|
|
# https://svn.boost.org/trac/boost/attachment/ticket/2597/add-disable-long-double.patch
|
| 150 |
|
|
if use sparc || { use mips && [[ ${ABI} = "o32" ]]; } || use hppa || use arm || use x86-fbsd || use sh; then
|
| 151 |
|
|
OPTIONS+=" --disable-long-double"
|
| 152 |
|
|
fi
|
| 153 |
|
|
|
| 154 |
|
|
OPTIONS+=" pch=off --boost-build=/usr/share/boost-build-${MAJOR_PV} --prefix=\"${D}usr\" --layout=versioned"
|
| 155 |
|
|
|
| 156 |
|
|
if use static-libs; then
|
| 157 |
|
|
LINK_OPTS="link=shared,static"
|
| 158 |
|
|
LIBRARY_TARGETS="*.a *$(get_libname)"
|
| 159 |
|
|
else
|
| 160 |
|
|
LINK_OPTS="link=shared"
|
| 161 |
|
|
# There is no dynamically linked version of libboost_test_exec_monitor and libboost_exception.
|
| 162 |
|
|
LIBRARY_TARGETS="libboost_test_exec_monitor*.a libboost_exception*.a *$(get_libname)"
|
| 163 |
|
|
fi
|
| 164 |
|
|
}
|
| 165 |
|
|
|
| 166 |
|
|
src_compile() {
|
| 167 |
|
|
local jobs
|
| 168 |
|
|
jobs=$( echo " ${MAKEOPTS} " | \
|
| 169 |
|
|
sed -e 's/ --jobs[= ]/ -j /g' \
|
| 170 |
|
|
-e 's/ -j \([1-9][0-9]*\)/ -j\1/g' \
|
| 171 |
|
|
-e 's/ -j\>/ -j1/g' | \
|
| 172 |
|
|
( while read -d ' ' j; do if [[ "${j#-j}" = "$j" ]]; then continue; fi; jobs="${j#-j}"; done; echo ${jobs} ) )
|
| 173 |
|
|
if [[ "${jobs}" != "" ]]; then NUMJOBS="-j"${jobs}; fi
|
| 174 |
|
|
|
| 175 |
|
|
export BOOST_ROOT="${S}"
|
| 176 |
|
|
PYTHON_DIRS=""
|
| 177 |
|
|
MPI_PYTHON_MODULE=""
|
| 178 |
|
|
|
| 179 |
|
|
building() {
|
| 180 |
|
|
create_user-config.jam
|
| 181 |
|
|
|
| 182 |
|
|
einfo "Using the following command to build:"
|
| 183 |
|
|
einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoorelease --user-config=user-config.jam ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared $(use python && echo --python-buildid=${PYTHON_ABI})"
|
| 184 |
|
|
|
| 185 |
|
|
${BJAM} ${NUMJOBS} -q -d+2 \
|
| 186 |
|
|
gentoorelease \
|
| 187 |
|
|
--user-config=user-config.jam \
|
| 188 |
|
|
${OPTIONS} \
|
| 189 |
|
|
threading=single,multi ${LINK_OPTS} runtime-link=shared \
|
| 190 |
|
|
$(use python && echo --python-buildid=${PYTHON_ABI}) \
|
| 191 |
|
|
|| die "Building of Boost libraries failed"
|
| 192 |
|
|
|
| 193 |
|
|
# ... and do the whole thing one more time to get the debug libs
|
| 194 |
|
|
if use debug; then
|
| 195 |
|
|
einfo "Using the following command to build:"
|
| 196 |
|
|
einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoodebug --user-config=user-config.jam ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared --buildid=debug $(use python && echo --python-buildid=${PYTHON_ABI})"
|
| 197 |
|
|
|
| 198 |
|
|
${BJAM} ${NUMJOBS} -q -d+2 \
|
| 199 |
|
|
gentoodebug \
|
| 200 |
|
|
--user-config=user-config.jam \
|
| 201 |
|
|
${OPTIONS} \
|
| 202 |
|
|
threading=single,multi ${LINK_OPTS} runtime-link=shared \
|
| 203 |
|
|
--buildid=debug \
|
| 204 |
|
|
$(use python && echo --python-buildid=${PYTHON_ABI}) \
|
| 205 |
|
|
|| die "Building of Boost debug libraries failed"
|
| 206 |
|
|
fi
|
| 207 |
|
|
|
| 208 |
|
|
if use python; then
|
| 209 |
|
|
if [[ -z "${PYTHON_DIRS}" ]]; then
|
| 210 |
|
|
PYTHON_DIRS="$(find bin.v2/libs -name python | sort)"
|
| 211 |
|
|
else
|
| 212 |
|
|
if [[ "${PYTHON_DIRS}" != "$(find bin.v2/libs -name python | sort)" ]]; then
|
| 213 |
|
|
die "Inconsistent structure of build directories"
|
| 214 |
|
|
fi
|
| 215 |
|
|
fi
|
| 216 |
|
|
|
| 217 |
|
|
local dir
|
| 218 |
|
|
for dir in ${PYTHON_DIRS}; do
|
| 219 |
|
|
mv ${dir} ${dir}-${PYTHON_ABI} || die "Renaming of '${dir}' to '${dir}-${PYTHON_ABI}' failed"
|
| 220 |
|
|
done
|
| 221 |
|
|
|
| 222 |
|
|
if use mpi; then
|
| 223 |
|
|
if [[ -z "${MPI_PYTHON_MODULE}" ]]; then
|
| 224 |
|
|
MPI_PYTHON_MODULE="$(find bin.v2/libs/mpi/build/*/gentoorelease -name mpi.so)"
|
| 225 |
|
|
if [[ "$(echo "${MPI_PYTHON_MODULE}" | wc -l)" -ne 1 ]]; then
|
| 226 |
|
|
die "Multiple mpi.so files found"
|
| 227 |
|
|
fi
|
| 228 |
|
|
else
|
| 229 |
|
|
if [[ "${MPI_PYTHON_MODULE}" != "$(find bin.v2/libs/mpi/build/*/gentoorelease -name mpi.so)" ]]; then
|
| 230 |
|
|
die "Inconsistent structure of build directories"
|
| 231 |
|
|
fi
|
| 232 |
|
|
fi
|
| 233 |
|
|
|
| 234 |
|
|
mv stage/lib/mpi.so stage/lib/mpi.so-${PYTHON_ABI} || die "Renaming of 'stage/lib/mpi.so' to 'stage/lib/mpi.so-${PYTHON_ABI}' failed"
|
| 235 |
|
|
fi
|
| 236 |
|
|
fi
|
| 237 |
|
|
}
|
| 238 |
|
|
if use python; then
|
| 239 |
|
|
python_execute_function building
|
| 240 |
|
|
else
|
| 241 |
|
|
building
|
| 242 |
|
|
fi
|
| 243 |
|
|
|
| 244 |
|
|
if use tools; then
|
| 245 |
|
|
pushd tools > /dev/null || die
|
| 246 |
|
|
einfo "Using the following command to build the tools:"
|
| 247 |
|
|
einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoorelease --user-config=../user-config.jam ${OPTIONS}"
|
| 248 |
|
|
|
| 249 |
|
|
${BJAM} ${NUMJOBS} -q -d+2\
|
| 250 |
|
|
gentoorelease \
|
| 251 |
|
|
--user-config=../user-config.jam \
|
| 252 |
|
|
${OPTIONS} \
|
| 253 |
|
|
|| die "Building of Boost tools failed"
|
| 254 |
|
|
popd > /dev/null || die
|
| 255 |
|
|
fi
|
| 256 |
|
|
}
|
| 257 |
|
|
|
| 258 |
|
|
src_install () {
|
| 259 |
|
|
dodir /usr/share/boost-eselect/profiles/${SLOT}
|
| 260 |
|
|
touch "${D}usr/share/boost-eselect/profiles/${SLOT}/default" || die
|
| 261 |
|
|
if use debug; then
|
| 262 |
|
|
touch "${D}usr/share/boost-eselect/profiles/${SLOT}/debug" || die
|
| 263 |
|
|
fi
|
| 264 |
|
|
|
| 265 |
|
|
if use mpi && use python; then
|
| 266 |
|
|
_add_line "python_modules=\""
|
| 267 |
|
|
fi
|
| 268 |
|
|
|
| 269 |
|
|
installation() {
|
| 270 |
|
|
create_user-config.jam
|
| 271 |
|
|
|
| 272 |
|
|
if use python; then
|
| 273 |
|
|
local dir
|
| 274 |
|
|
for dir in ${PYTHON_DIRS}; do
|
| 275 |
|
|
cp -pr ${dir}-${PYTHON_ABI} ${dir} || die "Copying of '${dir}-${PYTHON_ABI}' to '${dir}' failed"
|
| 276 |
|
|
done
|
| 277 |
|
|
|
| 278 |
|
|
if use mpi; then
|
| 279 |
|
|
cp -p stage/lib/mpi.so-${PYTHON_ABI} "${MPI_PYTHON_MODULE}" || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to '${MPI_PYTHON_MODULE}' failed"
|
| 280 |
|
|
cp -p stage/lib/mpi.so-${PYTHON_ABI} stage/lib/mpi.so || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to 'stage/lib/mpi.so' failed"
|
| 281 |
|
|
fi
|
| 282 |
|
|
fi
|
| 283 |
|
|
|
| 284 |
|
|
einfo "Using the following command to install:"
|
| 285 |
|
|
einfo "${BJAM} -q -d+2 gentoorelease --user-config=user-config.jam ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared --includedir=\"${D}usr/include\" --libdir=\"${D}usr/$(get_libdir)\" $(use python && echo --python-buildid=${PYTHON_ABI}) install"
|
| 286 |
|
|
|
| 287 |
|
|
${BJAM} -q -d+2 \
|
| 288 |
|
|
gentoorelease \
|
| 289 |
|
|
--user-config=user-config.jam \
|
| 290 |
|
|
${OPTIONS} \
|
| 291 |
|
|
threading=single,multi ${LINK_OPTS} runtime-link=shared \
|
| 292 |
|
|
--includedir="${D}usr/include" \
|
| 293 |
|
|
--libdir="${D}usr/$(get_libdir)" \
|
| 294 |
|
|
$(use python && echo --python-buildid=${PYTHON_ABI}) \
|
| 295 |
|
|
install || die "Installation of Boost libraries failed"
|
| 296 |
|
|
|
| 297 |
|
|
if use debug; then
|
| 298 |
|
|
einfo "Using the following command to install:"
|
| 299 |
|
|
einfo "${BJAM} -q -d+2 gentoodebug --user-config=user-config.jam ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared --includedir=\"${D}usr/include\" --libdir=\"${D}usr/$(get_libdir)\" --buildid=debug $(use python && echo --python-buildid=${PYTHON_ABI})"
|
| 300 |
|
|
|
| 301 |
|
|
${BJAM} -q -d+2 \
|
| 302 |
|
|
gentoodebug \
|
| 303 |
|
|
--user-config=user-config.jam \
|
| 304 |
|
|
${OPTIONS} \
|
| 305 |
|
|
threading=single,multi ${LINK_OPTS} runtime-link=shared \
|
| 306 |
|
|
--includedir="${D}usr/include" \
|
| 307 |
|
|
--libdir="${D}usr/$(get_libdir)" \
|
| 308 |
|
|
--buildid=debug \
|
| 309 |
|
|
$(use python && echo --python-buildid=${PYTHON_ABI}) \
|
| 310 |
|
|
install || die "Installation of Boost debug libraries failed"
|
| 311 |
|
|
fi
|
| 312 |
|
|
|
| 313 |
|
|
if use python; then
|
| 314 |
|
|
rm -r ${PYTHON_DIRS} || die
|
| 315 |
|
|
|
| 316 |
|
|
# Move mpi.so Python module to Python site-packages directory and make sure it is slotted.
|
| 317 |
|
|
if use mpi; then
|
| 318 |
|
|
mkdir -p "${D}$(python_get_sitedir)/boost_${MAJOR_PV}" || die
|
| 319 |
|
|
mv "${D}usr/$(get_libdir)/mpi.so" "${D}$(python_get_sitedir)/boost_${MAJOR_PV}" || die
|
| 320 |
|
|
cat << EOF > "${D}$(python_get_sitedir)/boost_${MAJOR_PV}/__init__.py" || die
|
| 321 |
|
|
import sys
|
| 322 |
|
|
if sys.platform.startswith('linux'):
|
| 323 |
|
|
import DLFCN
|
| 324 |
|
|
flags = sys.getdlopenflags()
|
| 325 |
|
|
sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL)
|
| 326 |
|
|
from . import mpi
|
| 327 |
|
|
sys.setdlopenflags(flags)
|
| 328 |
|
|
del DLFCN, flags
|
| 329 |
|
|
else:
|
| 330 |
|
|
from . import mpi
|
| 331 |
|
|
del sys
|
| 332 |
|
|
EOF
|
| 333 |
|
|
_add_line "$(python_get_sitedir)/mpi.py:boost_${MAJOR_PV}.mpi"
|
| 334 |
|
|
fi
|
| 335 |
|
|
fi
|
| 336 |
|
|
}
|
| 337 |
|
|
if use python; then
|
| 338 |
|
|
python_execute_function installation
|
| 339 |
|
|
else
|
| 340 |
|
|
installation
|
| 341 |
|
|
fi
|
| 342 |
|
|
|
| 343 |
|
|
if use mpi && use python; then
|
| 344 |
|
|
_add_line "\""
|
| 345 |
|
|
fi
|
| 346 |
|
|
|
| 347 |
|
|
use python || rm -rf "${D}usr/include/boost-${MAJOR_PV}/boost"/python* || die
|
| 348 |
|
|
|
| 349 |
|
|
if use doc; then
|
| 350 |
|
|
find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
|
| 351 |
|
|
dohtml \
|
| 352 |
|
|
-A pdf,txt,cpp,hpp \
|
| 353 |
|
|
*.{htm,html,png,css} \
|
| 354 |
|
|
-r doc
|
| 355 |
|
|
dohtml \
|
| 356 |
|
|
-A pdf,txt \
|
| 357 |
|
|
-r tools
|
| 358 |
|
|
insinto /usr/share/doc/${PF}/html
|
| 359 |
|
|
doins -r libs
|
| 360 |
|
|
doins -r more
|
| 361 |
|
|
|
| 362 |
|
|
# To avoid broken links
|
| 363 |
|
|
insinto /usr/share/doc/${PF}/html
|
| 364 |
|
|
doins LICENSE_1_0.txt
|
| 365 |
|
|
|
| 366 |
|
|
dosym /usr/include/boost-${MAJOR_PV}/boost /usr/share/doc/${PF}/html/boost
|
| 367 |
|
|
fi
|
| 368 |
|
|
|
| 369 |
|
|
pushd "${D}usr/$(get_libdir)" > /dev/null || die
|
| 370 |
|
|
|
| 371 |
|
|
# Remove (unversioned) symlinks
|
| 372 |
|
|
# And check for what we remove to catch bugs
|
| 373 |
|
|
# got a better idea how to do it? tell me!
|
| 374 |
|
|
local f
|
| 375 |
|
|
for f in $(ls -1 ${LIBRARY_TARGETS} | grep -v "${MAJOR_PV}"); do
|
| 376 |
|
|
if [[ ! -h "${f}" ]]; then
|
| 377 |
|
|
eerror "Tried to remove '${f}' which is a regular file instead of a symlink"
|
| 378 |
|
|
die "Slotting/naming of the libraries broken!"
|
| 379 |
|
|
fi
|
| 380 |
|
|
rm "${f}" || die
|
| 381 |
|
|
done
|
| 382 |
|
|
|
| 383 |
|
|
# The threading libs obviously always gets the "-mt" (multithreading) tag
|
| 384 |
|
|
# some packages seem to have a problem with it. Creating symlinks...
|
| 385 |
|
|
|
| 386 |
|
|
if use static-libs; then
|
| 387 |
|
|
THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}.a libboost_thread-mt-${MAJOR_PV}$(get_libname)"
|
| 388 |
|
|
else
|
| 389 |
|
|
THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}$(get_libname)"
|
| 390 |
|
|
fi
|
| 391 |
|
|
local lib
|
| 392 |
|
|
for lib in ${THREAD_LIBS}; do
|
| 393 |
|
|
dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
|
| 394 |
|
|
done
|
| 395 |
|
|
|
| 396 |
|
|
# The same goes for the mpi libs
|
| 397 |
|
|
if use mpi; then
|
| 398 |
|
|
if use static-libs; then
|
| 399 |
|
|
MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}.a libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
|
| 400 |
|
|
else
|
| 401 |
|
|
MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
|
| 402 |
|
|
fi
|
| 403 |
|
|
local lib
|
| 404 |
|
|
for lib in ${MPI_LIBS}; do
|
| 405 |
|
|
dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
|
| 406 |
|
|
done
|
| 407 |
|
|
fi
|
| 408 |
|
|
|
| 409 |
|
|
if use debug; then
|
| 410 |
|
|
if use static-libs; then
|
| 411 |
|
|
THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname) libboost_thread-mt-${MAJOR_PV}-debug.a"
|
| 412 |
|
|
else
|
| 413 |
|
|
THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname)"
|
| 414 |
|
|
fi
|
| 415 |
|
|
|
| 416 |
|
|
local lib
|
| 417 |
|
|
for lib in ${THREAD_DEBUG_LIBS}; do
|
| 418 |
|
|
dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
|
| 419 |
|
|
done
|
| 420 |
|
|
|
| 421 |
|
|
if use mpi; then
|
| 422 |
|
|
if use static-libs; then
|
| 423 |
|
|
MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug.a libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
|
| 424 |
|
|
else
|
| 425 |
|
|
MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
|
| 426 |
|
|
fi
|
| 427 |
|
|
|
| 428 |
|
|
local lib
|
| 429 |
|
|
for lib in ${MPI_DEBUG_LIBS}; do
|
| 430 |
|
|
dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
|
| 431 |
|
|
done
|
| 432 |
|
|
fi
|
| 433 |
|
|
fi
|
| 434 |
|
|
|
| 435 |
|
|
# Create a subdirectory with completely unversioned symlinks
|
| 436 |
|
|
# and store the names in the profiles-file for eselect
|
| 437 |
|
|
dodir /usr/$(get_libdir)/boost-${MAJOR_PV}
|
| 438 |
|
|
|
| 439 |
|
|
_add_line "libs=\"" default
|
| 440 |
|
|
local f
|
| 441 |
|
|
for f in $(ls -1 ${LIBRARY_TARGETS} | grep -v debug); do
|
| 442 |
|
|
dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}/${f/-${MAJOR_PV}}
|
| 443 |
|
|
_add_line "/usr/$(get_libdir)/${f}" default
|
| 444 |
|
|
done
|
| 445 |
|
|
_add_line "\"" default
|
| 446 |
|
|
|
| 447 |
|
|
if use debug; then
|
| 448 |
|
|
_add_line "libs=\"" debug
|
| 449 |
|
|
dodir /usr/$(get_libdir)/boost-${MAJOR_PV}-debug
|
| 450 |
|
|
local f
|
| 451 |
|
|
for f in $(ls -1 ${LIBRARY_TARGETS} | grep debug); do
|
| 452 |
|
|
dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}-debug/${f/-${MAJOR_PV}-debug}
|
| 453 |
|
|
_add_line "/usr/$(get_libdir)/${f}" debug
|
| 454 |
|
|
done
|
| 455 |
|
|
_add_line "\"" debug
|
| 456 |
|
|
|
| 457 |
|
|
_add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" debug
|
| 458 |
|
|
_add_line "suffix=\"-debug\"" debug
|
| 459 |
|
|
fi
|
| 460 |
|
|
|
| 461 |
|
|
_add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" default
|
| 462 |
|
|
|
| 463 |
|
|
popd > /dev/null || die
|
| 464 |
|
|
|
| 465 |
|
|
if use tools; then
|
| 466 |
|
|
pushd dist/bin > /dev/null || die
|
| 467 |
|
|
# Append version postfix to binaries for slotting
|
| 468 |
|
|
_add_line "bins=\""
|
| 469 |
|
|
local b
|
| 470 |
|
|
for b in *; do
|
| 471 |
|
|
newbin "${b}" "${b}-${MAJOR_PV}"
|
| 472 |
|
|
_add_line "/usr/bin/${b}-${MAJOR_PV}"
|
| 473 |
|
|
done
|
| 474 |
|
|
_add_line "\""
|
| 475 |
|
|
popd > /dev/null || die
|
| 476 |
|
|
|
| 477 |
|
|
pushd dist > /dev/null || die
|
| 478 |
|
|
insinto /usr/share
|
| 479 |
|
|
doins -r share/boostbook
|
| 480 |
|
|
# Append version postfix for slotting
|
| 481 |
|
|
mv "${D}usr/share/boostbook" "${D}usr/share/boostbook-${MAJOR_PV}" || die
|
| 482 |
|
|
_add_line "dirs=\"/usr/share/boostbook-${MAJOR_PV}\""
|
| 483 |
|
|
popd > /dev/null || die
|
| 484 |
|
|
fi
|
| 485 |
|
|
|
| 486 |
|
|
pushd status > /dev/null || die
|
| 487 |
|
|
if [[ -f regress.log ]]; then
|
| 488 |
|
|
docinto status
|
| 489 |
|
|
dohtml *.html ../boost.png
|
| 490 |
|
|
dodoc regress.log
|
| 491 |
|
|
fi
|
| 492 |
|
|
popd > /dev/null || die
|
| 493 |
|
|
|
| 494 |
|
|
# boost's build system truely sucks for not having a destdir. Because for
|
| 495 |
|
|
# this reason we are forced to build with a prefix that includes the
|
| 496 |
|
|
# DESTROOT, dynamic libraries on Darwin end messed up, referencing the
|
| 497 |
|
|
# DESTROOT instread of the actual EPREFIX. There is no way out of here
|
| 498 |
|
|
# but to do it the dirty way of manually setting the right install_names.
|
| 499 |
|
|
if [[ ${CHOST} == *-darwin* ]]; then
|
| 500 |
|
|
einfo "Working around completely broken build-system(tm)"
|
| 501 |
|
|
local d
|
| 502 |
|
|
for d in "${ED}"usr/lib/*.dylib; do
|
| 503 |
|
|
if [[ -f ${d} ]]; then
|
| 504 |
|
|
# fix the "soname"
|
| 505 |
|
|
ebegin " correcting install_name of ${d#${ED}}"
|
| 506 |
|
|
install_name_tool -id "/${d#${D}}" "${d}"
|
| 507 |
|
|
eend $?
|
| 508 |
|
|
# fix references to other libs
|
| 509 |
|
|
refs=$(otool -XL "${d}" | \
|
| 510 |
|
|
sed -e '1d' -e 's/^\t//' | \
|
| 511 |
|
|
grep "^libboost_" | \
|
| 512 |
|
|
cut -f1 -d' ')
|
| 513 |
|
|
local r
|
| 514 |
|
|
for r in ${refs}; do
|
| 515 |
|
|
ebegin " correcting reference to ${r}"
|
| 516 |
|
|
install_name_tool -change \
|
| 517 |
|
|
"${r}" \
|
| 518 |
|
|
"${EPREFIX}/usr/lib/${r}" \
|
| 519 |
|
|
"${d}"
|
| 520 |
|
|
eend $?
|
| 521 |
|
|
done
|
| 522 |
|
|
fi
|
| 523 |
|
|
done
|
| 524 |
|
|
fi
|
| 525 |
|
|
}
|
| 526 |
|
|
|
| 527 |
|
|
src_test() {
|
| 528 |
|
|
testing() {
|
| 529 |
|
|
if use python; then
|
| 530 |
|
|
local dir
|
| 531 |
|
|
for dir in ${PYTHON_DIRS}; do
|
| 532 |
|
|
cp -pr ${dir}-${PYTHON_ABI} ${dir} || die "Copying of '${dir}-${PYTHON_ABI}' to '${dir}' failed"
|
| 533 |
|
|
done
|
| 534 |
|
|
|
| 535 |
|
|
if use mpi; then
|
| 536 |
|
|
cp -p stage/lib/mpi.so-${PYTHON_ABI} "${MPI_PYTHON_MODULE}" || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to '${MPI_PYTHON_MODULE}' failed"
|
| 537 |
|
|
cp -p stage/lib/mpi.so-${PYTHON_ABI} stage/lib/mpi.so || die "Copying of 'stage/lib/mpi.so-${PYTHON_ABI}' to 'stage/lib/mpi.so' failed"
|
| 538 |
|
|
fi
|
| 539 |
|
|
fi
|
| 540 |
|
|
|
| 541 |
|
|
pushd tools/regression/build > /dev/null || die
|
| 542 |
|
|
einfo "Using the following command to build test helpers:"
|
| 543 |
|
|
einfo "${BJAM} -q -d+2 gentoorelease --user-config=../../../user-config.jam ${OPTIONS} process_jam_log compiler_status"
|
| 544 |
|
|
|
| 545 |
|
|
${BJAM} -q -d+2 \
|
| 546 |
|
|
gentoorelease \
|
| 547 |
|
|
--user-config=../../../user-config.jam \
|
| 548 |
|
|
${OPTIONS} \
|
| 549 |
|
|
process_jam_log compiler_status \
|
| 550 |
|
|
|| die "Building of regression test helpers failed"
|
| 551 |
|
|
|
| 552 |
|
|
popd > /dev/null || die
|
| 553 |
|
|
pushd status > /dev/null || die
|
| 554 |
|
|
|
| 555 |
|
|
# Some of the test-checks seem to rely on regexps
|
| 556 |
|
|
export LC_ALL="C"
|
| 557 |
|
|
|
| 558 |
|
|
# The following is largely taken from tools/regression/run_tests.sh,
|
| 559 |
|
|
# but adapted to our needs.
|
| 560 |
|
|
|
| 561 |
|
|
# Run the tests & write them into a file for postprocessing
|
| 562 |
|
|
einfo "Using the following command to test:"
|
| 563 |
|
|
einfo "${BJAM} --user-config=../user-config.jam ${OPTIONS} --dump-tests"
|
| 564 |
|
|
|
| 565 |
|
|
${BJAM} \
|
| 566 |
|
|
--user-config=../user-config.jam \
|
| 567 |
|
|
${OPTIONS} \
|
| 568 |
|
|
--dump-tests 2>&1 | tee regress.log || die
|
| 569 |
|
|
|
| 570 |
|
|
# Postprocessing
|
| 571 |
floppym |
1.2 |
cat regress.log | "$(find ../tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease -name process_jam_log)" --v2
|
| 572 |
hwoarang |
1.1 |
if test $? != 0; then
|
| 573 |
|
|
die "Postprocessing the build log failed"
|
| 574 |
|
|
fi
|
| 575 |
|
|
|
| 576 |
|
|
cat > comment.html <<- __EOF__
|
| 577 |
|
|
<p>Tests are run on a <a href="http://www.gentoo.org">Gentoo</a> system.</p>
|
| 578 |
|
|
__EOF__
|
| 579 |
|
|
|
| 580 |
|
|
# Generate the build log html summary page
|
| 581 |
floppym |
1.2 |
"$(find ../tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease -name compiler_status)" --v2 \
|
| 582 |
hwoarang |
1.1 |
--comment comment.html "${S}" \
|
| 583 |
|
|
cs-$(uname).html cs-$(uname)-links.html
|
| 584 |
|
|
if test $? != 0; then
|
| 585 |
|
|
die "Generating the build log html summary page failed"
|
| 586 |
|
|
fi
|
| 587 |
|
|
|
| 588 |
|
|
# And do some cosmetic fixes :)
|
| 589 |
|
|
sed -i -e 's|http://www.boost.org/boost.png|boost.png|' *.html || die
|
| 590 |
|
|
|
| 591 |
|
|
popd > /dev/null || die
|
| 592 |
|
|
|
| 593 |
|
|
if use python; then
|
| 594 |
|
|
rm -r ${PYTHON_DIRS} || die
|
| 595 |
|
|
fi
|
| 596 |
|
|
}
|
| 597 |
|
|
if use python; then
|
| 598 |
|
|
python_execute_function -f -q testing
|
| 599 |
|
|
else
|
| 600 |
|
|
testing
|
| 601 |
|
|
fi
|
| 602 |
|
|
}
|
| 603 |
|
|
|
| 604 |
|
|
pkg_postinst() {
|
| 605 |
|
|
if use eselect; then
|
| 606 |
|
|
eselect boost update || ewarn "eselect boost update failed."
|
| 607 |
|
|
fi
|
| 608 |
|
|
|
| 609 |
|
|
if [[ ! -h "${ROOT}etc/eselect/boost/active" ]]; then
|
| 610 |
|
|
elog "No active boost version found. Calling eselect to select one..."
|
| 611 |
|
|
eselect boost update || ewarn "eselect boost update failed."
|
| 612 |
|
|
fi
|
| 613 |
|
|
}
|