Gentoo Archives: gentoo-commits

From: "Tiziano Mueller (dev-zero)" <dev-zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/boost: boost-1.37.0-r1.ebuild ChangeLog boost-1.36.0-r1.ebuild boost-1.35.0-r5.ebuild metadata.xml
Date: Tue, 07 Apr 2009 09:43:17
Message-Id: E1Lr7pp-0003VE-Kl@stork.gentoo.org
1 dev-zero 09/04/07 09:43:13
2
3 Modified: ChangeLog metadata.xml
4 Added: boost-1.37.0-r1.ebuild boost-1.36.0-r1.ebuild
5 boost-1.35.0-r5.ebuild
6 Log:
7 Slotting revisited: using profile files now. Solved bugs #259167, #258926.
8 (Portage version: 2.1.6.11/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.153 dev-libs/boost/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.153&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/ChangeLog?rev=1.153&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/ChangeLog?r1=1.152&r2=1.153
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v
20 retrieving revision 1.152
21 retrieving revision 1.153
22 diff -u -r1.152 -r1.153
23 --- ChangeLog 4 Apr 2009 14:25:00 -0000 1.152
24 +++ ChangeLog 7 Apr 2009 09:43:13 -0000 1.153
25 @@ -1,6 +1,15 @@
26 # ChangeLog for dev-libs/boost
27 # Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.152 2009/04/04 14:25:00 armin76 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/ChangeLog,v 1.153 2009/04/07 09:43:13 dev-zero Exp $
30 +
31 +*boost-1.37.0-r1 (07 Apr 2009)
32 +*boost-1.36.0-r1 (07 Apr 2009)
33 +*boost-1.35.0-r5 (07 Apr 2009)
34 +
35 + 07 Apr 2009; Tiziano Müller <dev-zero@g.o>
36 + +files/1.35-remove-hardlink-creation.patch, +files/buildid-fix.patch,
37 + +boost-1.35.0-r5.ebuild, +boost-1.36.0-r1.ebuild, +boost-1.37.0-r1.ebuild:
38 + Slotting revisited: using profile files now. Solved bugs #259167, #258926.
39
40 04 Apr 2009; Raúl Porcel <armin76@g.o> boost-1.35.0-r2.ebuild:
41 alpha/ia64 stable wrt #245192
42
43
44
45 1.8 dev-libs/boost/metadata.xml
46
47 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/metadata.xml?rev=1.8&view=markup
48 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/metadata.xml?rev=1.8&content-type=text/plain
49 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/metadata.xml?r1=1.7&r2=1.8
50
51 Index: metadata.xml
52 ===================================================================
53 RCS file: /var/cvsroot/gentoo-x86/dev-libs/boost/metadata.xml,v
54 retrieving revision 1.7
55 retrieving revision 1.8
56 diff -u -r1.7 -r1.8
57 --- metadata.xml 5 Jan 2009 21:42:04 -0000 1.7
58 +++ metadata.xml 7 Apr 2009 09:43:13 -0000 1.8
59 @@ -18,5 +18,7 @@
60 <flag name='threadsonly'>Only build multithreaded libs</flag>
61 <flag name='tools'>Build and install the boost tools (bcp, quickbook,
62 inspect, wave)</flag>
63 + <flag name='eselect'>Run "eselect boost update" even if version is
64 + already selected</flag>
65 </use>
66 </pkgmetadata>
67
68
69
70 1.1 dev-libs/boost/boost-1.37.0-r1.ebuild
71
72 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/boost-1.37.0-r1.ebuild?rev=1.1&view=markup
73 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/boost-1.37.0-r1.ebuild?rev=1.1&content-type=text/plain
74
75 Index: boost-1.37.0-r1.ebuild
76 ===================================================================
77 # Copyright 1999-2009 Gentoo Foundation
78 # Distributed under the terms of the GNU General Public License v2
79 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.37.0-r1.ebuild,v 1.1 2009/04/07 09:43:13 dev-zero Exp $
80
81 EAPI="2"
82
83 inherit python flag-o-matic multilib toolchain-funcs versionator check-reqs
84
85 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
86
87 MY_P=${PN}_$(replace_all_version_separators _)
88 PATCHSET_VERSION="${PV}-1"
89
90 DESCRIPTION="Boost Libraries for C++"
91 HOMEPAGE="http://www.boost.org/"
92 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2
93 mirror://gentoo/boost-patches-${PATCHSET_VERSION}.tbz2
94 http://www.gentoo.org/~dev-zero/distfiles/boost-patches-${PATCHSET_VERSION}.tbz2"
95 LICENSE="freedist Boost-1.0"
96 SLOT="1.37"
97 IUSE="debug doc eselect expat icu mpi python tools"
98
99 RDEPEND="icu? ( >=dev-libs/icu-3.3 )
100 expat? ( dev-libs/expat )
101 mpi? ( || ( sys-cluster/openmpi sys-cluster/mpich2 ) )
102 sys-libs/zlib
103 python? ( virtual/python )
104 !<=dev-libs/boost-1.35.0-r2
105 >=app-admin/eselect-boost-0.3"
106 DEPEND="${RDEPEND}
107 dev-util/boost-build:${SLOT}"
108
109 S=${WORKDIR}/${MY_P}
110
111 # Maintainer Information
112 # ToDo:
113 # - write a patch to support /dev/urandom on FreeBSD and OSX (see below)
114
115 MAJOR_PV=$(replace_all_version_separators _ ${SLOT})
116 BJAM="bjam-${MAJOR_PV}"
117
118 # Usage:
119 # _add_line <line-to-add> <profile>
120 # ... to add to specific profile
121 # or
122 # _add_line <line-to-add>
123 # ... to add to all profiles for which the use flag set
124
125 _add_line() {
126 if [ -z "$2" ] ; then
127 echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/${SLOT}/default"
128 use debug && echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/${SLOT}/debug"
129 else
130 echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/${SLOT}/${2}"
131 fi
132 }
133
134 pkg_setup() {
135 if has test ${FEATURES} ; then
136 CHECKREQS_DISK_BUILD="1024"
137 check_reqs
138
139 ewarn "The tests may take several hours on a recent machine"
140 ewarn "but they will not fail (unless something weird happens ;-)"
141 ewarn "This is because the tests depend on the used compiler/-version"
142 ewarn "and the platform and upstream says that this is normal."
143 ewarn "If you are interested in the results, please take a look at the"
144 ewarn "generated results page:"
145 ewarn " ${ROOT}usr/share/doc/${PF}/status/cs-$(uname).html"
146 ebeep 5
147
148 fi
149
150 if use debug ; then
151 ewarn "The debug USE-flag means that a second set of the boost libraries"
152 ewarn "will be built containing debug-symbols. You'll be able to select them"
153 ewarn "using the boost-eselect module. But even though the optimization flags"
154 ewarn "you might have set are not stripped, there will be a performance"
155 ewarn "penalty and linking other packages against the debug version"
156 ewarn "of boost is _not_ recommended."
157 fi
158 }
159
160 src_prepare() {
161 EPATCH_SOURCE="${WORKDIR}/patches"
162 EPATCH_SUFFIX="patch"
163 epatch
164
165 epatch \
166 "${FILESDIR}/remove_toolset_from_targetname.patch" \
167 "${FILESDIR}/buildid-fix.patch"
168
169 # This enables building the boost.random library with /dev/urandom support
170 if ! use userland_Darwin ; then
171 mkdir -p libs/random/build
172 cp "${FILESDIR}/random-Jamfile" libs/random/build/Jamfile.v2
173 fi
174 }
175
176 src_configure() {
177 einfo "Writing new user-config.jam"
178
179 local compiler compilerVersion compilerExecutable mpi
180 if [[ ${CHOST} == *-darwin* ]] ; then
181 compiler=darwin
182 compilerVersion=$(gcc-version)
183 compilerExecutable=$(tc-getCXX)
184 append-ldflags -ldl
185 else
186 compiler=gcc
187 compilerVersion=$(gcc-version)
188 compilerExecutable=$(tc-getCXX)
189 fi
190
191 use mpi && mpi="using mpi ;"
192
193 if use python ; then
194 python_version
195 pystring="using python : ${PYVER} : /usr : /usr/include/python${PYVER} : /usr/lib/python${PYVER} ;"
196 fi
197
198 cat > "${S}/user-config.jam" << __EOF__
199
200 variant gentoorelease : release : <optimization>none <debug-symbols>none ;
201 variant gentoodebug : debug : <optimization>none ;
202
203 using ${compiler} : ${compilerVersion} : ${compilerExecutable} : <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
204
205 ${pystring}
206
207 ${mpi}
208
209 __EOF__
210
211 # Maintainer information:
212 # The debug-symbols=none and optimization=none
213 # are not official upstream flags but a Gentoo
214 # specific patch to make sure that all our
215 # CXXFLAGS/LDFLAGS are being respected.
216 # Using optimization=off would for example add
217 # "-O0" and override "-O2" set by the user.
218 # Please take a look at the boost-build ebuild
219 # for more infomration.
220
221 use icu && OPTIONS="-sICU_PATH=/usr"
222 use expat && OPTIONS="${OPTIONS} -sEXPAT_INCLUDE=/usr/include -sEXPAT_LIBPATH=/usr/$(get_libdir)"
223 use mpi || OPTIONS="${OPTIONS} --without-mpi"
224 use python || OPTIONS="${OPTIONS} --without-python"
225
226 OPTIONS="${OPTIONS} --user-config=\"${S}/user-config.jam\" --boost-build=/usr/share/boost-build-${MAJOR_PV} --prefix=\"${D}/usr\" --layout=versioned"
227
228 }
229
230 src_compile() {
231
232 NUMJOBS=$(sed -e 's/.*\(\-j[ 0-9]\+\) .*/\1/; s/--jobs=\?/-j/' <<< ${MAKEOPTS})
233
234 elog "Using the following options to build: "
235 elog " ${OPTIONS}"
236
237 export BOOST_ROOT="${S}"
238
239 ${BJAM} ${NUMJOBS} -q \
240 gentoorelease \
241 ${OPTIONS} \
242 threading=single,multi link=shared,static runtime-link=shared,static \
243 || die "building boost failed"
244
245 # ... and do the whole thing one more time to get the debug libs
246 if use debug ; then
247 ${BJAM} ${NUMJOBS} -q \
248 gentoodebug \
249 ${OPTIONS} \
250 threading=single,multi link=shared,static runtime-link=shared,static \
251 --buildid=debug \
252 || die "building boost failed"
253 fi
254
255 if use tools; then
256 cd "${S}/tools/"
257 ${BJAM} ${NUMJOBS} -q \
258 gentoorelease \
259 ${OPTIONS} \
260 || die "building tools failed"
261 fi
262
263 }
264
265 src_install () {
266 elog "Using the following options to install: "
267 elog " ${OPTIONS}"
268
269 export BOOST_ROOT="${S}"
270
271 ${BJAM} -q \
272 gentoorelease \
273 ${OPTIONS} \
274 threading=single,multi link=shared,static runtime-link=shared,static \
275 --includedir="${D}/usr/include" \
276 --libdir="${D}/usr/$(get_libdir)" \
277 install || die "install failed for options '${OPTIONS}'"
278
279 if use debug ; then
280 ${BJAM} -q \
281 gentoodebug \
282 ${OPTIONS} \
283 threading=single,multi link=shared,static runtime-link=shared,static \
284 --includedir="${D}/usr/include" \
285 --libdir="${D}/usr/$(get_libdir)" \
286 --buildid=debug \
287 install || die "install failed for options '${OPTIONS}'"
288 fi
289
290 use python || rm -rf "${D}/usr/include/boost-${MAJOR_PV}/boost"/python*
291
292 dodir /usr/share/boost-eselect/profiles/${SLOT}
293 touch "${D}/usr/share/boost-eselect/profiles/${SLOT}/default"
294 use debug && touch "${D}/usr/share/boost-eselect/profiles/${SLOT}/debug"
295
296 # Move the mpi.so to the right place and make sure it's slotted
297 if use mpi && use python; then
298 mkdir -p "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}"
299 mv "${D}/usr/$(get_libdir)/mpi.so" "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/"
300 touch "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/__init__.py"
301 _add_line "python=\"/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/mpi.so\""
302 fi
303
304 if use doc ; then
305 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
306 dohtml \
307 -A pdf,txt,cpp,hpp \
308 *.{htm,html,png,css} \
309 -r doc more people wiki
310 dohtml \
311 -A pdf,txt \
312 -r tools
313 insinto /usr/share/doc/${PF}/html
314 doins -r libs
315
316 # To avoid broken links
317 insinto /usr/share/doc/${PF}/html
318 doins LICENSE_1_0.txt
319
320 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
321 fi
322
323 cd "${D}/usr/$(get_libdir)"
324
325 # Remove (unversioned) symlinks
326 # And check for what we remove to catch bugs
327 # got a better idea how to do it? tell me!
328 for f in $(ls -1 *.{a,so} | grep -v "${MAJOR_PV}") ; do
329 if [ ! -h "${f}" ] ; then
330 eerror "Ups, tried to remove '${f}' which is a a real file instead of a symlink"
331 die "slotting/naming of the libs broken!"
332 fi
333 rm "${f}"
334 done
335
336 # The threading libs obviously always gets the "-mt" (multithreading) tag
337 # some packages seem to have a problem with it. Creating symlinks...
338 for lib in libboost_thread-mt-${MAJOR_PV}{,-debug}{.a,.so} ; do
339 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
340 done
341
342 # The same goes for the mpi libs
343 if use mpi ; then
344 for lib in libboost_mpi-mt-${MAJOR_PV}{,-debug}{.a,.so} ; do
345 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
346 done
347 fi
348
349 # Create a subdirectory with completely unversioned symlinks
350 # and store the names in the profiles-file for eselect
351 dodir /usr/$(get_libdir)/boost-${MAJOR_PV}
352
353 _add_line "libs=\"" default
354 for f in $(ls -1 *.{a,so} | grep -v debug) ; do
355 dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}/${f/-${MAJOR_PV}}
356 _add_line "/usr/$(get_libdir)/${f}" default
357 done
358 _add_line "\"" default
359
360 if use debug ; then
361 _add_line "libs=\"" debug
362 dodir /usr/$(get_libdir)/boost-${MAJOR_PV}-debug
363 for f in $(ls -1 *.{a,so} | grep debug) ; do
364 dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}-debug/${f/-${MAJOR_PV}-debug}
365 _add_line "/usr/$(get_libdir)/${f}" debug
366 done
367 _add_line "\"" debug
368
369 _add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" debug
370 _add_line "suffix=\"-debug\"" debug
371 fi
372
373 _add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" default
374
375 if use tools; then
376 cd "${S}/dist/bin"
377 # Append version postfix to binaries for slotting
378 _add_line "bins=\""
379 for b in * ; do
380 newbin "${b}" "${b}-${MAJOR_PV}"
381 _add_line "/usr/bin/${b}-${MAJOR_PV}"
382 done
383 _add_line "\""
384
385 cd "${S}/dist"
386 insinto /usr/share
387 doins -r share/boostbook
388 # Append version postfix for slotting
389 mv "${D}/usr/share/boostbook" "${D}/usr/share/boostbook-${MAJOR_PV}"
390 _add_line "dirs=\"/usr/share/boostbook-${MAJOR_PV}\""
391 fi
392
393 cd "${S}/status"
394 if [ -f regress.log ] ; then
395 docinto status
396 dohtml *.{html,gif} ../boost.png
397 dodoc regress.log
398 fi
399
400 use python && python_need_rebuild
401 }
402
403 src_test() {
404 export BOOST_ROOT=${S}
405
406 cd "${S}/tools/regression/build"
407 ${BJAM} -q \
408 gentoorelease \
409 ${OPTIONS} \
410 process_jam_log compiler_status \
411 || die "building regression test helpers failed"
412
413 cd "${S}/status"
414
415 # Some of the test-checks seem to rely on regexps
416 export LC_ALL="C"
417
418 # The following is largely taken from tools/regression/run_tests.sh,
419 # but adapted to our needs.
420
421 # Run the tests & write them into a file for postprocessing
422 ${BJAM} \
423 ${OPTIONS} \
424 --dump-tests 2>&1 | tee regress.log
425
426 # Postprocessing
427 cat regress.log | "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/process_jam_log" --v2
428 if test $? != 0 ; then
429 die "Postprocessing the build log failed"
430 fi
431
432 cat > "${S}/status/comment.html" <<- __EOF__
433 <p>Tests are run on a <a href="http://www.gentoo.org">Gentoo</a> system.</p>
434 __EOF__
435
436 # Generate the build log html summary page
437 "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/compiler_status" --v2 \
438 --comment "${S}/status/comment.html" "${S}" \
439 cs-$(uname).html cs-$(uname)-links.html
440 if test $? != 0 ; then
441 die "Generating the build log html summary page failed"
442 fi
443
444 # And do some cosmetic fixes :)
445 sed -i -e 's|http://www.boost.org/boost.png|boost.png|' *.html
446 }
447
448 pkg_postinst() {
449 use eselect && eselect boost update
450 if [ ! -h "${ROOT}/etc/eselect/boost/active" ] ; then
451 elog "No active boost version found. Calling eselect to select one..."
452 eselect boost update
453 fi
454 }
455
456
457
458 1.1 dev-libs/boost/boost-1.36.0-r1.ebuild
459
460 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/boost-1.36.0-r1.ebuild?rev=1.1&view=markup
461 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/boost-1.36.0-r1.ebuild?rev=1.1&content-type=text/plain
462
463 Index: boost-1.36.0-r1.ebuild
464 ===================================================================
465 # Copyright 1999-2009 Gentoo Foundation
466 # Distributed under the terms of the GNU General Public License v2
467 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.36.0-r1.ebuild,v 1.1 2009/04/07 09:43:13 dev-zero Exp $
468
469 EAPI="2"
470
471 inherit python flag-o-matic multilib toolchain-funcs versionator check-reqs
472
473 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
474
475 MY_P=${PN}_$(replace_all_version_separators _)
476 PATCHSET_VERSION="${PV}-1"
477
478 DESCRIPTION="Boost Libraries for C++"
479 HOMEPAGE="http://www.boost.org/"
480 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2
481 mirror://gentoo/boost-patches-${PATCHSET_VERSION}.tbz2
482 http://www.gentoo.org/~dev-zero/distfiles/boost-patches-${PATCHSET_VERSION}.tbz2"
483 LICENSE="freedist Boost-1.0"
484 SLOT="1.36"
485 IUSE="doc eselect expat icu mpi python tools"
486
487 RDEPEND="icu? ( >=dev-libs/icu-3.3 )
488 expat? ( dev-libs/expat )
489 mpi? ( || ( sys-cluster/openmpi sys-cluster/mpich2 ) )
490 sys-libs/zlib
491 python? ( virtual/python )
492 !<=dev-libs/boost-1.35.0-r2
493 >=app-admin/eselect-boost-0.3"
494 DEPEND="${RDEPEND}
495 dev-util/boost-build:${SLOT}"
496
497 S=${WORKDIR}/${MY_P}
498
499 # Maintainer Information
500 # ToDo:
501 # - write a patch to support /dev/urandom on FreeBSD and OSX (see below)
502
503 MAJOR_PV=$(replace_all_version_separators _ ${SLOT})
504 BJAM="bjam-${MAJOR_PV}"
505
506 # Usage:
507 # _add_line <line-to-add> <profile>
508 # ... to add to specific profile
509 # or
510 # _add_line <line-to-add>
511 # ... to add to all profiles for which the use flag set
512
513 _add_line() {
514 if [ -z "$2" ] ; then
515 echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/${SLOT}/default"
516 else
517 echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/${SLOT}/${2}"
518 fi
519 }
520
521 pkg_setup() {
522 if has test ${FEATURES} ; then
523 CHECKREQS_DISK_BUILD="1024"
524 check_reqs
525
526 ewarn "The tests may take several hours on a recent machine"
527 ewarn "but they will not fail (unless something weird happens ;-)"
528 ewarn "This is because the tests depend on the used compiler/-version"
529 ewarn "and the platform and upstream says that this is normal."
530 ewarn "If you are interested in the results, please take a look at the"
531 ewarn "generated results page:"
532 ewarn " ${ROOT}usr/share/doc/${PF}/status/cs-$(uname).html"
533 ebeep 5
534
535 fi
536 }
537
538 src_prepare() {
539 EPATCH_SOURCE="${WORKDIR}/patches"
540 EPATCH_SUFFIX="patch"
541 epatch
542
543 epatch \
544 "${FILESDIR}/remove_toolset_from_targetname.patch"
545
546 # This enables building the boost.random library with /dev/urandom support
547 if ! use userland_Darwin ; then
548 mkdir -p libs/random/build
549 cp "${FILESDIR}/random-Jamfile" libs/random/build/Jamfile.v2
550 fi
551 }
552
553 src_configure() {
554 einfo "Writing new user-config.jam"
555
556 local compiler compilerVersion compilerExecutable mpi
557 if [[ ${CHOST} == *-darwin* ]] ; then
558 compiler=darwin
559 compilerVersion=$(gcc-version)
560 compilerExecutable=$(tc-getCXX)
561 append-ldflags -ldl
562 else
563 compiler=gcc
564 compilerVersion=$(gcc-version)
565 compilerExecutable=$(tc-getCXX)
566 fi
567
568 use mpi && mpi="using mpi ;"
569
570 if use python ; then
571 python_version
572 pystring="using python : ${PYVER} : /usr : /usr/include/python${PYVER} : /usr/lib/python${PYVER} ;"
573 fi
574
575 cat > "${S}/user-config.jam" << __EOF__
576
577 variant gentoorelease : release : <optimization>none <debug-symbols>none ;
578 variant gentoodebug : debug : <optimization>none ;
579
580 using ${compiler} : ${compilerVersion} : ${compilerExecutable} : <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
581
582 ${pystring}
583
584 ${mpi}
585
586 __EOF__
587
588 # Maintainer information:
589 # The debug-symbols=none and optimization=none
590 # are not official upstream flags but a Gentoo
591 # specific patch to make sure that all our
592 # CXXFLAGS/LDFLAGS are being respected.
593 # Using optimization=off would for example add
594 # "-O0" and override "-O2" set by the user.
595 # Please take a look at the boost-build ebuild
596 # for more infomration.
597
598 use icu && OPTIONS="-sICU_PATH=/usr"
599 use expat && OPTIONS="${OPTIONS} -sEXPAT_INCLUDE=/usr/include -sEXPAT_LIBPATH=/usr/$(get_libdir)"
600 use mpi || OPTIONS="${OPTIONS} --without-mpi"
601 use python || OPTIONS="${OPTIONS} --without-python"
602
603 OPTIONS="${OPTIONS} --user-config=${S}/user-config.jam --boost-build=/usr/share/boost-build-${MAJOR_PV} --prefix=${D}/usr --layout=versioned"
604
605 }
606
607 src_compile() {
608
609 NUMJOBS=$(sed -e 's/.*\(\-j[ 0-9]\+\) .*/\1/; s/--jobs=\?/-j/' <<< ${MAKEOPTS})
610
611 elog "Using the following options to build: "
612 elog " ${OPTIONS}"
613
614 export BOOST_ROOT="${S}"
615
616 ${BJAM} ${NUMJOBS} -q \
617 gentoorelease \
618 ${OPTIONS} \
619 threading=single,multi link=shared,static runtime-link=shared,static \
620 || die "building boost failed"
621
622 if use tools; then
623 cd "${S}/tools/"
624 ${BJAM} ${NUMJOBS} -q \
625 gentoorelease \
626 ${OPTIONS} \
627 || die "building tools failed"
628 fi
629
630 }
631
632 src_install () {
633 elog "Using the following options to install: "
634 elog " ${OPTIONS}"
635
636 export BOOST_ROOT="${S}"
637
638 ${BJAM} -q \
639 gentoorelease \
640 ${OPTIONS} \
641 threading=single,multi link=shared,static runtime-link=shared,static \
642 --includedir="${D}/usr/include" \
643 --libdir="${D}/usr/$(get_libdir)" \
644 install || die "install failed for options '${OPTIONS}'"
645
646 use python || rm -rf "${D}/usr/include/boost-${MAJOR_PV}/boost"/python*
647
648 dodir /usr/share/boost-eselect/profiles/${SLOT}
649 touch "${D}/usr/share/boost-eselect/profiles/${SLOT}/default"
650
651 # Move the mpi.so to the right place and make sure it's slotted
652 if use mpi && use python; then
653 mkdir -p "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}"
654 mv "${D}/usr/$(get_libdir)/mpi.so" "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/"
655 touch "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/__init__.py"
656 _add_line "python=\"/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/mpi.so\""
657 fi
658
659 if use doc ; then
660 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
661 dohtml \
662 -A pdf,txt,cpp,cpp,hpp \
663 *.{htm,html,png,css} \
664 -r doc more people wiki
665 insinto /usr/share/doc/${PF}/html
666 doins -r libs
667
668 # To avoid broken links
669 insinto /usr/share/doc/${PF}/html
670 doins LICENSE_1_0.txt
671
672 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
673 fi
674
675 cd "${D}/usr/$(get_libdir)"
676
677 # Remove (unversioned) symlinks
678 # And check for what we remove to catch bugs
679 # got a better idea how to do it? tell me!
680 for f in $(ls -1 *.{a,so} | grep -v "${MAJOR_PV}") ; do
681 if [ ! -h "${f}" ] ; then
682 eerror "Ups, tried to remove '${f}' which is a a real file instead of a symlink"
683 die "slotting/naming of the libs broken!"
684 fi
685 rm "${f}"
686 done
687
688 # The threading libs obviously always gets the "-mt" (multithreading) tag
689 # some packages seem to have a problem with it. Creating symlinks...
690 for lib in libboost_thread-mt-${MAJOR_PV}{.a,.so} ; do
691 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
692 done
693
694 # The same goes for the mpi libs
695 if use mpi ; then
696 for lib in libboost_mpi-mt-${MAJOR_PV}{.a,.so} ; do
697 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
698 done
699 fi
700
701 # Create a subdirectory with completely unversioned symlinks
702 # and store the names in the profiles-file for eselect
703 dodir /usr/$(get_libdir)/boost-${MAJOR_PV}
704
705 _add_line "libs=\"" default
706 for f in libboost_*.{a,so} ; do
707 dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}/${f/-${MAJOR_PV}}
708 _add_line "/usr/$(get_libdir)/${f}" default
709 done
710 _add_line "\"" default
711
712 _add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" default
713
714 if use tools; then
715 cd "${S}/dist/bin"
716 # Append version postfix to binaries for slotting
717 _add_line "bins=\""
718 for b in * ; do
719 newbin "${b}" "${b}-${MAJOR_PV}"
720 _add_line "/usr/bin/${b}-${MAJOR_PV}"
721 done
722 _add_line "\""
723
724 cd "${S}/dist"
725 insinto /usr/share
726 doins -r share/boostbook
727 # Append version postfix for slotting
728 mv "${D}/usr/share/boostbook" "${D}/usr/share/boostbook-${MAJOR_PV}"
729 _add_line "dirs=\"/usr/share/boostbook-${MAJOR_PV}\""
730 fi
731
732 cd "${S}/status"
733 if [ -f regress.log ] ; then
734 docinto status
735 dohtml *.{html,gif} ../boost.png
736 dodoc regress.log
737 fi
738
739 use python && python_need_rebuild
740 }
741
742 src_test() {
743 export BOOST_ROOT=${S}
744
745 cd "${S}/tools/regression/build"
746 ${BJAM} -q \
747 gentoorelease \
748 ${OPTIONS} \
749 process_jam_log compiler_status \
750 || die "building regression test helpers failed"
751
752 cd "${S}/status"
753
754 # Some of the test-checks seem to rely on regexps
755 export LC_ALL="C"
756
757 # The following is largely taken from tools/regression/run_tests.sh,
758 # but adapted to our needs.
759
760 # Run the tests & write them into a file for postprocessing
761 ${BJAM} \
762 ${OPTIONS} \
763 --dump-tests 2>&1 | tee regress.log
764
765 # Postprocessing
766 cat regress.log | "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/process_jam_log" --v2
767 if test $? != 0 ; then
768 die "Postprocessing the build log failed"
769 fi
770
771 cat > "${S}/status/comment.html" <<- __EOF__
772 <p>Tests are run on a <a href="http://www.gentoo.org">Gentoo</a> system.</p>
773 __EOF__
774
775 # Generate the build log html summary page
776 "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/compiler_status" --v2 \
777 --comment "${S}/status/comment.html" "${S}" \
778 cs-$(uname).html cs-$(uname)-links.html
779 if test $? != 0 ; then
780 die "Generating the build log html summary page failed"
781 fi
782
783 # And do some cosmetic fixes :)
784 sed -i -e 's|http://www.boost.org/boost.png|boost.png|' *.html
785 }
786
787 pkg_postinst() {
788 use eselect && eselect boost update
789 if [ ! -h "${ROOT}/etc/eselect/boost/active" ] ; then
790 elog "No active boost version found. Calling eselect to select one..."
791 eselect boost update
792 fi
793 }
794
795
796
797 1.1 dev-libs/boost/boost-1.35.0-r5.ebuild
798
799 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/boost-1.35.0-r5.ebuild?rev=1.1&view=markup
800 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-libs/boost/boost-1.35.0-r5.ebuild?rev=1.1&content-type=text/plain
801
802 Index: boost-1.35.0-r5.ebuild
803 ===================================================================
804 # Copyright 1999-2009 Gentoo Foundation
805 # Distributed under the terms of the GNU General Public License v2
806 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.35.0-r5.ebuild,v 1.1 2009/04/07 09:43:13 dev-zero Exp $
807
808 EAPI="2"
809
810 inherit python flag-o-matic multilib toolchain-funcs versionator check-reqs eutils
811
812 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
813
814 MY_P=${PN}_$(replace_all_version_separators _)
815 PATCHSET_VERSION="${PV}-5"
816
817 DESCRIPTION="Boost Libraries for C++"
818 HOMEPAGE="http://www.boost.org/"
819 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2
820 mirror://gentoo/boost-patches-${PATCHSET_VERSION}.tbz2
821 http://www.gentoo.org/~dev-zero/distfiles/boost-patches-${PATCHSET_VERSION}.tbz2"
822 LICENSE="freedist Boost-1.0"
823 SLOT="0"
824 IUSE="doc eselect expat icu mpi python tools"
825
826 RDEPEND="icu? ( >=dev-libs/icu-3.3 )
827 expat? ( dev-libs/expat )
828 mpi? ( || ( sys-cluster/openmpi sys-cluster/mpich2 ) )
829 sys-libs/zlib
830 python? ( virtual/python )
831 >=app-admin/eselect-boost-0.3"
832 DEPEND="${RDEPEND}
833 dev-util/boost-build:${SLOT}"
834
835 S=${WORKDIR}/${MY_P}
836
837 # Maintainer Information
838 # ToDo:
839 # - write a patch to support /dev/urandom on FreeBSD and OSX (see below)
840
841 # manually setting it for this major version
842 MAJOR_PV=1_35
843 BJAM="bjam-${MAJOR_PV}"
844
845 # Usage:
846 # _add_line <line-to-add> <profile>
847 # ... to add to specific profile
848 # or
849 # _add_line <line-to-add>
850 # ... to add to all profiles for which the use flag set
851
852 _add_line() {
853 if [ -z "$2" ] ; then
854 echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/1.35/default"
855 else
856 echo "${1}" >> "${D}/usr/share/boost-eselect/profiles/1.35/${2}"
857 fi
858 }
859
860 pkg_setup() {
861 if has test ${FEATURES} ; then
862 CHECKREQS_DISK_BUILD="1024"
863 check_reqs
864
865 ewarn "The tests may take several hours on a recent machine"
866 ewarn "but they will not fail (unless something weird happens ;-)"
867 ewarn "This is because the tests depend on the used compiler/-version"
868 ewarn "and the platform and upstream says that this is normal."
869 ewarn "If you are interested in the results, please take a look at the"
870 ewarn "generated results page:"
871 ewarn " ${ROOT}usr/share/doc/${PF}/status/cs-$(uname).html"
872 ebeep 5
873
874 fi
875 }
876
877 src_prepare() {
878 EPATCH_SOURCE="${WORKDIR}/patches"
879 EPATCH_SUFFIX="patch"
880 epatch
881
882 epatch \
883 "${FILESDIR}/remove_toolset_from_targetname.patch"
884
885 # This enables building the boost.random library with /dev/urandom support
886 if ! use userland_Darwin ; then
887 mkdir -p libs/random/build
888 cp "${FILESDIR}/random-Jamfile" libs/random/build/Jamfile.v2
889 fi
890
891 epatch "${FILESDIR}/1.35-remove-hardlink-creation.patch"
892 }
893
894 src_configure() {
895 einfo "Writing new user-config.jam"
896
897 local compiler compilerVersion compilerExecutable mpi
898 if [[ ${CHOST} == *-darwin* ]] ; then
899 compiler=darwin
900 compilerVersion=$(gcc-version)
901 compilerExecutable=$(tc-getCXX)
902 append-ldflags -ldl
903 else
904 compiler=gcc
905 compilerVersion=$(gcc-version)
906 compilerExecutable=$(tc-getCXX)
907 fi
908
909 use mpi && mpi="using mpi ;"
910
911 if use python ; then
912 python_version
913 pystring="using python : ${PYVER} : /usr : /usr/include/python${PYVER} : /usr/lib/python${PYVER} ;"
914 fi
915
916 cat > "${S}/user-config.jam" << __EOF__
917
918 variant gentoorelease : release : <optimization>none <debug-symbols>none ;
919 variant gentoodebug : debug : <optimization>none ;
920
921 using ${compiler} : ${compilerVersion} : ${compilerExecutable} : <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
922
923 ${pystring}
924
925 ${mpi}
926
927 __EOF__
928
929 # Maintainer information:
930 # The debug-symbols=none and optimization=none
931 # are not official upstream flags but a Gentoo
932 # specific patch to make sure that all our
933 # CXXFLAGS/LDFLAGS are being respected.
934 # Using optimization=off would for example add
935 # "-O0" and override "-O2" set by the user.
936 # Please take a look at the boost-build ebuild
937 # for more infomration.
938
939 use icu && OPTIONS="-sICU_PATH=/usr"
940 use expat && OPTIONS="${OPTIONS} -sEXPAT_INCLUDE=/usr/include -sEXPAT_LIBPATH=/usr/$(get_libdir)"
941 use mpi || OPTIONS="${OPTIONS} --without-mpi"
942 use python || OPTIONS="${OPTIONS} --without-python"
943
944 OPTIONS="${OPTIONS} --user-config=${S}/user-config.jam --boost-build=/usr/share/boost-build-${MAJOR_PV} --prefix=${D}/usr --layout=versioned"
945
946 }
947
948 src_compile() {
949
950 NUMJOBS=$(sed -e 's/.*\(\-j[ 0-9]\+\) .*/\1/; s/--jobs=\?/-j/' <<< ${MAKEOPTS})
951
952 elog "Using the following options to build: "
953 elog " ${OPTIONS}"
954
955 export BOOST_ROOT="${S}"
956
957 ${BJAM} ${NUMJOBS} -q \
958 gentoorelease \
959 ${OPTIONS} \
960 threading=single,multi link=shared,static runtime-link=shared,static \
961 || die "building boost failed"
962
963 if use tools; then
964 cd "${S}/tools/"
965 ${BJAM} ${NUMJOBS} -q \
966 gentoorelease \
967 ${OPTIONS} \
968 || die "building tools failed"
969 fi
970
971 }
972
973 src_install () {
974 elog "Using the following options to install: "
975 elog " ${OPTIONS}"
976
977 export BOOST_ROOT="${S}"
978
979 ${BJAM} -q \
980 gentoorelease \
981 ${OPTIONS} \
982 threading=single,multi link=shared,static runtime-link=shared,static \
983 --includedir="${D}/usr/include" \
984 --libdir="${D}/usr/$(get_libdir)" \
985 install || die "install failed for options '${OPTIONS}'"
986
987 use python || rm -rf "${D}/usr/include/boost-${MAJOR_PV}/boost"/python*
988
989 dodir /usr/share/boost-eselect/profiles/1.35
990 touch "${D}/usr/share/boost-eselect/profiles/1.35/default"
991
992 # Move the mpi.so to the right place and make sure it's slotted
993 if use mpi && use python; then
994 mkdir -p "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}"
995 mv "${D}/usr/$(get_libdir)/mpi.so" "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/"
996 touch "${D}/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/__init__.py"
997 _add_line "python=\"/usr/$(get_libdir)/python${PYVER}/site-packages/boost_${MAJOR_PV}/mpi.so\""
998 fi
999
1000 if use doc ; then
1001 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
1002 dohtml \
1003 -A pdf,txt,cpp,cpp,hpp \
1004 *.{htm,html,png,css} \
1005 -r doc more people wiki
1006 insinto /usr/share/doc/${PF}/html
1007 doins -r libs
1008
1009 # To avoid broken links
1010 insinto /usr/share/doc/${PF}/html
1011 doins LICENSE_1_0.txt
1012
1013 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
1014 fi
1015
1016 cd "${D}/usr/$(get_libdir)"
1017
1018 # Remove (unversioned) symlinks
1019 # And check for what we remove to catch bugs
1020 # got a better idea how to do it? tell me!
1021 for f in $(ls -1 *.{a,so} | grep -v "${MAJOR_PV}") ; do
1022 if [ ! -h "${f}" ] ; then
1023 eerror "Ups, tried to remove '${f}' which is a a real file instead of a symlink"
1024 die "slotting/naming of the libs broken!"
1025 fi
1026 rm "${f}"
1027 done
1028
1029 # The threading libs obviously always gets the "-mt" (multithreading) tag
1030 # some packages seem to have a problem with it. Creating symlinks...
1031 for lib in libboost_thread-mt-${MAJOR_PV}{.a,.so} ; do
1032 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
1033 done
1034
1035 # The same goes for the mpi libs
1036 if use mpi ; then
1037 for lib in libboost_mpi-mt-${MAJOR_PV}{.a,.so} ; do
1038 dosym ${lib} "/usr/$(get_libdir)/$(sed -e 's/-mt//' <<< ${lib})"
1039 done
1040 fi
1041
1042 # Create a subdirectory with completely unversioned symlinks
1043 # and store the names in the profiles-file for eselect
1044 dodir /usr/$(get_libdir)/boost-${MAJOR_PV}
1045
1046 _add_line "libs=\"" default
1047 for f in libboost_*.{a,so} ; do
1048 dosym ../${f} /usr/$(get_libdir)/boost-${MAJOR_PV}/${f/-${MAJOR_PV}}
1049 _add_line "/usr/$(get_libdir)/${f}" default
1050 done
1051 _add_line "\"" default
1052
1053 _add_line "includes=\"/usr/include/boost-${MAJOR_PV}/boost\"" default
1054
1055 if use tools; then
1056 cd "${S}/dist/bin"
1057 # Append version postfix to binaries for slotting
1058 _add_line "bins=\""
1059 for b in * ; do
1060 newbin "${b}" "${b}-${MAJOR_PV}"
1061 _add_line "/usr/bin/${b}-${MAJOR_PV}"
1062 done
1063 _add_line "\""
1064
1065 cd "${S}/dist"
1066 insinto /usr/share
1067 doins -r share/boostbook
1068 # Append version postfix for slotting
1069 mv "${D}/usr/share/boostbook" "${D}/usr/share/boostbook-${MAJOR_PV}"
1070 _add_line "dirs=\"/usr/share/boostbook-${MAJOR_PV}\""
1071 fi
1072
1073 cd "${S}/status"
1074 if [ -f regress.log ] ; then
1075 docinto status
1076 dohtml *.{html,gif} ../boost.png
1077 dodoc regress.log
1078 fi
1079
1080 use python && python_need_rebuild
1081 }
1082
1083 src_test() {
1084 export BOOST_ROOT=${S}
1085
1086 cd "${S}/tools/regression/build"
1087 ${BJAM} -q \
1088 gentoorelease \
1089 ${OPTIONS} \
1090 process_jam_log compiler_status \
1091 || die "building regression test helpers failed"
1092
1093 cd "${S}/status"
1094
1095 # Some of the test-checks seem to rely on regexps
1096 export LC_ALL="C"
1097
1098 # The following is largely taken from tools/regression/run_tests.sh,
1099 # but adapted to our needs.
1100
1101 # Run the tests & write them into a file for postprocessing
1102 ${BJAM} \
1103 ${OPTIONS} \
1104 --dump-tests 2>&1 | tee regress.log
1105
1106 # Postprocessing
1107 cat regress.log | "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/process_jam_log" --v2
1108 if test $? != 0 ; then
1109 die "Postprocessing the build log failed"
1110 fi
1111
1112 cat > "${S}/status/comment.html" <<- __EOF__
1113 <p>Tests are run on a <a href="http://www.gentoo.org">Gentoo</a> system.</p>
1114 __EOF__
1115
1116 # Generate the build log html summary page
1117 "${S}/tools/regression/build/bin/gcc-$(gcc-version)/gentoorelease/compiler_status" --v2 \
1118 --comment "${S}/status/comment.html" "${S}" \
1119 cs-$(uname).html cs-$(uname)-links.html
1120 if test $? != 0 ; then
1121 die "Generating the build log html summary page failed"
1122 fi
1123
1124 # And do some cosmetic fixes :)
1125 sed -i -e 's|../boost.png|boost.png|' *.html
1126 }
1127
1128 pkg_postinst() {
1129 use eselect && eselect boost update
1130 if [ ! -h "${ROOT}/etc/eselect/boost/active" ] ; then
1131 elog "No active boost version found. Calling eselect to select one..."
1132 eselect boost update
1133 fi
1134 }