Gentoo Archives: gentoo-commits

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