Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/boost/
Date: Sun, 15 Dec 2019 14:20:39
Message-Id: 1576419614.ce58809323e445e3c687072eba04b0c5a0b79396.soap@gentoo
1 commit: ce58809323e445e3c687072eba04b0c5a0b79396
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 15 14:20:14 2019 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 15 14:20:14 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce588093
7
8 dev-libs/boost: Bump to version 1.72.0
9
10 Package-Manager: Portage-2.3.81, Repoman-2.3.20
11 Signed-off-by: David Seifert <soap <AT> gentoo.org>
12
13 dev-libs/boost/Manifest | 1 +
14 dev-libs/boost/boost-1.72.0.ebuild | 335 +++++++++++++++++++++++++++++++++++++
15 2 files changed, 336 insertions(+)
16
17 diff --git a/dev-libs/boost/Manifest b/dev-libs/boost/Manifest
18 index 1d613291002..2fab5165b1b 100644
19 --- a/dev-libs/boost/Manifest
20 +++ b/dev-libs/boost/Manifest
21 @@ -1 +1,2 @@
22 DIST boost_1_71_0.tar.bz2 100124647 BLAKE2B edf5a03d5a5a63ef5826ef3c19a5ee862a43eb93e8e3d76f8a0d1f2c23122f5a0535e045058110574cd19092f3199c28ab9dae53f9db05ffe8c0b0b8cdbe27a9 SHA512 b7937d50c4512cf13cadd0ca829de36cf2cbc6fb788f45b1d4565ad0753e2b206c545125a5862016c2f16016f2e4a6b687928963b466fff17c3e0a4437142c20
23 +DIST boost_1_72_0.tar.bz2 106907358 BLAKE2B ab270a0e3cb24da687d86785e2d2e6d7731b4dbc07bd839eadb642dfa5a428ad584acb1f3529661a8de9a986008ff3427491041059ea2b742348d02e00761cd8 SHA512 63bbd1743e7c904b2e69fdc2eafd1c2a8a30fd70d960dcd366059d0100f000cb605d56cbd9397bb18421631f1c9552a772c434d0f0caddbe56302273f51fd1f6
24
25 diff --git a/dev-libs/boost/boost-1.72.0.ebuild b/dev-libs/boost/boost-1.72.0.ebuild
26 new file mode 100644
27 index 00000000000..c03e60926c9
28 --- /dev/null
29 +++ b/dev-libs/boost/boost-1.72.0.ebuild
30 @@ -0,0 +1,335 @@
31 +# Copyright 1999-2019 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +PYTHON_COMPAT=( python{2_7,3_{6,7,8}} )
37 +
38 +inherit flag-o-matic multiprocessing python-r1 toolchain-funcs multilib-minimal
39 +
40 +MY_PV="$(ver_rs 1- _)"
41 +MAJOR_V="$(ver_cut 1-2)"
42 +
43 +DESCRIPTION="Boost Libraries for C++"
44 +HOMEPAGE="https://www.boost.org/"
45 +SRC_URI="https://dl.bintray.com/boostorg/release/${PV}/source/boost_${MY_PV}.tar.bz2"
46 +
47 +LICENSE="Boost-1.0"
48 +SLOT="0/${PV}" # ${PV} instead ${MAJOR_V} due to bug 486122
49 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris ~x86-winnt"
50 +IUSE="bzip2 context debug doc icu lzma +nls mpi numpy python static-libs +threads tools zlib zstd"
51 +REQUIRED_USE="
52 + mpi? ( threads )
53 + python? ( ${PYTHON_REQUIRED_USE} )"
54 +
55 +# the tests will never fail because these are not intended as sanity
56 +# tests at all. They are more a way for upstream to check their own code
57 +# on new compilers. Since they would either be completely unreliable
58 +# (failing for no good reason) or completely useless (never failing)
59 +# there is no point in having them in the ebuild to begin with.
60 +RESTRICT="test"
61 +
62 +RDEPEND="
63 + !app-admin/eselect-boost
64 + !dev-libs/boost-numpy
65 + bzip2? ( app-arch/bzip2:=[${MULTILIB_USEDEP}] )
66 + icu? ( >=dev-libs/icu-3.6:=[${MULTILIB_USEDEP}] )
67 + !icu? ( virtual/libiconv[${MULTILIB_USEDEP}] )
68 + lzma? ( app-arch/xz-utils:=[${MULTILIB_USEDEP}] )
69 + mpi? ( >=virtual/mpi-2.0-r4[${MULTILIB_USEDEP},cxx,threads] )
70 + python? (
71 + ${PYTHON_DEPS}
72 + numpy? ( >=dev-python/numpy-1.14.5[$(python_gen_usedep -3)] )
73 + )
74 + zlib? ( sys-libs/zlib:=[${MULTILIB_USEDEP}] )
75 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )"
76 +DEPEND="${RDEPEND}"
77 +BDEPEND="=dev-util/boost-build-${MAJOR_V}*"
78 +
79 +S="${WORKDIR}/${PN}_${MY_PV}"
80 +
81 +PATCHES=(
82 + "${FILESDIR}"/${PN}-1.71.0-disable_icu_rpath.patch
83 + "${FILESDIR}"/${PN}-1.71.0-context-x32.patch
84 + "${FILESDIR}"/${PN}-1.71.0-build-auto_index-tool.patch
85 +)
86 +
87 +python_bindings_needed() {
88 + multilib_is_native_abi && use python
89 +}
90 +
91 +tools_needed() {
92 + multilib_is_native_abi && use tools
93 +}
94 +
95 +create_user-config.jam() {
96 + local user_config_jam="${BUILD_DIR}"/user-config.jam
97 + if [[ -s ${user_config_jam} ]]; then
98 + einfo "${user_config_jam} already exists, skipping configuration"
99 + return
100 + else
101 + einfo "Creating configuration in ${user_config_jam}"
102 + fi
103 +
104 + local compiler compiler_version compiler_executable="$(tc-getCXX)"
105 + if [[ ${CHOST} == *-darwin* ]]; then
106 + compiler="darwin"
107 + compiler_version="$(gcc-fullversion)"
108 + else
109 + compiler="gcc"
110 + compiler_version="$(gcc-version)"
111 + fi
112 +
113 + if use mpi; then
114 + local mpi_configuration="using mpi ;"
115 + fi
116 +
117 + cat > "${user_config_jam}" <<- __EOF__ || die
118 + using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;
119 + ${mpi_configuration}
120 + __EOF__
121 +
122 + if python_bindings_needed; then
123 + append_to_user_config() {
124 + local py_config
125 + if tc-is-cross-compiler; then
126 + py_config="using python : ${EPYTHON#python} : : ${ESYSROOT}/usr/include/${EPYTHON} : ${ESYSROOT}/usr/$(get_libdir) ;"
127 + else
128 + py_config="using python : ${EPYTHON#python} : ${PYTHON} : $(python_get_includedir) ;"
129 + fi
130 + echo "${py_config}" >> "${user_config_jam}" || die
131 + }
132 + python_foreach_impl append_to_user_config
133 + fi
134 +
135 + if python_bindings_needed && use numpy; then
136 + einfo "Enabling support for NumPy extensions in Boost.Python"
137 + else
138 + einfo "Disabling support for NumPy extensions in Boost.Python"
139 +
140 + # Boost.Build does not allow for disabling of numpy
141 + # extensions, thereby leading to automagic numpy
142 + # https://github.com/boostorg/python/issues/111#issuecomment-280447482
143 + sed \
144 + -e 's/\[ unless \[ python\.numpy \] : <build>no \]/<build>no/g' \
145 + -i "${BUILD_DIR}"/libs/python/build/Jamfile || die
146 + fi
147 +}
148 +
149 +pkg_setup() {
150 + # Bail out on unsupported build configuration, bug #456792
151 + if [[ -f "${EROOT}"/etc/site-config.jam ]]; then
152 + if ! grep -q 'gentoo\(debug\|release\)' "${EROOT}"/etc/site-config.jam; then
153 + eerror "You are using custom ${EROOT}/etc/site-config.jam without defined gentoorelease/gentoodebug targets."
154 + eerror "Boost can not be built in such configuration."
155 + eerror "Please, either remove this file or add targets from ${EROOT}/usr/share/boost-build/site-config.jam to it."
156 + die "Unsupported target in ${EROOT}/etc/site-config.jam"
157 + fi
158 + fi
159 +}
160 +
161 +src_prepare() {
162 + default
163 + multilib_copy_sources
164 +}
165 +
166 +ejam() {
167 + create_user-config.jam
168 +
169 + local b2_opts=( "--user-config=${BUILD_DIR}/user-config.jam" )
170 + if python_bindings_needed; then
171 + append_to_b2_opts() {
172 + b2_opts+=( python="${EPYTHON#python}" )
173 + }
174 + python_foreach_impl append_to_b2_opts
175 + else
176 + b2_opts+=( --without-python )
177 + fi
178 + b2_opts+=( "$@" )
179 +
180 + echo b2 "${b2_opts[@]}" >&2
181 + b2 "${b2_opts[@]}"
182 +}
183 +
184 +src_configure() {
185 + # Workaround for too many parallel processes requested, bug #506064
186 + [[ "$(makeopts_jobs)" -gt 64 ]] && MAKEOPTS="${MAKEOPTS} -j64"
187 +
188 + OPTIONS=(
189 + $(usex debug gentoodebug gentoorelease)
190 + "-j$(makeopts_jobs)"
191 + -q
192 + -d+2
193 + pch=off
194 + $(usex icu "-sICU_PATH=${ESYSROOT}/usr" '--disable-icu boost.locale.icu=off')
195 + $(usex mpi '' '--without-mpi')
196 + $(usex nls '' '--without-locale')
197 + $(usex context '' '--without-context --without-coroutine --without-fiber')
198 + $(usex threads '' '--without-thread')
199 + --without-stacktrace
200 + --boost-build="${BROOT}"/usr/share/boost-build
201 + --prefix="${ED}/usr"
202 + --layout=system
203 + # CMake has issues working with multiple python impls,
204 + # disable cmake config generation for the time being
205 + # https://github.com/boostorg/python/issues/262#issuecomment-483069294
206 + --no-cmake-config
207 + # building with threading=single is currently not possible
208 + # https://svn.boost.org/trac/boost/ticket/7105
209 + threading=multi
210 + link=$(usex static-libs shared,static shared)
211 + # this seems to be the only way to disable compression algorithms
212 + # https://www.boost.org/doc/libs/1_70_0/libs/iostreams/doc/installation.html#boost-build
213 + -sNO_BZIP2=$(usex bzip2 0 1)
214 + -sNO_LZMA=$(usex lzma 0 1)
215 + -sNO_ZLIB=$(usex zlib 0 1)
216 + -sNO_ZSTD=$(usex zstd 0 1)
217 + )
218 +
219 + if [[ ${CHOST} == *-darwin* ]]; then
220 + # We need to add the prefix, and in two cases this exceeds, so prepare
221 + # for the largest possible space allocation.
222 + append-ldflags -Wl,-headerpad_max_install_names
223 + fi
224 +
225 + # Use C++14 globally as of 1.62
226 + append-cxxflags -std=c++14
227 +}
228 +
229 +multilib_src_compile() {
230 + ejam "${OPTIONS[@]}" || die
231 +
232 + if tools_needed; then
233 + pushd tools >/dev/null || die
234 + ejam \
235 + "${OPTIONS[@]}" \
236 + || die "Building of Boost tools failed"
237 + popd >/dev/null || die
238 + fi
239 +}
240 +
241 +multilib_src_install_all() {
242 + if ! use numpy; then
243 + rm -r "${ED}"/usr/include/boost/python/numpy* || die
244 + fi
245 +
246 + if ! use python; then
247 + rm -r "${ED}"/usr/include/boost/{python*,mpi/python*,parameter/aux_/python,parameter/python*} || die
248 + fi
249 +
250 + if ! use nls; then
251 + rm -r "${ED}"/usr/include/boost/locale || die
252 + fi
253 +
254 + if ! use context; then
255 + rm -r "${ED}"/usr/include/boost/context || die
256 + rm -r "${ED}"/usr/include/boost/coroutine{,2} || die
257 + rm "${ED}"/usr/include/boost/asio/spawn.hpp || die
258 + fi
259 +
260 + if use doc; then
261 + # find extraneous files that shouldn't be installed
262 + # as part of the documentation and remove them.
263 + find libs/*/* \( -iname 'test' -o -iname 'src' \) -exec rm -rf '{}' + || die
264 + find doc \( -name 'Jamfile.v2' -o -name 'build' -o -name '*.manifest' \) -exec rm -rf '{}' + || die
265 + find tools \( -name 'Jamfile.v2' -o -name 'src' -o -name '*.cpp' -o -name '*.hpp' \) -exec rm -rf '{}' + || die
266 +
267 + docinto html
268 + dodoc *.{htm,html,png,css}
269 + dodoc -r doc libs more tools
270 +
271 + # To avoid broken links
272 + dodoc LICENSE_1_0.txt
273 +
274 + dosym ../../../../include/boost /usr/share/doc/${PF}/html/boost
275 + fi
276 +}
277 +
278 +multilib_src_install() {
279 + ejam \
280 + "${OPTIONS[@]}" \
281 + --includedir="${ED}/usr/include" \
282 + --libdir="${ED}/usr/$(get_libdir)" \
283 + install || die "Installation of Boost libraries failed"
284 +
285 + pushd "${ED}/usr/$(get_libdir)" >/dev/null || die
286 +
287 + local ext=$(get_libname)
288 + if use threads; then
289 + local f
290 + for f in *${ext}; do
291 + dosym ${f} /usr/$(get_libdir)/${f/${ext}/-mt${ext}}
292 + done
293 + fi
294 +
295 + popd >/dev/null || die
296 +
297 + if tools_needed; then
298 + dobin dist/bin/*
299 +
300 + insinto /usr/share
301 + doins -r dist/share/boostbook
302 + fi
303 +
304 + # boost's build system truely sucks for not having a destdir. Because for
305 + # this reason we are forced to build with a prefix that includes the
306 + # DESTROOT, dynamic libraries on Darwin end messed up, referencing the
307 + # DESTROOT instread of the actual EPREFIX. There is no way out of here
308 + # but to do it the dirty way of manually setting the right install_names.
309 + if [[ ${CHOST} == *-darwin* ]]; then
310 + einfo "Working around completely broken build-system(tm)"
311 + local d
312 + for d in "${ED}"/usr/lib/*.dylib; do
313 + if [[ -f ${d} ]]; then
314 + # fix the "soname"
315 + ebegin " correcting install_name of ${d#${ED}}"
316 + install_name_tool -id "/${d#${D}}" "${d}"
317 + eend $?
318 + # fix references to other libs
319 + refs=$(otool -XL "${d}" | \
320 + sed -e '1d' -e 's/^\t//' | \
321 + grep "^libboost_" | \
322 + cut -f1 -d' ')
323 + local r
324 + for r in ${refs}; do
325 + ebegin " correcting reference to ${r}"
326 + install_name_tool -change \
327 + "${r}" \
328 + "${EPREFIX}/usr/lib/${r}" \
329 + "${d}"
330 + eend $?
331 + done
332 + fi
333 + done
334 + fi
335 +}
336 +
337 +pkg_preinst() {
338 + # Yai for having symlinks that are nigh-impossible to remove without
339 + # resorting to dirty hacks like these. Removes lingering symlinks
340 + # from the slotted versions.
341 + local symlink
342 + for symlink in "${EROOT}"/usr/include/boost "${EROOT}"/usr/share/boostbook; do
343 + if [[ -L ${symlink} ]]; then
344 + rm -f "${symlink}" || die
345 + fi
346 + done
347 +
348 + # some ancient installs still have boost cruft lying around
349 + # for unknown reasons, causing havoc for reverse dependencies
350 + # Bug: 607734
351 + rm -rf "${EROOT}"/usr/include/boost-1_[3-5]? || die
352 +}
353 +
354 +pkg_postinst() {
355 + elog "Boost.Regex is *extremely* ABI sensitive. If you get errors such as"
356 + elog
357 + elog " undefined reference to \`boost::re_detail_$(ver_cut 1)0$(ver_cut 2)00::cpp_regex_traits_implementation"
358 + elog " <char>::transform_primary[abi:cxx11](char const*, char const*) const'"
359 + elog
360 + elog "Then you need you need to recompile Boost and all its reverse dependencies"
361 + elog "using the same toolchain. In general, *every* change of the C++ toolchain"
362 + elog "requires a complete rebuild of the boost-dependent ecosystem."
363 + elog
364 + elog "See for instance https://bugs.gentoo.org/638138"
365 +}