Gentoo Archives: gentoo-commits

From: "Markos Chandras (hwoarang)" <hwoarang@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/boost: boost-1.47.0.ebuild ChangeLog
Date: Mon, 26 Sep 2011 11:02:13
Message-Id: 20110926110202.A7D6220036@flycatcher.gentoo.org
1 hwoarang 11/09/26 11:02:02
2
3 Modified: ChangeLog
4 Added: boost-1.47.0.ebuild
5 Log:
6 Version bump. Bug #376937
7
8 (Portage version: 2.2.0_alpha55/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.228 dev-libs/boost/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.228&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.228&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?r1=1.227&r2=1.228
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v
20 retrieving revision 1.227
21 retrieving revision 1.228
22 diff -u -r1.227 -r1.228
23 --- ChangeLog 16 Sep 2011 16:54:16 -0000 1.227
24 +++ ChangeLog 26 Sep 2011 11:02:02 -0000 1.228
25 @@ -1,6 +1,13 @@
26 # ChangeLog for dev-libs/boost
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.227 2011/09/16 16:54:16 jer Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.228 2011/09/26 11:02:02 hwoarang Exp $
30 +
31 +*boost-1.47.0 (26 Sep 2011)
32 +
33 + 26 Sep 2011; Markos Chandras <hwoarang@g.o>
34 + +files/random-Jamfile-1.47.0, +boost-1.47.0.ebuild,
35 + +files/remove-toolset-1.47.0.patch:
36 + Version bump. Bug #376937
37
38 16 Sep 2011; Jeroen Roovers <jer@g.o> boost-1.46.1-r1.ebuild:
39 Stable for HPPA (bug #377805).
40
41
42
43 1.1 dev-libs/boost/boost-1.47.0.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/boost-1.47.0.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/boost-1.47.0.ebuild?rev=1.1&content-type=text/plain
47
48 Index: boost-1.47.0.ebuild
49 ===================================================================
50 # Copyright 1999-2011 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.47.0.ebuild,v 1.1 2011/09/26 11:02:02 hwoarang Exp $
53
54 EAPI="2"
55
56 inherit python flag-o-matic multilib toolchain-funcs versionator check-reqs
57
58 MY_P=${PN}_$(replace_all_version_separators _)
59
60 DESCRIPTION="Boost Libraries for C++"
61 HOMEPAGE="http://www.boost.org/"
62 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2"
63 LICENSE="Boost-1.0"
64 SLOT="$(get_version_component_range 1-2)"
65 IUSE="debug doc +eselect icu mpi python static-libs test tools"
66
67 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
68
69 RDEPEND="icu? ( >=dev-libs/icu-3.3 )
70 mpi? ( || ( sys-cluster/openmpi[cxx] sys-cluster/mpich2[cxx,threads] ) )
71 sys-libs/zlib
72 python? ( dev-lang/python )
73 !!<=dev-libs/boost-1.35.0-r2
74 >=app-admin/eselect-boost-0.3"
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 use debug && echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/${SLOT}/debug"
94 else
95 echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/${SLOT}/${2}"
96 fi
97 }
98
99 pkg_setup() {
100 # It doesn't compile with USE="python mpi" and python-3 (bug 295705)
101 if use python && use mpi ; then
102 if [[ "$(python_get_version --major)" != "2" ]]; then
103 eerror "The Boost.MPI python bindings do not support any other python version"
104 eerror "than 2.x. Please either use eselect to select a python 2.x version or"
105 eerror "disable the python and/or mpi use flag for =${CATEGORY}/${PF}."
106 die "unsupported python version"
107 fi
108 fi
109
110 if use test ; then
111 CHECKREQS_DISK_BUILD="15360"
112 check_reqs
113
114 ewarn "The tests may take several hours on a recent machine"
115 ewarn "but they will not fail (unless something weird happens ;-)"
116 ewarn "This is because the tests depend on the used compiler/-version"
117 ewarn "and the platform and upstream says that this is normal."
118 ewarn "If you are interested in the results, please take a look at the"
119 ewarn "generated results page:"
120 ewarn " ${ROOT}usr/share/doc/${PF}/status/cs-$(uname).html"
121 ebeep 5
122
123 fi
124
125 if use debug ; then
126 ewarn "The debug USE-flag means that a second set of the boost libraries"
127 ewarn "will be built containing debug-symbols. You'll be able to select them"
128 ewarn "using the boost-eselect module. But even though the optimization flags"
129 ewarn "you might have set are not stripped, there will be a performance"
130 ewarn "penalty and linking other packages against the debug version"
131 ewarn "of boost is _not_ recommended."
132 fi
133 }
134
135 src_prepare() {
136 epatch "${FILESDIR}/remove-toolset-${PV}.patch"
137
138 # This enables building the boost.random library with /dev/urandom support
139 if [[ -e /dev/urandom ]] ; then
140 mkdir -p libs/random/build || die
141 cp "${FILESDIR}/random-Jamfile-${PV}" libs/random/build/Jamfile.v2 || die
142 fi
143 }
144
145 src_configure() {
146 einfo "Writing new user-config.jam"
147
148 local compiler compilerVersion compilerExecutable mpi
149 if [[ ${CHOST} == *-darwin* ]] ; then
150 compiler=darwin
151 compilerVersion=$(gcc-fullversion)
152 compilerExecutable=$(tc-getCXX)
153 # we need to add the prefix, and in two cases this exceeds, so prepare
154 # for the largest possible space allocation
155 append-ldflags -Wl,-headerpad_max_install_names
156 else
157 compiler=gcc
158 compilerVersion=$(gcc-version)
159 compilerExecutable=$(tc-getCXX)
160 fi
161
162 # Using -fno-strict-aliasing to prevent possible creation of invalid code.
163 append-flags -fno-strict-aliasing
164
165 # bug 298489
166 if use ppc || use ppc64 ; then
167 [[ $(gcc-version) > 4.3 ]] && append-flags -mno-altivec
168 fi;
169
170 use mpi && mpi="using mpi ;"
171
172 if use python ; then
173 pystring="using python : $(python_get_version) : /usr : $(python_get_includedir) : $(python_get_libdir) ;"
174 fi
175
176 cat > "${S}/user-config.jam" << __EOF__
177
178 variant gentoorelease : release : <optimization>none <debug-symbols>none ;
179 variant gentoodebug : debug : <optimization>none ;
180
181 using ${compiler} : ${compilerVersion} : ${compilerExecutable} : <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
182
183 ${pystring}
184
185 ${mpi}
186
187 __EOF__
188
189 # Maintainer information:
190 # The debug-symbols=none and optimization=none
191 # are not official upstream flags but a Gentoo
192 # specific patch to make sure that all our
193 # CXXFLAGS/LDFLAGS are being respected.
194 # Using optimization=off would for example add
195 # "-O0" and override "-O2" set by the user.
196 # Please take a look at the boost-build ebuild
197 # for more infomration.
198
199 use icu && OPTIONS="-sICU_PATH=/usr"
200 use icu || OPTIONS="--disable-icu"
201 use mpi || OPTIONS="${OPTIONS} --without-mpi"
202 use python || OPTIONS="${OPTIONS} --without-python"
203
204 # https://svn.boost.org/trac/boost/attachment/ticket/2597/add-disable-long-double.patch
205 if use sparc || { use mips && [[ ${ABI} = "o32" ]]; } || use hppa || use arm || use x86-fbsd || use sh; then
206 OPTIONS="${OPTIONS} --disable-long-double"
207 fi
208
209 OPTIONS="${OPTIONS} pch=off --user-config=\"${S}/user-config.jam\" --boost-build=/usr/share/boost-build-${MAJOR_PV} --prefix=\"${D}/usr\" --layout=versioned"
210
211 if use static-libs ; then
212 LINK_OPTS="link=shared,static"
213 LIBRARY_TARGETS="*.a *$(get_libname)"
214 else
215 LINK_OPTS="link=shared"
216 #there is no dynamicly linked version of libboost_test_exec_monitor and libboost_exception
217 LIBRARY_TARGETS="libboost_test_exec_monitor*.a libboost_exception*.a *$(get_libname)"
218 fi
219 }
220
221 src_compile() {
222 jobs=$( echo " ${MAKEOPTS} " | \
223 sed -e 's/ --jobs[= ]/ -j /g' \
224 -e 's/ -j \([1-9][0-9]*\)/ -j\1/g' \
225 -e 's/ -j\>/ -j1/g' | \
226 ( while read -d ' ' j ; do if [[ "${j#-j}" = "$j" ]]; then continue; fi; jobs="${j#-j}"; done; echo ${jobs} ) )
227 if [[ "${jobs}" != "" ]]; then NUMJOBS="-j"${jobs}; fi;
228
229 export BOOST_ROOT="${S}"
230
231 einfo "Using the following command to build: "
232 einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoorelease ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared"
233
234 ${BJAM} ${NUMJOBS} -q -d+2 \
235 gentoorelease \
236 ${OPTIONS} \
237 threading=single,multi ${LINK_OPTS} runtime-link=shared \
238 || die "building boost failed"
239
240 # ... and do the whole thing one more time to get the debug libs
241 if use debug ; then
242 einfo "Using the following command to build: "
243 einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoodebug ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared --buildid=debug"
244
245 ${BJAM} ${NUMJOBS} -q -d+2 \
246 gentoodebug \
247 ${OPTIONS} \
248 threading=single,multi ${LINK_OPTS} runtime-link=shared \
249 --buildid=debug \
250 || die "building boost failed"
251 fi
252
253 if use tools; then
254 cd "${S}/tools/"
255 einfo "Using the following command to build the tools: "
256 einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoorelease ${OPTIONS}"
257
258 ${BJAM} ${NUMJOBS} -q -d+2\
259 gentoorelease \
260 ${OPTIONS} \
261 || die "building tools failed"
262 fi
263
264 }
265
266 src_install () {
267 export BOOST_ROOT="${S}"
268
269 einfo "Using the following command to install: "
270 einfo "${BJAM} -q -d+2 gentoorelease ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared --includedir=\"${D}/usr/include\" --libdir=\"${D}/usr/$(get_libdir)\" install"
271
272 ${BJAM} -q -d+2 \
273 gentoorelease \
274 ${OPTIONS} \
275 threading=single,multi ${LINK_OPTS} runtime-link=shared \
276 --includedir="${D}/usr/include" \
277 --libdir="${D}/usr/$(get_libdir)" \
278 install || die "install failed for options '${OPTIONS}'"
279
280 if use debug ; then
281 einfo "Using the following command to install: "
282 einfo "${BJAM} -q -d+2 gentoodebug ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared --includedir=\"${D}/usr/include\" --libdir=\"${D}/usr/$(get_libdir)\" --buildid=debug"
283
284 ${BJAM} -q -d+2 \
285 gentoodebug \
286 ${OPTIONS} \
287 threading=single,multi ${LINK_OPTS} runtime-link=shared \
288 --includedir="${D}/usr/include" \
289 --libdir="${D}/usr/$(get_libdir)" \
290 --buildid=debug \
291 install || die "install failed for options '${OPTIONS}'"
292 fi
293
294 use python || rm -rf "${D}/usr/include/boost-${MAJOR_PV}/boost"/python* || die
295
296 dodir /usr/share/boost-eselect/profiles/${SLOT} || die
297 touch "${D}/usr/share/boost-eselect/profiles/${SLOT}/default" || die
298 if use debug ; then
299 touch "${D}/usr/share/boost-eselect/profiles/${SLOT}/debug" || die
300 fi
301
302 # Move the mpi.so to the right place and make sure it's slotted
303 if use mpi && use python; then
304 mkdir -p "${D}$(python_get_sitedir)/boost_${MAJOR_PV}" || die
305 mv "${D}/usr/$(get_libdir)/mpi.so" "${D}$(python_get_sitedir)/boost_${MAJOR_PV}/" || die
306 touch "${D}$(python_get_sitedir)/boost_${MAJOR_PV}/__init__.py" || die
307 _add_line "python=\"$(python_get_sitedir)/boost_${MAJOR_PV}/mpi.so\""
308 fi
309
310 if use doc ; then
311 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
312 dohtml \
313 -A pdf,txt,cpp,hpp \
314 *.{htm,html,png,css} \
315 -r doc || die
316 dohtml \
317 -A pdf,txt \
318 -r tools || die
319 insinto /usr/share/doc/${PF}/html
320 doins -r libs || die
321 doins -r more || die
322
323 # To avoid broken links
324 insinto /usr/share/doc/${PF}/html
325 doins LICENSE_1_0.txt || die
326
327 dosym /usr/include/boost-${MAJOR_PV}/boost /usr/share/doc/${PF}/html/boost || die
328 fi
329
330 cd "${D}/usr/$(get_libdir)" || die
331
332 # Remove (unversioned) symlinks
333 # And check for what we remove to catch bugs
334 # got a better idea how to do it? tell me!
335 for f in $(ls -1 ${LIBRARY_TARGETS} | grep -v "${MAJOR_PV}") ; do
336 if [ ! -h "${f}" ] ; then
337 eerror "Ups, tried to remove '${f}' which is a a real file instead of a symlink"
338 die "slotting/naming of the libs broken!"
339 fi
340 rm "${f}" || die
341 done
342
343 # The threading libs obviously always gets the "-mt" (multithreading) tag
344 # some packages seem to have a problem with it. Creating symlinks...
345
346 if use static-libs ; then
347 THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}.a libboost_thread-mt-${MAJOR_PV}$(get_libname)"
348 else
349 THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}$(get_libname)"
350 fi
351 for lib in ${THREAD_LIBS} ; do
352 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})" || die
353 done
354
355 # The same goes for the mpi libs
356 if use mpi ; then
357 if use static-libs ; then
358 MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}.a libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
359 else
360 MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
361 fi
362 for lib in ${MPI_LIBS} ; do
363 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})" || die
364 done
365 fi
366
367 if use debug ; then
368 if use static-libs ; then
369 THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname) libboost_thread-mt-${MAJOR_PV}-debug.a"
370 else
371 THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname)"
372 fi
373
374 for lib in ${THREAD_DEBUG_LIBS} ; do
375 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})" || die
376 done
377
378 if use mpi ; then
379 if use static-libs ; then
380 MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug.a libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
381 else
382 MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
383 fi
384
385 for lib in ${MPI_DEBUG_LIBS} ; do
386 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})" || die
387 done
388 fi
389 fi
390
391 # Create a subdirectory with completely unversioned symlinks
392 # and store the names in the profiles-file for eselect
393 dodir /usr/$(get_libdir)/boost-${MAJOR_PV} || die
394
395 _add_line "libs=\"" default
396 for f in $(ls -1 ${LIBRARY_TARGETS} | grep -v debug) ; do
397 dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}/${f/-${MAJOR_PV}} || die
398 _add_line "/usr/$(get_libdir)/${f}" default
399 done
400 _add_line "\"" default
401
402 if use debug ; then
403 _add_line "libs=\"" debug
404 dodir /usr/$(get_libdir)/boost-${MAJOR_PV}-debug || die
405 for f in $(ls -1 ${LIBRARY_TARGETS} | grep debug) ; do
406 dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}-debug/${f/-${MAJOR_PV}-debug} || die
407 _add_line "/usr/$(get_libdir)/${f}" debug
408 done
409 _add_line "\"" debug
410
411 _add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" debug
412 _add_line "suffix=\"-debug\"" debug
413 fi
414
415 _add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" default
416
417 if use tools; then
418 cd "${S}/dist/bin" || die
419 # Append version postfix to binaries for slotting
420 _add_line "bins=\""
421 for b in * ; do
422 newbin "${b}" "${b}-${MAJOR_PV}" || die
423 _add_line "/usr/bin/${b}-${MAJOR_PV}"
424 done
425 _add_line "\""
426
427 cd "${S}/dist" || die
428 insinto /usr/share || die
429 doins -r share/boostbook || die
430 # Append version postfix for slotting
431 mv "${D}/usr/share/boostbook" "${D}/usr/share/boostbook-${MAJOR_PV}" || die
432 _add_line "dirs=\"/usr/share/boostbook-${MAJOR_PV}\""
433 fi
434
435 cd "${S}/status" || die
436 if [ -f regress.log ] ; then
437 docinto status || die
438 dohtml *.html ../boost.png || die
439 dodoc regress.log || die
440 fi
441
442 use python && python_need_rebuild
443
444 # boost's build system truely sucks for not having a destdir. Because for
445 # this reason we are forced to build with a prefix that includes the
446 # DESTROOT, dynamic libraries on Darwin end messed up, referencing the
447 # DESTROOT instread of the actual EPREFIX. There is no way out of here
448 # but to do it the dirty way of manually setting the right install_names.
449 [[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/
450 if [[ ${CHOST} == *-darwin* ]] ; then
451 einfo "Working around completely broken build-system(tm)"
452 for d in "${ED}"usr/lib/*.dylib ; do
453 if [[ -f ${d} ]] ; then
454 # fix the "soname"
455 ebegin " correcting install_name of ${d#${ED}}"
456 install_name_tool -id "/${d#${D}}" "${d}"
457 eend $?
458 # fix references to other libs
459 refs=$(otool -XL "${d}" | \
460 sed -e '1d' -e 's/^\t//' | \
461 grep "^libboost_" | \
462 cut -f1 -d' ')
463 for r in ${refs} ; do
464 ebegin " correcting reference to ${r}"
465 install_name_tool -change \
466 "${r}" \
467 "${EPREFIX}/usr/lib/${r}" \
468 "${d}"
469 eend $?
470 done
471 fi
472 done
473 fi
474 }
475
476 src_test() {
477 export BOOST_ROOT=${S}
478
479 cd "${S}/tools/regression/build" || die
480 einfo "Using the following command to build test helpers: "
481 einfo "${BJAM} -q -d+2 gentoorelease ${OPTIONS} process_jam_log compiler_status"
482
483 ${BJAM} -q -d+2 \
484 gentoorelease \
485 ${OPTIONS} \
486 process_jam_log compiler_status \
487 || die "building regression test helpers failed"
488
489 cd "${S}/status" || die
490
491 # Some of the test-checks seem to rely on regexps
492 export LC_ALL="C"
493
494 # The following is largely taken from tools/regression/run_tests.sh,
495 # but adapted to our needs.
496
497 # Run the tests & write them into a file for postprocessing
498 einfo "Using the following command to test: "
499 einfo "${BJAM} ${OPTIONS} --dump-tests"
500
501 ${BJAM} \
502 ${OPTIONS} \
503 --dump-tests 2>&1 | tee regress.log || die
504
505 # Postprocessing
506 cat regress.log | "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/pch-off/process_jam_log" --v2
507 if test $? != 0 ; then
508 die "Postprocessing the build log failed"
509 fi
510
511 cat > "${S}/status/comment.html" <<- __EOF__
512 <p>Tests are run on a <a href="http://www.gentoo.org">Gentoo</a> system.</p>
513 __EOF__
514
515 # Generate the build log html summary page
516 "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/pch-off/compiler_status" --v2 \
517 --comment "${S}/status/comment.html" "${S}" \
518 cs-$(uname).html cs-$(uname)-links.html
519 if test $? != 0 ; then
520 die "Generating the build log html summary page failed"
521 fi
522
523 # And do some cosmetic fixes :)
524 sed -i -e 's|http://www.boost.org/boost.png|boost.png|' *.html || die
525 }
526
527 pkg_postinst() {
528 if use eselect ; then
529 eselect boost update || ewarn "eselect boost update failed."
530 fi
531
532 if [ ! -h "${ROOT}/etc/eselect/boost/active" ] ; then
533 elog "No active boost version found. Calling eselect to select one..."
534 eselect boost update || ewarn "eselect boost update failed."
535 fi
536 }