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