/[gentoo-x86]/dev-libs/boost/boost-1.49.0-r2.ebuild
Gentoo

Contents of /dev-libs/boost/boost-1.49.0-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Tue Apr 15 15:47:51 2014 UTC (6 years, 3 months ago) by pinkbyte
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Drop old vulnerable version

(Portage version: 2.2.9-r1/cvs/Linux x86_64, signed Manifest commit with key 0x1F357D42)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.49.0-r2.ebuild,v 1.7 2013/07/10 11:54:02 pinkbyte Exp $
4
5 EAPI="4"
6 PYTHON_DEPEND="python? *"
7 SUPPORT_PYTHON_ABIS="1"
8 RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
9
10 inherit flag-o-matic multilib python toolchain-funcs versionator
11
12 MY_P=${PN}_$(replace_all_version_separators _)
13
14 DESCRIPTION="Boost Libraries for C++"
15 HOMEPAGE="http://www.boost.org/"
16 SRC_URI="mirror://sourceforge/boost/${MY_P}.tar.bz2"
17
18 LICENSE="Boost-1.0"
19 SLOT=0
20 MAJOR_V="$(get_version_component_range 1-2)"
21 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
22 IUSE="debug doc icu mpi python static-libs tools"
23
24 RDEPEND="icu? ( >=dev-libs/icu-3.3 )
25 mpi? ( || ( sys-cluster/openmpi[cxx] sys-cluster/mpich2[cxx,threads] ) )
26 app-arch/bzip2
27 sys-libs/zlib
28 !app-admin/eselect-boost
29 elibc_glibc? ( <sys-libs/glibc-2.16 )"
30 DEPEND="${RDEPEND}
31 =dev-util/boost-build-${MAJOR_V}*"
32
33 S=${WORKDIR}/${MY_P}
34
35 MAJOR_PV=$(replace_all_version_separators _ ${MAJOR_V})
36 BJAM="b2-${MAJOR_PV}"
37
38 create_user-config.jam() {
39 local compiler compiler_version compiler_executable
40
41 if [[ ${CHOST} == *-darwin* ]]; then
42 compiler="darwin"
43 compiler_version="$(gcc-fullversion)"
44 compiler_executable="$(tc-getCXX)"
45 else
46 compiler="gcc"
47 compiler_version="$(gcc-version)"
48 compiler_executable="$(tc-getCXX)"
49 fi
50 local mpi_configuration python_configuration
51
52 if use mpi; then
53 mpi_configuration="using mpi ;"
54 fi
55
56 if use python; then
57 python_configuration="using python : $(python_get_version) : /usr : $(python_get_includedir) : /usr/$(get_libdir) ;"
58 fi
59
60 # The debug-symbols=none and optimization=none are not official upstream flags but a Gentoo
61 # specific patch to make sure that all our CFLAGS/CXXFLAGS/LDFLAGS are being respected.
62 # Using optimization=off would for example add "-O0" and override "-O2" set by the user.
63 # Please take a look at the boost-build ebuild for more information.
64 cat > user-config.jam << __EOF__
65 variant gentoorelease : release : <optimization>none <debug-symbols>none ;
66 variant gentoodebug : debug : <optimization>none ;
67
68 using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
69 ${mpi_configuration}
70 ${python_configuration}
71 __EOF__
72 }
73
74 pkg_setup() {
75 if use python; then
76 python_pkg_setup
77 fi
78 }
79
80 src_prepare() {
81 epatch "${FILESDIR}/${PN}-1.48.0-mpi_python3.patch"
82 epatch "${FILESDIR}/${PN}-1.48.0-respect_python-buildid.patch"
83 epatch "${FILESDIR}/${PN}-1.48.0-support_dots_in_python-buildid.patch"
84 epatch "${FILESDIR}/${PN}-1.48.0-no_strict_aliasing_python2.patch"
85 epatch "${FILESDIR}/${PN}-1.48.0-disable_libboost_python3.patch"
86 epatch "${FILESDIR}/${PN}-1.48.0-python_linking.patch"
87 epatch "${FILESDIR}/${PN}-1.48.0-disable_icu_rpath.patch"
88 epatch "${FILESDIR}/remove-toolset-1.48.0.patch"
89 }
90
91 src_configure() {
92 OPTIONS=""
93
94 if [[ ${CHOST} == *-darwin* ]]; then
95 # We need to add the prefix, and in two cases this exceeds, so prepare
96 # for the largest possible space allocation.
97 append-ldflags -Wl,-headerpad_max_install_names
98 fi
99
100 # bug 298489
101 if use ppc || use ppc64; then
102 [[ $(gcc-version) > 4.3 ]] && append-flags -mno-altivec
103 fi
104
105 use icu && OPTIONS+=" -sICU_PATH=/usr"
106 use icu || OPTIONS+=" --disable-icu boost.locale.icu=off"
107 use mpi || OPTIONS+=" --without-mpi"
108 use python || OPTIONS+=" --without-python"
109
110 # https://svn.boost.org/trac/boost/attachment/ticket/2597/add-disable-long-double.patch
111 if use sparc || { use mips && [[ ${ABI} = "o32" ]]; } || use hppa || use arm || use x86-fbsd || use sh; then
112 OPTIONS+=" --disable-long-double"
113 fi
114
115 OPTIONS+=" pch=off --boost-build=/usr/share/boost-build-${MAJOR_PV} --prefix=\"${D}usr\" --layout=versioned"
116
117 if use static-libs; then
118 LINK_OPTS="link=shared,static"
119 LIBRARY_TARGETS="*.a *$(get_libname)"
120 else
121 LINK_OPTS="link=shared"
122 # There is no dynamically linked version of libboost_test_exec_monitor and libboost_exception.
123 LIBRARY_TARGETS="libboost_test_exec_monitor*.a libboost_exception*.a *$(get_libname)"
124 fi
125 }
126
127 src_compile() {
128 local jobs
129 jobs=$( echo " ${MAKEOPTS} " | \
130 sed -e 's/ --jobs[= ]/ -j /g' \
131 -e 's/ -j \([1-9][0-9]*\)/ -j\1/g' \
132 -e 's/ -j\>/ -j1/g' | \
133 ( while read -d ' ' j; do if [[ "${j#-j}" = "$j" ]]; then continue; fi; jobs="${j#-j}"; done; echo ${jobs} ) )
134 if [[ "${jobs}" != "" ]]; then NUMJOBS="-j"${jobs}; fi
135
136 export BOOST_ROOT="${S}"
137 PYTHON_DIRS=""
138 MPI_PYTHON_MODULE=""
139
140 building() {
141 create_user-config.jam
142
143 einfo "Using the following command to build:"
144 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})"
145
146 ${BJAM} ${NUMJOBS} -q -d+2 \
147 gentoorelease \
148 --user-config=user-config.jam \
149 ${OPTIONS} \
150 threading=single,multi ${LINK_OPTS} runtime-link=shared \
151 $(use python && echo --python-buildid=${PYTHON_ABI}) \
152 || die "Building of Boost libraries failed"
153
154 # ... and do the whole thing one more time to get the debug libs
155 if use debug; then
156 einfo "Using the following command to build:"
157 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})"
158
159 ${BJAM} ${NUMJOBS} -q -d+2 \
160 gentoodebug \
161 --user-config=user-config.jam \
162 ${OPTIONS} \
163 threading=single,multi ${LINK_OPTS} runtime-link=shared \
164 --buildid=debug \
165 $(use python && echo --python-buildid=${PYTHON_ABI}) \
166 || die "Building of Boost debug libraries failed"
167 fi
168
169 if use python; then
170 if [[ -z "${PYTHON_DIRS}" ]]; then
171 PYTHON_DIRS="$(find bin.v2/libs -name python | sort)"
172 else
173 if [[ "${PYTHON_DIRS}" != "$(find bin.v2/libs -name python | sort)" ]]; then
174 die "Inconsistent structure of build directories"
175 fi
176 fi
177
178 local dir
179 for dir in ${PYTHON_DIRS}; do
180 mv ${dir} ${dir}-${PYTHON_ABI} || die "Renaming of '${dir}' to '${dir}-${PYTHON_ABI}' failed"
181 done
182
183 if use mpi; then
184 if [[ -z "${MPI_PYTHON_MODULE}" ]]; then
185 MPI_PYTHON_MODULE="$(find bin.v2/libs/mpi/build/*/gentoorelease -name mpi.so)"
186 if [[ "$(echo "${MPI_PYTHON_MODULE}" | wc -l)" -ne 1 ]]; then
187 die "Multiple mpi.so files found"
188 fi
189 else
190 if [[ "${MPI_PYTHON_MODULE}" != "$(find bin.v2/libs/mpi/build/*/gentoorelease -name mpi.so)" ]]; then
191 die "Inconsistent structure of build directories"
192 fi
193 fi
194
195 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"
196 fi
197 fi
198 }
199 if use python; then
200 python_execute_function building
201 else
202 building
203 fi
204
205 if use tools; then
206 pushd tools > /dev/null || die
207 einfo "Using the following command to build the tools:"
208 einfo "${BJAM} ${NUMJOBS} -q -d+2 gentoorelease --user-config=../user-config.jam ${OPTIONS}"
209
210 ${BJAM} ${NUMJOBS} -q -d+2\
211 gentoorelease \
212 --user-config=../user-config.jam \
213 ${OPTIONS} \
214 || die "Building of Boost tools failed"
215 popd > /dev/null || die
216 fi
217 }
218
219 src_install () {
220 installation() {
221 create_user-config.jam
222
223 if use python; then
224 local dir
225 for dir in ${PYTHON_DIRS}; do
226 cp -pr ${dir}-${PYTHON_ABI} ${dir} || die "Copying of '${dir}-${PYTHON_ABI}' to '${dir}' failed"
227 done
228
229 if use mpi; then
230 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"
231 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"
232 fi
233 fi
234
235 einfo "Using the following command to install:"
236 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"
237
238 ${BJAM} -q -d+2 \
239 gentoorelease \
240 --user-config=user-config.jam \
241 ${OPTIONS} \
242 threading=single,multi ${LINK_OPTS} runtime-link=shared \
243 --includedir="${D}usr/include" \
244 --libdir="${D}usr/$(get_libdir)" \
245 $(use python && echo --python-buildid=${PYTHON_ABI}) \
246 install || die "Installation of Boost libraries failed"
247
248 if use debug; then
249 einfo "Using the following command to install:"
250 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})"
251
252 ${BJAM} -q -d+2 \
253 gentoodebug \
254 --user-config=user-config.jam \
255 ${OPTIONS} \
256 threading=single,multi ${LINK_OPTS} runtime-link=shared \
257 --includedir="${D}usr/include" \
258 --libdir="${D}usr/$(get_libdir)" \
259 --buildid=debug \
260 $(use python && echo --python-buildid=${PYTHON_ABI}) \
261 install || die "Installation of Boost debug libraries failed"
262 fi
263
264 if use python; then
265 rm -r ${PYTHON_DIRS} || die
266
267 # Move mpi.so Python module to Python site-packages directory and make sure it is slotted.
268 if use mpi; then
269 mkdir -p "${D}$(python_get_sitedir)/boost_${MAJOR_PV}" || die
270 mv "${D}usr/$(get_libdir)/mpi.so" "${D}$(python_get_sitedir)/boost_${MAJOR_PV}" || die
271 cat << EOF > "${D}$(python_get_sitedir)/boost_${MAJOR_PV}/__init__.py" || die
272 import sys
273 if sys.platform.startswith('linux'):
274 import DLFCN
275 flags = sys.getdlopenflags()
276 sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL)
277 from . import mpi
278 sys.setdlopenflags(flags)
279 del DLFCN, flags
280 else:
281 from . import mpi
282 del sys
283 EOF
284 fi
285 fi
286 }
287 if use python; then
288 python_execute_function installation
289 else
290 installation
291 fi
292
293 use python || rm -rf "${D}usr/include/boost-${MAJOR_PV}/boost"/python* || die
294
295 if use doc; then
296 find libs/*/* -iname "test" -or -iname "src" | xargs rm -rf
297 dohtml \
298 -A pdf,txt,cpp,hpp \
299 *.{htm,html,png,css} \
300 -r doc
301 dohtml \
302 -A pdf,txt \
303 -r tools
304 insinto /usr/share/doc/${PF}/html
305 doins -r libs
306 doins -r more
307
308 # To avoid broken links
309 insinto /usr/share/doc/${PF}/html
310 doins LICENSE_1_0.txt
311
312 dosym /usr/include/boost /usr/share/doc/${PF}/html/boost
313 fi
314
315 dosym boost-${MAJOR_PV}/boost /usr/include/boost
316
317 pushd "${D}usr/$(get_libdir)" > /dev/null || die
318
319 # The threading libs obviously always gets the "-mt" (multithreading) tag
320 # some packages seem to have a problem with it. Creating symlinks...
321
322 if use static-libs; then
323 THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}.a libboost_thread-mt-${MAJOR_PV}$(get_libname)"
324 else
325 THREAD_LIBS="libboost_thread-mt-${MAJOR_PV}$(get_libname)"
326 fi
327 local lib
328 for lib in ${THREAD_LIBS}; do
329 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
330 done
331
332 # The same goes for the mpi libs
333 if use mpi; then
334 if use static-libs; then
335 MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}.a libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
336 else
337 MPI_LIBS="libboost_mpi-mt-${MAJOR_PV}$(get_libname)"
338 fi
339 local lib
340 for lib in ${MPI_LIBS}; do
341 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
342 done
343 fi
344
345 if use debug; then
346 if use static-libs; then
347 THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname) libboost_thread-mt-${MAJOR_PV}-debug.a"
348 else
349 THREAD_DEBUG_LIBS="libboost_thread-mt-${MAJOR_PV}-debug$(get_libname)"
350 fi
351
352 local lib
353 for lib in ${THREAD_DEBUG_LIBS}; do
354 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
355 done
356
357 if use mpi; then
358 if use static-libs; then
359 MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug.a libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
360 else
361 MPI_DEBUG_LIBS="libboost_mpi-mt-${MAJOR_PV}-debug$(get_libname)"
362 fi
363
364 local lib
365 for lib in ${MPI_DEBUG_LIBS}; do
366 dosym ${lib} "/usr/$(get_libdir)/${lib/-mt/}"
367 done
368 fi
369 fi
370
371 local f
372 for f in $(ls -1 ${LIBRARY_TARGETS} | grep -v debug); do
373 dosym ${f} /usr/$(get_libdir)/${f/-${MAJOR_PV}}
374 done
375
376 if use debug; then
377 dodir /usr/$(get_libdir)/boost-debug
378 local f
379 for f in $(ls -1 ${LIBRARY_TARGETS} | grep debug); do
380 dosym ../${f} /usr/$(get_libdir)/boost-debug/${f/-${MAJOR_PV}-debug}
381 done
382 fi
383
384 popd > /dev/null || die
385
386 if use tools; then
387 pushd dist/bin > /dev/null || die
388 # Append version postfix to binaries for slotting
389 local b
390 for b in *; do
391 newbin "${b}" "${b}-${MAJOR_PV}"
392 done
393 popd > /dev/null || die
394
395 pushd dist > /dev/null || die
396 insinto /usr/share
397 doins -r share/boostbook
398 # Append version postfix for slotting
399 mv "${D}usr/share/boostbook" "${D}usr/share/boostbook-${MAJOR_PV}" || die
400 popd > /dev/null || die
401 fi
402
403 pushd status > /dev/null || die
404 if [[ -f regress.log ]]; then
405 docinto status
406 dohtml *.html ../boost.png
407 dodoc regress.log
408 fi
409 popd > /dev/null || die
410
411 # boost's build system truely sucks for not having a destdir. Because for
412 # this reason we are forced to build with a prefix that includes the
413 # DESTROOT, dynamic libraries on Darwin end messed up, referencing the
414 # DESTROOT instread of the actual EPREFIX. There is no way out of here
415 # but to do it the dirty way of manually setting the right install_names.
416 if [[ ${CHOST} == *-darwin* ]]; then
417 einfo "Working around completely broken build-system(tm)"
418 local d
419 for d in "${ED}"usr/lib/*.dylib; do
420 if [[ -f ${d} ]]; then
421 # fix the "soname"
422 ebegin " correcting install_name of ${d#${ED}}"
423 install_name_tool -id "/${d#${D}}" "${d}"
424 eend $?
425 # fix references to other libs
426 refs=$(otool -XL "${d}" | \
427 sed -e '1d' -e 's/^\t//' | \
428 grep "^libboost_" | \
429 cut -f1 -d' ')
430 local r
431 for r in ${refs}; do
432 ebegin " correcting reference to ${r}"
433 install_name_tool -change \
434 "${r}" \
435 "${EPREFIX}/usr/lib/${r}" \
436 "${d}"
437 eend $?
438 done
439 fi
440 done
441 fi
442 }
443
444 # the tests will never fail because these are not intended as sanity
445 # tests at all. They are more a way for upstream to check their own code
446 # on new compilers. Since they would either be completely unreliable
447 # (failing for no good reason) or completely useless (never failing)
448 # there is no point in having them in the ebuild to begin with.
449 src_test() { :; }

  ViewVC Help
Powered by ViewVC 1.1.20