1 |
commit: af50ab943bce9e10c97e47ea5c7da87e11b51be9 |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 22 23:12:28 2019 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 22 23:12:28 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af50ab94 |
7 |
|
8 |
dev-libs/boost: Fix Boost.MPI with python |
9 |
|
10 |
* A big thanks goes out to @pdimov in helping me patch |
11 |
Boost.Build to produce per py-impl MPI variants. |
12 |
|
13 |
Closes: boostorg/mpi#112 |
14 |
Closes: https://bugs.gentoo.org/703036 |
15 |
Package-Manager: Portage-2.3.82, Repoman-2.3.20 |
16 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
17 |
|
18 |
dev-libs/boost/boost-1.72.0.ebuild | 21 ++++++++- |
19 |
.../files/boost-1.72.0-boost-mpi-python.patch | 50 ++++++++++++++++++++++ |
20 |
2 files changed, 70 insertions(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/dev-libs/boost/boost-1.72.0.ebuild b/dev-libs/boost/boost-1.72.0.ebuild |
23 |
index ca52c5105fe..3417b408e43 100644 |
24 |
--- a/dev-libs/boost/boost-1.72.0.ebuild |
25 |
+++ b/dev-libs/boost/boost-1.72.0.ebuild |
26 |
@@ -56,6 +56,8 @@ PATCHES=( |
27 |
"${FILESDIR}"/${PN}-1.71.0-build-auto_index-tool.patch |
28 |
# Bug 703294, incomplete Boost.Serialization refactoring |
29 |
"${FILESDIR}"/${PN}-1.72.0-missing-serialization-split_member-include.patch |
30 |
+ # Bug 703036, per python-impl Boost.MPI |
31 |
+ "${FILESDIR}"/${PN}-1.72.0-boost-mpi-python.patch |
32 |
) |
33 |
|
34 |
python_bindings_needed() { |
35 |
@@ -217,7 +219,24 @@ multilib_src_install_all() { |
36 |
rm -r "${ED}"/usr/include/boost/python/numpy* || die |
37 |
fi |
38 |
|
39 |
- if ! use python; then |
40 |
+ if use python; then |
41 |
+ if use mpi; then |
42 |
+ move_mpi_py_into_sitedir() { |
43 |
+ local pyver="${EPYTHON#python}" |
44 |
+ python_moduleinto boost |
45 |
+ python_domodule "${ED}"/usr/$(get_libdir)/mpi${pyver/./}.so |
46 |
+ rm "${ED}"/usr/$(get_libdir)/mpi${pyver/./}* || die |
47 |
+ dosym mpi${pyver/./}.so $(python_get_sitedir)/boost/mpi.so |
48 |
+ |
49 |
+ # create a proper python package |
50 |
+ touch "${D}"/$(python_get_sitedir)/boost/__init__.py || die |
51 |
+ python_optimize |
52 |
+ } |
53 |
+ python_foreach_impl move_mpi_py_into_sitedir |
54 |
+ else |
55 |
+ rm -r "${ED}"/usr/include/boost/mpi/python* || die |
56 |
+ fi |
57 |
+ else |
58 |
rm -r "${ED}"/usr/include/boost/{python*,mpi/python*,parameter/aux_/python,parameter/python*} || die |
59 |
fi |
60 |
|
61 |
|
62 |
diff --git a/dev-libs/boost/files/boost-1.72.0-boost-mpi-python.patch b/dev-libs/boost/files/boost-1.72.0-boost-mpi-python.patch |
63 |
new file mode 100644 |
64 |
index 00000000000..8fb164a6278 |
65 |
--- /dev/null |
66 |
+++ b/dev-libs/boost/files/boost-1.72.0-boost-mpi-python.patch |
67 |
@@ -0,0 +1,50 @@ |
68 |
+Tag Boost.MPI python impls properly to avoid name clash |
69 |
+https://github.com/boostorg/mpi/issues/112 |
70 |
+ |
71 |
+--- a/boostcpp.jam |
72 |
++++ b/boostcpp.jam |
73 |
+@@ -185,7 +185,7 @@ |
74 |
+ |
75 |
+ rule tag ( name : type ? : property-set ) |
76 |
+ { |
77 |
+- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB |
78 |
++ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION |
79 |
+ { |
80 |
+ local args = $(.format-name-args) ; |
81 |
+ if $(layout) = versioned |
82 |
+@@ -223,7 +223,7 @@ |
83 |
+ { |
84 |
+ local result = $(name) ; |
85 |
+ |
86 |
+- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB |
87 |
++ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION |
88 |
+ { |
89 |
+ # Add Python version suffix |
90 |
+ |
91 |
+--- a/libs/mpi/build/Jamfile.v2 |
92 |
++++ b/libs/mpi/build/Jamfile.v2 |
93 |
+@@ -58,13 +58,13 @@ |
94 |
+ rule python-tag ( name : type ? : property-set ) |
95 |
+ { |
96 |
+ local result = $(name) ; |
97 |
+- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB |
98 |
++ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION |
99 |
+ { |
100 |
+ local version = [ $(property-set).get <python> ] ; |
101 |
+ local lib-suffix = [ version-suffix $(version) ] ; |
102 |
+ result = $(result)$(lib-suffix) ; |
103 |
+ } |
104 |
+- if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB && $(PYTHON_ID) |
105 |
++ if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB PYTHON_EXTENSION && $(PYTHON_ID) |
106 |
+ { |
107 |
+ result = $(result)-$(PYTHON_ID) ; |
108 |
+ } |
109 |
+@@ -168,6 +168,8 @@ |
110 |
+ <link>shared:<define>BOOST_PYTHON_DYN_LINK=1 |
111 |
+ <link>shared <runtime-link>shared |
112 |
+ <python-debugging>on:<define>BOOST_DEBUG_PYTHON |
113 |
++ -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag |
114 |
++ <tag>@$(__name__).python-tag |
115 |
+ ; |
116 |
+ |
117 |
+ mpi_python_libs = boost_mpi_python mpi ; |