Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/boost: boost-1.49.0-r2.ebuild ChangeLog boost-1.49.0-r1.ebuild
Date: Wed, 31 Oct 2012 21:36:48
Message-Id: 20121031213631.E06C521600@flycatcher.gentoo.org
1 flameeyes 12/10/31 21:36:31
2
3 Modified: ChangeLog
4 Added: boost-1.49.0-r2.ebuild
5 Removed: boost-1.49.0-r1.ebuild
6 Log:
7 Force a rebuild for everybodu and get rid of eselect boost altogether. This is unfortunate but eselect boost behaves differently depending on whether boost was already installed or if it's a fresh install.
8
9 (Portage version: 2.2.0_alpha142/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 1CD13C8AD4301342)
10
11 Revision Changes Path
12 1.271 dev-libs/boost/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.271&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.271&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/ChangeLog?r1=1.270&r2=1.271
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v
21 retrieving revision 1.270
22 retrieving revision 1.271
23 diff -u -r1.270 -r1.271
24 --- ChangeLog 31 Oct 2012 18:27:00 -0000 1.270
25 +++ ChangeLog 31 Oct 2012 21:36:31 -0000 1.271
26 @@ -1,6 +1,14 @@
27 # ChangeLog for dev-libs/boost
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.270 2012/10/31 18:27:00 flameeyes Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.271 2012/10/31 21:36:31 flameeyes Exp $
31 +
32 +*boost-1.49.0-r2 (31 Oct 2012)
33 +
34 + 31 Oct 2012; Diego E. Pettenò <flameeyes@g.o> +boost-1.49.0-r2.ebuild,
35 + -boost-1.49.0-r1.ebuild:
36 + Force a rebuild for everybodu and get rid of eselect boost altogether. This is
37 + unfortunate but eselect boost behaves differently depending on whether boost
38 + was already installed or if it's a fresh install.
39
40 31 Oct 2012; Diego E. Pettenò <flameeyes@g.o> boost-1.49.0-r1.ebuild:
41 Remove test support from 1.49 as well, since it's not supposed to work and the
42
43
44
45 1.1 dev-libs/boost/boost-1.49.0-r2.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/boost-1.49.0-r2.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/boost/boost-1.49.0-r2.ebuild?rev=1.1&content-type=text/plain
49
50 Index: boost-1.49.0-r2.ebuild
51 ===================================================================
52 # Copyright 1999-2012 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.49.0-r2.ebuild,v 1.1 2012/10/31 21:36:31 flameeyes Exp $
55
56 EAPI="4"
57 PYTHON_DEPEND="python? *"
58 SUPPORT_PYTHON_ABIS="1"
59 RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
60
61 inherit flag-o-matic multilib python toolchain-funcs versionator
62
63 MY_P=${PN}_$(replace_all_version_separators _)
64
65 DESCRIPTION="Boost Libraries for C++"
66 HOMEPAGE="http://www.boost.org/"
67 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2"
68
69 LICENSE="Boost-1.0"
70 SLOT=0
71 MAJOR_V="$(get_version_component_range 1-2)"
72 KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd"
73 IUSE="debug doc icu mpi python static-libs tools"
74
75 RDEPEND="icu? ( >=dev-libs/icu-3.3 )
76 mpi? ( || ( sys-cluster/openmpi[cxx] sys-cluster/mpich2[cxx,threads] ) )
77 sys-libs/zlib
78 !app-admin/eselect-boost"
79 DEPEND="${RDEPEND}
80 =dev-util/boost-build-${MAJOR_V}*"
81
82 S=${WORKDIR}/${MY_P}
83
84 MAJOR_PV=$(replace_all_version_separators _ ${MAJOR_V})
85 BJAM="b2-${MAJOR_PV}"
86
87 create_user-config.jam() {
88 local compiler compiler_version compiler_executable
89
90 if [[ ${CHOST} == *-darwin* ]]; then
91 compiler="darwin"
92 compiler_version="$(gcc-fullversion)"
93 compiler_executable="$(tc-getCXX)"
94 else
95 compiler="gcc"
96 compiler_version="$(gcc-version)"
97 compiler_executable="$(tc-getCXX)"
98 fi
99 local mpi_configuration python_configuration
100
101 if use mpi; then
102 mpi_configuration="using mpi ;"
103 fi
104
105 if use python; then
106 python_configuration="using python : $(python_get_version) : /usr : $(python_get_includedir) : /usr/$(get_libdir) ;"
107 fi
108
109 # The debug-symbols=none and optimization=none are not official upstream flags but a Gentoo
110 # specific patch to make sure that all our CFLAGS/CXXFLAGS/LDFLAGS are being respected.
111 # Using optimization=off would for example add "-O0" and override "-O2" set by the user.
112 # Please take a look at the boost-build ebuild for more information.
113 cat > user-config.jam << __EOF__
114 variant gentoorelease : release : <optimization>none <debug-symbols>none ;
115 variant gentoodebug : debug : <optimization>none ;
116
117 using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
118 ${mpi_configuration}
119 ${python_configuration}
120 __EOF__
121 }
122
123 pkg_setup() {
124 if use python; then
125 python_pkg_setup
126 fi
127 }
128
129 src_prepare() {
130 epatch "${FILESDIR}/${PN}-1.48.0-mpi_python3.patch"
131 epatch "${FILESDIR}/${PN}-1.48.0-respect_python-buildid.patch"
132 epatch "${FILESDIR}/${PN}-1.48.0-support_dots_in_python-buildid.patch"
133 epatch "${FILESDIR}/${PN}-1.48.0-no_strict_aliasing_python2.patch"
134 epatch "${FILESDIR}/${PN}-1.48.0-disable_libboost_python3.patch"
135 epatch "${FILESDIR}/${PN}-1.48.0-python_linking.patch"
136 epatch "${FILESDIR}/${PN}-1.48.0-disable_icu_rpath.patch"
137 epatch "${FILESDIR}/remove-toolset-1.48.0.patch"
138 }
139
140 src_configure() {
141 OPTIONS=""
142
143 if [[ ${CHOST} == *-darwin* ]]; then
144 # We need to add the prefix, and in two cases this exceeds, so prepare
145 # for the largest possible space allocation.
146 append-ldflags -Wl,-headerpad_max_install_names
147 fi
148
149 # bug 298489
150 if use ppc || use ppc64; then
151 [[ $(gcc-version) > 4.3 ]] && append-flags -mno-altivec
152 fi
153
154 use icu && OPTIONS+=" -sICU_PATH=/usr"
155 use icu || OPTIONS+=" --disable-icu boost.locale.icu=off"
156 use mpi || OPTIONS+=" --without-mpi"
157 use python || OPTIONS+=" --without-python"
158
159 # https://svn.boost.org/trac/boost/attachment/ticket/2597/add-disable-long-double.patch
160 if use sparc || { use mips && [[ ${ABI} = "o32" ]]; } || use hppa || use arm || use x86-fbsd || use sh; then
161 OPTIONS+=" --disable-long-double"
162 fi
163
164 OPTIONS+=" pch=off --boost-build=/usr/share/boost-build-${MAJOR_PV} --prefix=\"${D}usr\" --layout=versioned"
165
166 if use static-libs; then
167 LINK_OPTS="link=shared,static"
168 LIBRARY_TARGETS="*.a *$(get_libname)"
169 else
170 LINK_OPTS="link=shared"
171 # There is no dynamically linked version of libboost_test_exec_monitor and libboost_exception.
172 LIBRARY_TARGETS="libboost_test_exec_monitor*.a libboost_exception*.a *$(get_libname)"
173 fi
174 }
175
176 src_compile() {
177 local jobs
178 jobs=$( echo " ${MAKEOPTS} " | \
179 sed -e 's/ --jobs[= ]/ -j /g' \
180 -e 's/ -j \([1-9][0-9]*\)/ -j\1/g' \
181 -e 's/ -j\>/ -j1/g' | \
182 ( while read -d ' ' j; do if [[ "${j#-j}" = "$j" ]]; then continue; fi; jobs="${j#-j}"; done; echo ${jobs} ) )
183 if [[ "${jobs}" != "" ]]; then NUMJOBS="-j"${jobs}; fi
184
185 export BOOST_ROOT="${S}"
186 PYTHON_DIRS=""
187 MPI_PYTHON_MODULE=""
188
189 building() {
190 create_user-config.jam
191
192 einfo "Using the following command to build:"
193 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})"
194
195 ${BJAM} ${NUMJOBS} -q -d+2 \
196 gentoorelease \
197 --user-config=user-config.jam \
198 ${OPTIONS} \
199 threading=single,multi ${LINK_OPTS} runtime-link=shared \
200 $(use python && echo --python-buildid=${PYTHON_ABI}) \
201 || die "Building of Boost libraries failed"
202
203 # ... and do the whole thing one more time to get the debug libs
204 if use debug; then
205 einfo "Using the following command to build:"
206 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})"
207
208 ${BJAM} ${NUMJOBS} -q -d+2 \
209 gentoodebug \
210 --user-config=user-config.jam \
211 ${OPTIONS} \
212 threading=single,multi ${LINK_OPTS} runtime-link=shared \
213 --buildid=debug \
214 $(use python && echo --python-buildid=${PYTHON_ABI}) \
215 || die "Building of Boost debug libraries failed"
216 fi
217
218 if use python; then
219 if [[ -z "${PYTHON_DIRS}" ]]; then
220 PYTHON_DIRS="$(find bin.v2/libs -name python | sort)"
221 else
222 if [[ "${PYTHON_DIRS}" != "$(find bin.v2/libs -name python | sort)" ]]; then
223 die "Inconsistent structure of build directories"
224 fi
225 fi
226
227 local dir
228 for dir in ${PYTHON_DIRS}; do
229 mv ${dir} ${dir}-${PYTHON_ABI} || die "Renaming of '${dir}' to '${dir}-${PYTHON_ABI}' failed"
230 done
231
232 if use mpi; then
233 if [[ -z "${MPI_PYTHON_MODULE}" ]]; then
234 MPI_PYTHON_MODULE="$(find bin.v2/libs/mpi/build/*/gentoorelease -name mpi.so)"
235 if [[ "$(echo "${MPI_PYTHON_MODULE}" | wc -l)" -ne 1 ]]; then
236 die "Multiple mpi.so files found"
237 fi
238 else
239 if [[ "${MPI_PYTHON_MODULE}" != "$(find bin.v2/libs/mpi/build/*/gentoorelease -name mpi.so)" ]]; then
240 die "Inconsistent structure of build directories"
241 fi
242 fi
243
244 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"
245 fi
246 fi
247 }
248 if use python; then
249 python_execute_function building
250 else
251 building
252 fi
253
254 if use tools; then
255 pushd tools > /dev/null || die
256 einfo "Using the following command to build the tools:"
257 einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoorelease --user-config=../user-config.jam ${OPTIONS}"
258
259 ${BJAM} ${NUMJOBS} -q -d+2\
260 gentoorelease \
261 --user-config=../user-config.jam \
262 ${OPTIONS} \
263 || die "Building of Boost tools failed"
264 popd > /dev/null || die
265 fi
266 }
267
268 src_install () {
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 fi
334 fi
335 }
336 if use python; then
337 python_execute_function installation
338 else
339 installation
340 fi
341
342 use python || rm -rf "${D}usr/include/boost-${MAJOR_PV}/boost"/python* || die
343
344 if use doc; then
345 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
346 dohtml \
347 -A pdf,txt,cpp,hpp \
348 *.{htm,html,png,css} \
349 -r doc
350 dohtml \
351 -A pdf,txt \
352 -r tools
353 insinto /usr/share/doc/${PF}/html
354 doins -r libs
355 doins -r more
356
357 # To avoid broken links
358 insinto /usr/share/doc/${PF}/html
359 doins LICENSE_1_0.txt
360
361 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
362 fi
363
364 dosym boost-${MAJOR_PV}/boost /usr/include/boost
365
366 pushd "${D}usr/$(get_libdir)" > /dev/null || die
367
368 # The threading libs obviously always gets the "-mt" (multithreading) tag
369 # some packages seem to have a problem with it. Creating symlinks...
370
371 if use static-libs; then
372 THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}.a libboost_thread-mt-${MAJOR_PV}$(get_libname)"
373 else
374 THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}$(get_libname)"
375 fi
376 local lib
377 for lib in ${THREAD_LIBS}; do
378 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
379 done
380
381 # The same goes for the mpi libs
382 if use mpi; then
383 if use static-libs; then
384 MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}.a libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
385 else
386 MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
387 fi
388 local lib
389 for lib in ${MPI_LIBS}; do
390 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
391 done
392 fi
393
394 if use debug; then
395 if use static-libs; then
396 THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname) libboost_thread-mt-${MAJOR_PV}-debug.a"
397 else
398 THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname)"
399 fi
400
401 local lib
402 for lib in ${THREAD_DEBUG_LIBS}; do
403 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
404 done
405
406 if use mpi; then
407 if use static-libs; then
408 MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug.a libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
409 else
410 MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
411 fi
412
413 local lib
414 for lib in ${MPI_DEBUG_LIBS}; do
415 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
416 done
417 fi
418 fi
419
420 local f
421 for f in $(ls -1 ${LIBRARY_TARGETS} | grep -v debug); do
422 dosym ${f} /usr/$(get_libdir)/${f/-${MAJOR_PV}}
423 done
424
425 if use debug; then
426 dodir /usr/$(get_libdir)/boost-debug
427 local f
428 for f in $(ls -1 ${LIBRARY_TARGETS} | grep debug); do
429 dosym ../${f} /usr/$(get_libdir)/boost-debug/${f/-${MAJOR_PV}-debug}
430 done
431 fi
432
433 popd > /dev/null || die
434
435 if use tools; then
436 pushd dist/bin > /dev/null || die
437 # Append version postfix to binaries for slotting
438 local b
439 for b in *; do
440 newbin "${b}" "${b}-${MAJOR_PV}"
441 done
442 popd > /dev/null || die
443
444 pushd dist > /dev/null || die
445 insinto /usr/share
446 doins -r share/boostbook
447 # Append version postfix for slotting
448 mv "${D}usr/share/boostbook" "${D}usr/share/boostbook-${MAJOR_PV}" || die
449 popd > /dev/null || die
450 fi
451
452 pushd status > /dev/null || die
453 if [[ -f regress.log ]]; then
454 docinto status
455 dohtml *.html ../boost.png
456 dodoc regress.log
457 fi
458 popd > /dev/null || die
459
460 # boost's build system truely sucks for not having a destdir. Because for
461 # this reason we are forced to build with a prefix that includes the
462 # DESTROOT, dynamic libraries on Darwin end messed up, referencing the
463 # DESTROOT instread of the actual EPREFIX. There is no way out of here
464 # but to do it the dirty way of manually setting the right install_names.
465 if [[ ${CHOST} == *-darwin* ]]; then
466 einfo "Working around completely broken build-system(tm)"
467 local d
468 for d in "${ED}"usr/lib/*.dylib; do
469 if [[ -f ${d} ]]; then
470 # fix the "soname"
471 ebegin " correcting install_name of ${d#${ED}}"
472 install_name_tool -id "/${d#${D}}" "${d}"
473 eend $?
474 # fix references to other libs
475 refs=$(otool -XL "${d}" | \
476 sed -e '1d' -e 's/^\t//' | \
477 grep "^libboost_" | \
478 cut -f1 -d' ')
479 local r
480 for r in ${refs}; do
481 ebegin " correcting reference to ${r}"
482 install_name_tool -change \
483 "${r}" \
484 "${EPREFIX}/usr/lib/${r}" \
485 "${d}"
486 eend $?
487 done
488 fi
489 done
490 fi
491 }
492
493 # the tests will never fail because these are not intended as sanity
494 # tests at all. They are more a way for upstream to check their own code
495 # on new compilers. Since they would either be completely unreliable
496 # (failing for no good reason) or completely useless (never failing)
497 # there is no point in having them in the ebuild to begin with.
498 src_test() { :; }