1 |
commit: 75e0f119f85b8115b69e74a24b27b50df527f9cd |
2 |
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org> |
3 |
AuthorDate: Tue Oct 2 19:50:26 2018 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 2 20:07:26 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75e0f119 |
7 |
|
8 |
dev-python/protobuf-python: Support Python 3.7. |
9 |
|
10 |
Closes: https://bugs.gentoo.org/664508 |
11 |
|
12 |
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org> |
13 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
14 |
|
15 |
.../files/protobuf-python-3.6.1-python-3.7.patch | 67 ++++++++++++++++++++++ |
16 |
.../protobuf-python/protobuf-python-3.6.1.ebuild | 3 +- |
17 |
2 files changed, 69 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/dev-python/protobuf-python/files/protobuf-python-3.6.1-python-3.7.patch b/dev-python/protobuf-python/files/protobuf-python-3.6.1-python-3.7.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..bd4ce9d7fca |
22 |
--- /dev/null |
23 |
+++ b/dev-python/protobuf-python/files/protobuf-python-3.6.1-python-3.7.patch |
24 |
@@ -0,0 +1,67 @@ |
25 |
+https://github.com/protocolbuffers/protobuf/pull/4862 |
26 |
+https://github.com/protocolbuffers/protobuf/commit/0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7 |
27 |
+ |
28 |
+--- /python/google/protobuf/pyext/descriptor.cc |
29 |
++++ /python/google/protobuf/pyext/descriptor.cc |
30 |
+@@ -56,7 +56,7 @@ |
31 |
+ #endif |
32 |
+ #define PyString_AsStringAndSize(ob, charpp, sizep) \ |
33 |
+ (PyUnicode_Check(ob)? \ |
34 |
+- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ |
35 |
++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ |
36 |
+ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) |
37 |
+ #endif |
38 |
+ |
39 |
+--- /python/google/protobuf/pyext/descriptor_containers.cc |
40 |
++++ /python/google/protobuf/pyext/descriptor_containers.cc |
41 |
+@@ -66,7 +66,7 @@ |
42 |
+ #endif |
43 |
+ #define PyString_AsStringAndSize(ob, charpp, sizep) \ |
44 |
+ (PyUnicode_Check(ob)? \ |
45 |
+- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ |
46 |
++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ |
47 |
+ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) |
48 |
+ #endif |
49 |
+ |
50 |
+--- /python/google/protobuf/pyext/descriptor_pool.cc |
51 |
++++ /python/google/protobuf/pyext/descriptor_pool.cc |
52 |
+@@ -48,7 +48,7 @@ |
53 |
+ #endif |
54 |
+ #define PyString_AsStringAndSize(ob, charpp, sizep) \ |
55 |
+ (PyUnicode_Check(ob)? \ |
56 |
+- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ |
57 |
++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ |
58 |
+ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) |
59 |
+ #endif |
60 |
+ |
61 |
+--- /python/google/protobuf/pyext/extension_dict.cc |
62 |
++++ /python/google/protobuf/pyext/extension_dict.cc |
63 |
+@@ -53,7 +53,7 @@ |
64 |
+ #endif |
65 |
+ #define PyString_AsStringAndSize(ob, charpp, sizep) \ |
66 |
+ (PyUnicode_Check(ob)? \ |
67 |
+- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ |
68 |
++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ |
69 |
+ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) |
70 |
+ #endif |
71 |
+ |
72 |
+--- /python/google/protobuf/pyext/message.cc |
73 |
++++ /python/google/protobuf/pyext/message.cc |
74 |
+@@ -79,7 +79,7 @@ |
75 |
+ (PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AsString(ob)) |
76 |
+ #define PyString_AsStringAndSize(ob, charpp, sizep) \ |
77 |
+ (PyUnicode_Check(ob)? \ |
78 |
+- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ |
79 |
++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ |
80 |
+ PyBytes_AsStringAndSize(ob, (charpp), (sizep))) |
81 |
+ #endif |
82 |
+ #endif |
83 |
+@@ -1529,7 +1529,7 @@ |
84 |
+ return NULL; |
85 |
+ } |
86 |
+ #else |
87 |
+- field_name = PyUnicode_AsUTF8AndSize(arg, &size); |
88 |
++ field_name = const_cast<char*>(PyUnicode_AsUTF8AndSize(arg, &size)); |
89 |
+ if (!field_name) { |
90 |
+ return NULL; |
91 |
+ } |
92 |
|
93 |
diff --git a/dev-python/protobuf-python/protobuf-python-3.6.1.ebuild b/dev-python/protobuf-python/protobuf-python-3.6.1.ebuild |
94 |
index d2f29ce98df..3d8397734fc 100644 |
95 |
--- a/dev-python/protobuf-python/protobuf-python-3.6.1.ebuild |
96 |
+++ b/dev-python/protobuf-python/protobuf-python-3.6.1.ebuild |
97 |
@@ -2,7 +2,7 @@ |
98 |
# Distributed under the terms of the GNU General Public License v2 |
99 |
|
100 |
EAPI="6" |
101 |
-PYTHON_COMPAT=(python{2_7,3_4,3_5,3_6}) |
102 |
+PYTHON_COMPAT=(python{2_7,3_4,3_5,3_6,3_7}) |
103 |
|
104 |
inherit distutils-r1 |
105 |
|
106 |
@@ -27,6 +27,7 @@ S="${WORKDIR}/protobuf-${PV}/python" |
107 |
|
108 |
python_prepare_all() { |
109 |
eapply -p2 "${FILESDIR}/${PN}-3.5.2-google.protobuf.pyext._message.MessageMeta.patch" |
110 |
+ eapply -p2 "${FILESDIR}/${PN}-3.6.1-python-3.7.patch" |
111 |
distutils-r1_python_prepare_all |
112 |
} |