1 |
commit: eaab0a7fcb255a7b0a7d9225c2f6bac0c96f8f4b |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 2 14:26:29 2020 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 2 14:26:29 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eaab0a7f |
7 |
|
8 |
dev-libs/boost: Bump to 1.73.0 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/719930 |
11 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
12 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
13 |
|
14 |
dev-libs/boost/Manifest | 1 + |
15 |
dev-libs/boost/boost-1.73.0.ebuild | 355 +++++++++++++++++++++ |
16 |
.../boost-1.73-boost-mpi-python-PEP-328.patch | 17 + |
17 |
.../files/boost-1.73-boost-python-cleanup.patch | 107 +++++++ |
18 |
4 files changed, 480 insertions(+) |
19 |
|
20 |
diff --git a/dev-libs/boost/Manifest b/dev-libs/boost/Manifest |
21 |
index 34653ed7e2e..464a9d9c3eb 100644 |
22 |
--- a/dev-libs/boost/Manifest |
23 |
+++ b/dev-libs/boost/Manifest |
24 |
@@ -1 +1,2 @@ |
25 |
DIST boost_1_72_0.tar.bz2 106907358 BLAKE2B ab270a0e3cb24da687d86785e2d2e6d7731b4dbc07bd839eadb642dfa5a428ad584acb1f3529661a8de9a986008ff3427491041059ea2b742348d02e00761cd8 SHA512 63bbd1743e7c904b2e69fdc2eafd1c2a8a30fd70d960dcd366059d0100f000cb605d56cbd9397bb18421631f1c9552a772c434d0f0caddbe56302273f51fd1f6 |
26 |
+DIST boost_1_73_0.tar.bz2 109247910 BLAKE2B 5995ff6ca21f45988b187b94bf743795cca97531baa8355f488be0987b9426289dd85d6ce25b7eb03ccd690109f05ba56252a95bca50505ad9cd66f4e0e234e8 SHA512 86c296511c0766145097625a62bf099c3d155284d250ad6e528e788bc90b2945838498dfe473c6c6c78d1694b6fba8e19f7dee0d064a043841e6231603fff668 |
27 |
|
28 |
diff --git a/dev-libs/boost/boost-1.73.0.ebuild b/dev-libs/boost/boost-1.73.0.ebuild |
29 |
new file mode 100644 |
30 |
index 00000000000..2ee4e6a8b00 |
31 |
--- /dev/null |
32 |
+++ b/dev-libs/boost/boost-1.73.0.ebuild |
33 |
@@ -0,0 +1,355 @@ |
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}} ) |
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 |
+ bzip2? ( app-arch/bzip2:=[${MULTILIB_USEDEP}] ) |
69 |
+ icu? ( >=dev-libs/icu-3.6:=[${MULTILIB_USEDEP}] ) |
70 |
+ !icu? ( virtual/libiconv[${MULTILIB_USEDEP}] ) |
71 |
+ lzma? ( app-arch/xz-utils:=[${MULTILIB_USEDEP}] ) |
72 |
+ mpi? ( >=virtual/mpi-2.0-r4[${MULTILIB_USEDEP},cxx,threads] ) |
73 |
+ python? ( |
74 |
+ ${PYTHON_DEPS} |
75 |
+ numpy? ( $(python_gen_cond_dep 'dev-python/numpy[${PYTHON_USEDEP}]' -3) ) |
76 |
+ ) |
77 |
+ zlib? ( sys-libs/zlib:=[${MULTILIB_USEDEP}] ) |
78 |
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )" |
79 |
+DEPEND="${RDEPEND}" |
80 |
+BDEPEND="=dev-util/boost-build-${MAJOR_V}*" |
81 |
+ |
82 |
+S="${WORKDIR}/${PN}_${MY_PV}" |
83 |
+ |
84 |
+PATCHES=( |
85 |
+ "${FILESDIR}"/${PN}-1.71.0-disable_icu_rpath.patch |
86 |
+ "${FILESDIR}"/${PN}-1.71.0-context-x32.patch |
87 |
+ "${FILESDIR}"/${PN}-1.71.0-build-auto_index-tool.patch |
88 |
+ # upstream unresponsive to pull request |
89 |
+ # https://github.com/boostorg/python/pull/286 |
90 |
+ "${FILESDIR}"/${PN}-1.73-boost-python-cleanup.patch |
91 |
+ # Boost.MPI's __init__.py doesn't work on Py3 |
92 |
+ "${FILESDIR}"/${PN}-1.73-boost-mpi-python-PEP-328.patch |
93 |
+) |
94 |
+ |
95 |
+python_bindings_needed() { |
96 |
+ multilib_is_native_abi && use python |
97 |
+} |
98 |
+ |
99 |
+tools_needed() { |
100 |
+ multilib_is_native_abi && use tools |
101 |
+} |
102 |
+ |
103 |
+create_user-config.jam() { |
104 |
+ local user_config_jam="${BUILD_DIR}"/user-config.jam |
105 |
+ if [[ -s ${user_config_jam} ]]; then |
106 |
+ einfo "${user_config_jam} already exists, skipping configuration" |
107 |
+ return |
108 |
+ else |
109 |
+ einfo "Creating configuration in ${user_config_jam}" |
110 |
+ fi |
111 |
+ |
112 |
+ local compiler compiler_version compiler_executable="$(tc-getCXX)" |
113 |
+ if [[ ${CHOST} == *-darwin* ]]; then |
114 |
+ compiler="darwin" |
115 |
+ compiler_version="$(gcc-fullversion)" |
116 |
+ else |
117 |
+ compiler="gcc" |
118 |
+ compiler_version="$(gcc-version)" |
119 |
+ fi |
120 |
+ |
121 |
+ if use mpi; then |
122 |
+ local mpi_configuration="using mpi ;" |
123 |
+ fi |
124 |
+ |
125 |
+ cat > "${user_config_jam}" <<- __EOF__ || die |
126 |
+ using ${compiler} : ${compiler_version} : ${compiler_executable} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ; |
127 |
+ ${mpi_configuration} |
128 |
+ __EOF__ |
129 |
+ |
130 |
+ if python_bindings_needed; then |
131 |
+ append_to_user_config() { |
132 |
+ local py_config |
133 |
+ if tc-is-cross-compiler; then |
134 |
+ py_config="using python : ${EPYTHON#python} : : ${ESYSROOT}/usr/include/${EPYTHON} : ${ESYSROOT}/usr/$(get_libdir) ;" |
135 |
+ else |
136 |
+ py_config="using python : ${EPYTHON#python} : ${PYTHON} : $(python_get_includedir) ;" |
137 |
+ fi |
138 |
+ echo "${py_config}" >> "${user_config_jam}" || die |
139 |
+ } |
140 |
+ python_foreach_impl append_to_user_config |
141 |
+ fi |
142 |
+ |
143 |
+ if python_bindings_needed && use numpy; then |
144 |
+ einfo "Enabling support for NumPy extensions in Boost.Python" |
145 |
+ else |
146 |
+ einfo "Disabling support for NumPy extensions in Boost.Python" |
147 |
+ |
148 |
+ # Boost.Build does not allow for disabling of numpy |
149 |
+ # extensions, thereby leading to automagic numpy |
150 |
+ # https://github.com/boostorg/python/issues/111#issuecomment-280447482 |
151 |
+ sed \ |
152 |
+ -e 's/\[ unless \[ python\.numpy \] : <build>no \]/<build>no/g' \ |
153 |
+ -i "${BUILD_DIR}"/libs/python/build/Jamfile || die |
154 |
+ fi |
155 |
+} |
156 |
+ |
157 |
+pkg_setup() { |
158 |
+ # Bail out on unsupported build configuration, bug #456792 |
159 |
+ if [[ -f "${EROOT}"/etc/site-config.jam ]]; then |
160 |
+ if ! grep -q 'gentoo\(debug\|release\)' "${EROOT}"/etc/site-config.jam; then |
161 |
+ eerror "You are using custom ${EROOT}/etc/site-config.jam without defined gentoorelease/gentoodebug targets." |
162 |
+ eerror "Boost can not be built in such configuration." |
163 |
+ eerror "Please, either remove this file or add targets from ${EROOT}/usr/share/boost-build/site-config.jam to it." |
164 |
+ die "Unsupported target in ${EROOT}/etc/site-config.jam" |
165 |
+ fi |
166 |
+ fi |
167 |
+} |
168 |
+ |
169 |
+src_prepare() { |
170 |
+ default |
171 |
+ multilib_copy_sources |
172 |
+} |
173 |
+ |
174 |
+ejam() { |
175 |
+ create_user-config.jam |
176 |
+ |
177 |
+ local b2_opts=( "--user-config=${BUILD_DIR}/user-config.jam" ) |
178 |
+ if python_bindings_needed; then |
179 |
+ append_to_b2_opts() { |
180 |
+ b2_opts+=( python="${EPYTHON#python}" ) |
181 |
+ } |
182 |
+ python_foreach_impl append_to_b2_opts |
183 |
+ else |
184 |
+ b2_opts+=( --without-python ) |
185 |
+ fi |
186 |
+ b2_opts+=( "$@" ) |
187 |
+ |
188 |
+ echo b2 "${b2_opts[@]}" >&2 |
189 |
+ b2 "${b2_opts[@]}" |
190 |
+} |
191 |
+ |
192 |
+src_configure() { |
193 |
+ # Workaround for too many parallel processes requested, bug #506064 |
194 |
+ [[ "$(makeopts_jobs)" -gt 64 ]] && MAKEOPTS="${MAKEOPTS} -j64" |
195 |
+ |
196 |
+ OPTIONS=( |
197 |
+ $(usex debug gentoodebug gentoorelease) |
198 |
+ "-j$(makeopts_jobs)" |
199 |
+ -q |
200 |
+ -d+2 |
201 |
+ pch=off |
202 |
+ $(usex icu "-sICU_PATH=${ESYSROOT}/usr" '--disable-icu boost.locale.icu=off') |
203 |
+ $(usex mpi '' '--without-mpi') |
204 |
+ $(usex nls '' '--without-locale') |
205 |
+ $(usex context '' '--without-context --without-coroutine --without-fiber') |
206 |
+ $(usex threads '' '--without-thread') |
207 |
+ --without-stacktrace |
208 |
+ --boost-build="${BROOT}"/usr/share/boost-build |
209 |
+ --prefix="${ED}/usr" |
210 |
+ --layout=system |
211 |
+ # CMake has issues working with multiple python impls, |
212 |
+ # disable cmake config generation for the time being |
213 |
+ # https://github.com/boostorg/python/issues/262#issuecomment-483069294 |
214 |
+ --no-cmake-config |
215 |
+ # building with threading=single is currently not possible |
216 |
+ # https://svn.boost.org/trac/boost/ticket/7105 |
217 |
+ threading=multi |
218 |
+ link=$(usex static-libs shared,static shared) |
219 |
+ # this seems to be the only way to disable compression algorithms |
220 |
+ # https://www.boost.org/doc/libs/1_70_0/libs/iostreams/doc/installation.html#boost-build |
221 |
+ -sNO_BZIP2=$(usex bzip2 0 1) |
222 |
+ -sNO_LZMA=$(usex lzma 0 1) |
223 |
+ -sNO_ZLIB=$(usex zlib 0 1) |
224 |
+ -sNO_ZSTD=$(usex zstd 0 1) |
225 |
+ ) |
226 |
+ |
227 |
+ if [[ ${CHOST} == *-darwin* ]]; then |
228 |
+ # We need to add the prefix, and in two cases this exceeds, so prepare |
229 |
+ # for the largest possible space allocation. |
230 |
+ append-ldflags -Wl,-headerpad_max_install_names |
231 |
+ fi |
232 |
+ |
233 |
+ # Use C++14 globally as of 1.62 |
234 |
+ append-cxxflags -std=c++14 |
235 |
+} |
236 |
+ |
237 |
+multilib_src_compile() { |
238 |
+ ejam "${OPTIONS[@]}" || die |
239 |
+ |
240 |
+ if tools_needed; then |
241 |
+ pushd tools >/dev/null || die |
242 |
+ ejam \ |
243 |
+ "${OPTIONS[@]}" \ |
244 |
+ || die "Building of Boost tools failed" |
245 |
+ popd >/dev/null || die |
246 |
+ fi |
247 |
+} |
248 |
+ |
249 |
+multilib_src_install_all() { |
250 |
+ if ! use numpy; then |
251 |
+ rm -r "${ED}"/usr/include/boost/python/numpy* || die |
252 |
+ fi |
253 |
+ |
254 |
+ if use python; then |
255 |
+ if use mpi; then |
256 |
+ move_mpi_py_into_sitedir() { |
257 |
+ python_moduleinto boost |
258 |
+ python_domodule "${S}"/libs/mpi/build/__init__.py |
259 |
+ |
260 |
+ python_domodule "${ED}"/usr/$(get_libdir)/boost-${EPYTHON}/mpi.so |
261 |
+ rm -r "${ED}"/usr/$(get_libdir)/boost-${EPYTHON} || die |
262 |
+ |
263 |
+ python_optimize |
264 |
+ } |
265 |
+ python_foreach_impl move_mpi_py_into_sitedir |
266 |
+ else |
267 |
+ rm -r "${ED}"/usr/include/boost/mpi/python* || die |
268 |
+ fi |
269 |
+ else |
270 |
+ rm -r "${ED}"/usr/include/boost/{python*,mpi/python*,parameter/aux_/python,parameter/python*} || die |
271 |
+ fi |
272 |
+ |
273 |
+ if ! use nls; then |
274 |
+ rm -r "${ED}"/usr/include/boost/locale || die |
275 |
+ fi |
276 |
+ |
277 |
+ if ! use context; then |
278 |
+ rm -r "${ED}"/usr/include/boost/context || die |
279 |
+ rm -r "${ED}"/usr/include/boost/coroutine{,2} || die |
280 |
+ rm "${ED}"/usr/include/boost/asio/spawn.hpp || die |
281 |
+ fi |
282 |
+ |
283 |
+ if use doc; then |
284 |
+ # find extraneous files that shouldn't be installed |
285 |
+ # as part of the documentation and remove them. |
286 |
+ find libs/*/* \( -iname 'test' -o -iname 'src' \) -exec rm -rf '{}' + || die |
287 |
+ find doc \( -name 'Jamfile.v2' -o -name 'build' -o -name '*.manifest' \) -exec rm -rf '{}' + || die |
288 |
+ find tools \( -name 'Jamfile.v2' -o -name 'src' -o -name '*.cpp' -o -name '*.hpp' \) -exec rm -rf '{}' + || die |
289 |
+ |
290 |
+ docinto html |
291 |
+ dodoc *.{htm,html,png,css} |
292 |
+ dodoc -r doc libs more tools |
293 |
+ |
294 |
+ # To avoid broken links |
295 |
+ dodoc LICENSE_1_0.txt |
296 |
+ |
297 |
+ dosym ../../../../include/boost /usr/share/doc/${PF}/html/boost |
298 |
+ fi |
299 |
+} |
300 |
+ |
301 |
+multilib_src_install() { |
302 |
+ ejam \ |
303 |
+ "${OPTIONS[@]}" \ |
304 |
+ --includedir="${ED}/usr/include" \ |
305 |
+ --libdir="${ED}/usr/$(get_libdir)" \ |
306 |
+ install || die "Installation of Boost libraries failed" |
307 |
+ |
308 |
+ pushd "${ED}/usr/$(get_libdir)" >/dev/null || die |
309 |
+ |
310 |
+ local ext=$(get_libname) |
311 |
+ if use threads; then |
312 |
+ local f |
313 |
+ for f in *${ext}; do |
314 |
+ dosym ${f} /usr/$(get_libdir)/${f/${ext}/-mt${ext}} |
315 |
+ done |
316 |
+ fi |
317 |
+ |
318 |
+ popd >/dev/null || die |
319 |
+ |
320 |
+ if tools_needed; then |
321 |
+ dobin dist/bin/* |
322 |
+ |
323 |
+ insinto /usr/share |
324 |
+ doins -r dist/share/boostbook |
325 |
+ fi |
326 |
+ |
327 |
+ # boost's build system truely sucks for not having a destdir. Because for |
328 |
+ # this reason we are forced to build with a prefix that includes the |
329 |
+ # DESTROOT, dynamic libraries on Darwin end messed up, referencing the |
330 |
+ # DESTROOT instread of the actual EPREFIX. There is no way out of here |
331 |
+ # but to do it the dirty way of manually setting the right install_names. |
332 |
+ if [[ ${CHOST} == *-darwin* ]]; then |
333 |
+ einfo "Working around completely broken build-system(tm)" |
334 |
+ local d |
335 |
+ for d in "${ED}"/usr/lib/*.dylib; do |
336 |
+ if [[ -f ${d} ]]; then |
337 |
+ # fix the "soname" |
338 |
+ ebegin " correcting install_name of ${d#${ED}}" |
339 |
+ install_name_tool -id "/${d#${D}}" "${d}" |
340 |
+ eend $? |
341 |
+ # fix references to other libs |
342 |
+ refs=$(otool -XL "${d}" | \ |
343 |
+ sed -e '1d' -e 's/^\t//' | \ |
344 |
+ grep "^libboost_" | \ |
345 |
+ cut -f1 -d' ') |
346 |
+ local r |
347 |
+ for r in ${refs}; do |
348 |
+ ebegin " correcting reference to ${r}" |
349 |
+ install_name_tool -change \ |
350 |
+ "${r}" \ |
351 |
+ "${EPREFIX}/usr/lib/${r}" \ |
352 |
+ "${d}" |
353 |
+ eend $? |
354 |
+ done |
355 |
+ fi |
356 |
+ done |
357 |
+ fi |
358 |
+} |
359 |
+ |
360 |
+pkg_preinst() { |
361 |
+ # Yai for having symlinks that are nigh-impossible to remove without |
362 |
+ # resorting to dirty hacks like these. Removes lingering symlinks |
363 |
+ # from the slotted versions. |
364 |
+ local symlink |
365 |
+ for symlink in "${EROOT}"/usr/include/boost "${EROOT}"/usr/share/boostbook; do |
366 |
+ if [[ -L ${symlink} ]]; then |
367 |
+ rm -f "${symlink}" || die |
368 |
+ fi |
369 |
+ done |
370 |
+ |
371 |
+ # some ancient installs still have boost cruft lying around |
372 |
+ # for unknown reasons, causing havoc for reverse dependencies |
373 |
+ # Bug: 607734 |
374 |
+ rm -rf "${EROOT}"/usr/include/boost-1_[3-5]? || die |
375 |
+} |
376 |
+ |
377 |
+pkg_postinst() { |
378 |
+ elog "Boost.Regex is *extremely* ABI sensitive. If you get errors such as" |
379 |
+ elog |
380 |
+ elog " undefined reference to \`boost::re_detail_$(ver_cut 1)0$(ver_cut 2)00::cpp_regex_traits_implementation" |
381 |
+ elog " <char>::transform_primary[abi:cxx11](char const*, char const*) const'" |
382 |
+ elog |
383 |
+ elog "Then you need to recompile Boost and all its reverse dependencies" |
384 |
+ elog "using the same toolchain. In general, *every* change of the C++ toolchain" |
385 |
+ elog "requires a complete rebuild of the boost-dependent ecosystem." |
386 |
+ elog |
387 |
+ elog "See for instance https://bugs.gentoo.org/638138" |
388 |
+} |
389 |
|
390 |
diff --git a/dev-libs/boost/files/boost-1.73-boost-mpi-python-PEP-328.patch b/dev-libs/boost/files/boost-1.73-boost-mpi-python-PEP-328.patch |
391 |
new file mode 100644 |
392 |
index 00000000000..444db2b6095 |
393 |
--- /dev/null |
394 |
+++ b/dev-libs/boost/files/boost-1.73-boost-mpi-python-PEP-328.patch |
395 |
@@ -0,0 +1,17 @@ |
396 |
+--- a/libs/mpi/build/__init__.py |
397 |
++++ b/libs/mpi/build/__init__.py |
398 |
+@@ -1,10 +1,12 @@ |
399 |
++from __future__ import absolute_import |
400 |
++ |
401 |
+ import sys |
402 |
+ if sys.platform == 'linux2': |
403 |
+ import DLFCN as dl |
404 |
+ flags = sys.getdlopenflags() |
405 |
+ sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL) |
406 |
+- import mpi |
407 |
++ from . import mpi |
408 |
+ sys.setdlopenflags(flags) |
409 |
+ else: |
410 |
+- import mpi |
411 |
++ from . import mpi |
412 |
+ |
413 |
|
414 |
diff --git a/dev-libs/boost/files/boost-1.73-boost-python-cleanup.patch b/dev-libs/boost/files/boost-1.73-boost-python-cleanup.patch |
415 |
new file mode 100644 |
416 |
index 00000000000..64c8eec814e |
417 |
--- /dev/null |
418 |
+++ b/dev-libs/boost/files/boost-1.73-boost-python-cleanup.patch |
419 |
@@ -0,0 +1,107 @@ |
420 |
+From c1cae8e6b0480e046ea627679a3afe488ed02dc1 Mon Sep 17 00:00:00 2001 |
421 |
+From: David Seifert <soap@g.o> |
422 |
+Date: Wed, 25 Dec 2019 12:37:35 +0100 |
423 |
+Subject: [PATCH] Remove Boost.Python-specific python-tag code |
424 |
+ |
425 |
+--- |
426 |
+ libs/python/Jamfile | 68 --------------------------------------------------- |
427 |
+ libs/python/build/Jamfile | 4 +-- |
428 |
+ 2 files changed, 2 insertions(+), 70 deletions(-) |
429 |
+ delete mode 100644 Jamfile |
430 |
+ |
431 |
+diff --git a/libs/python/Jamfile b/libs/python/Jamfile |
432 |
+deleted file mode 100644 |
433 |
+index 32e87d80f..000000000 |
434 |
+--- a/libs/python/Jamfile |
435 |
++++ /dev/null |
436 |
+@@ -1,68 +0,0 @@ |
437 |
+-# Copyright (c) 2018 Stefan Seefeld |
438 |
+-# All rights reserved. |
439 |
+-# |
440 |
+-# Distributed under the Boost Software License, Version 1.0. |
441 |
+-# (See accompanying file LICENSE_1_0.txt or copy at |
442 |
+-# http://www.boost.org/LICENSE_1_0.txt) |
443 |
+- |
444 |
+-import option ; |
445 |
+-import regex ; |
446 |
+-import python ; |
447 |
+- |
448 |
+-# |
449 |
+-# The `version-suffix` rule really belongs into python.jam, and |
450 |
+-# should be moved there. `split-version` is only duplicated here |
451 |
+-# as a prerequisite. (See https://github.com/boostorg/build/pull/290) |
452 |
+-# |
453 |
+- |
454 |
+- |
455 |
+-# Validate the version string and extract the major/minor part we care about. |
456 |
+-# |
457 |
+-local rule split-version ( version ) |
458 |
+-{ |
459 |
+- local major-minor = [ MATCH "^([0-9]+)\.([0-9]+)(.*)$" : $(version) : 1 2 3 ] ; |
460 |
+- if ! $(major-minor[2]) || $(major-minor[3]) |
461 |
+- { |
462 |
+- ECHO "Warning: \"using python\" expects a two part (major, minor) version number; got" $(version) instead ; |
463 |
+- |
464 |
+- # Add a zero to account for the missing digit if necessary. |
465 |
+- major-minor += 0 ; |
466 |
+- } |
467 |
+- |
468 |
+- return $(major-minor[1]) $(major-minor[2]) ; |
469 |
+-} |
470 |
+- |
471 |
+-# Define a version suffix for libraries depending on Python. |
472 |
+-# For example, Boost.Python built for Python 2.7 uses the suffix "27" |
473 |
+-rule version-suffix ( version ) |
474 |
+-{ |
475 |
+- local major-minor = [ split-version $(version) ] ; |
476 |
+- local suffix = $(major-minor:J="") ; |
477 |
+- return $(suffix) ; |
478 |
+-} |
479 |
+- |
480 |
+- |
481 |
+-# Python build id (for Python libraries only). |
482 |
+-python-id = [ option.get "python-buildid" ] ; |
483 |
+-if $(python-id) |
484 |
+-{ |
485 |
+- PYTHON_ID = [ regex.replace $(python-id) "[*\\/:.\"\']" _ ] ; |
486 |
+-} |
487 |
+- |
488 |
+-rule python-tag ( name : type ? : property-set ) |
489 |
+-{ |
490 |
+- local result = $(name) ; |
491 |
+- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB |
492 |
+- { |
493 |
+- local version = [ $(property-set).get <python> ] ; |
494 |
+- local lib-suffix = [ version-suffix $(version) ] ; |
495 |
+- result = $(result)$(lib-suffix) ; |
496 |
+- } |
497 |
+- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB && $(PYTHON_ID) |
498 |
+- { |
499 |
+- result = $(result)-$(PYTHON_ID) ; |
500 |
+- } |
501 |
+- |
502 |
+- # forward to the boost tagging rule |
503 |
+- return [ tag $(result) : $(type) : $(property-set) ] ; |
504 |
+-} |
505 |
+diff --git a/libs/python/build/Jamfile b/libs/python/build/Jamfile |
506 |
+index d03d4dd08..dbc9fb203 100644 |
507 |
+--- a/libs/python/build/Jamfile |
508 |
++++ b/libs/python/build/Jamfile |
509 |
+@@ -95,7 +95,7 @@ |
510 |
+ <dependency>config-warning |
511 |
+ <python-debugging>on:<define>BOOST_DEBUG_PYTHON |
512 |
+ -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag |
513 |
+- <tag>@$(__name__).python-tag |
514 |
++ <tag>@python-tag |
515 |
+ <conditional>@python.require-py |
516 |
+ |
517 |
+ : # default build |
518 |
+@@ -123,7 +123,7 @@ |
519 |
+ <library>boost_python |
520 |
+ <python-debugging>on:<define>BOOST_DEBUG_PYTHON |
521 |
+ -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag |
522 |
+- <tag>@$(__name__).python-tag |
523 |
++ <tag>@python-tag |
524 |
+ <conditional>@python.require-py |
525 |
+ |
526 |
+ : # default build |