dev-libs/boost: Fix Boost.MPI with python

* A big thanks goes out to @pdimov in helping me patch
  Boost.Build to produce per py-impl MPI variants.

Closes: boostorg/mpi#112
Closes: https://bugs.gentoo.org/703036
Package-Manager: Portage-2.3.82, Repoman-2.3.20
Signed-off-by: David Seifert <soap@gentoo.org>
This commit is contained in:
David Seifert
2019-12-23 00:12:28 +01:00
parent 0e82aefd5c
commit af50ab943b
2 changed files with 70 additions and 1 deletions

View File

@@ -56,6 +56,8 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.71.0-build-auto_index-tool.patch
# Bug 703294, incomplete Boost.Serialization refactoring
"${FILESDIR}"/${PN}-1.72.0-missing-serialization-split_member-include.patch
# Bug 703036, per python-impl Boost.MPI
"${FILESDIR}"/${PN}-1.72.0-boost-mpi-python.patch
)
python_bindings_needed() {
@@ -217,7 +219,24 @@ multilib_src_install_all() {
rm -r "${ED}"/usr/include/boost/python/numpy* || die
fi
if ! use python; then
if use python; then
if use mpi; then
move_mpi_py_into_sitedir() {
local pyver="${EPYTHON#python}"
python_moduleinto boost
python_domodule "${ED}"/usr/$(get_libdir)/mpi${pyver/./}.so
rm "${ED}"/usr/$(get_libdir)/mpi${pyver/./}* || die
dosym mpi${pyver/./}.so $(python_get_sitedir)/boost/mpi.so
# create a proper python package
touch "${D}"/$(python_get_sitedir)/boost/__init__.py || die
python_optimize
}
python_foreach_impl move_mpi_py_into_sitedir
else
rm -r "${ED}"/usr/include/boost/mpi/python* || die
fi
else
rm -r "${ED}"/usr/include/boost/{python*,mpi/python*,parameter/aux_/python,parameter/python*} || die
fi

View File

@@ -0,0 +1,50 @@
Tag Boost.MPI python impls properly to avoid name clash
https://github.com/boostorg/mpi/issues/112
--- a/boostcpp.jam
+++ b/boostcpp.jam
@@ -185,7 +185,7 @@
rule tag ( name : type ? : property-set )
{
- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
+ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION
{
local args = $(.format-name-args) ;
if $(layout) = versioned
@@ -223,7 +223,7 @@
{
local result = $(name) ;
- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
+ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION
{
# Add Python version suffix
--- a/libs/mpi/build/Jamfile.v2
+++ b/libs/mpi/build/Jamfile.v2
@@ -58,13 +58,13 @@
rule python-tag ( name : type ? : property-set )
{
local result = $(name) ;
- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
+ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION
{
local version = [ $(property-set).get <python> ] ;
local lib-suffix = [ version-suffix $(version) ] ;
result = $(result)$(lib-suffix) ;
}
- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB && $(PYTHON_ID)
+ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION && $(PYTHON_ID)
{
result = $(result)-$(PYTHON_ID) ;
}
@@ -168,6 +168,8 @@
<link>shared:<define>BOOST_PYTHON_DYN_LINK=1
<link>shared <runtime-link>shared
<python-debugging>on:<define>BOOST_DEBUG_PYTHON
+ -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
+ <tag>@$(__name__).python-tag
;
mpi_python_libs = boost_mpi_python mpi ;