1 |
commit: a275799528a1109e58d7191ead0959a8a570cd7a |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 15 02:49:59 2021 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 15 02:50:43 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2757995 |
7 |
|
8 |
dev-python/grpcio: don't pass gnu99 to cxx |
9 |
|
10 |
Closes: https://bugs.gentoo.org/730228 |
11 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
12 |
|
13 |
.../grpcio/files/1.37.1-cc-flag-test-fix.patch | 26 ++++++++++++++++ |
14 |
dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch | 35 ++++++++++++++++++++++ |
15 |
dev-python/grpcio/grpcio-1.37.1.ebuild | 5 ++++ |
16 |
dev-python/grpcio/grpcio-1.38.0.ebuild | 2 ++ |
17 |
4 files changed, 68 insertions(+) |
18 |
|
19 |
diff --git a/dev-python/grpcio/files/1.37.1-cc-flag-test-fix.patch b/dev-python/grpcio/files/1.37.1-cc-flag-test-fix.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..0869c57dd11 |
22 |
--- /dev/null |
23 |
+++ b/dev-python/grpcio/files/1.37.1-cc-flag-test-fix.patch |
24 |
@@ -0,0 +1,26 @@ |
25 |
+From c21ddf679bf46c0a13046060f17d7a87608923e3 Mon Sep 17 00:00:00 2001 |
26 |
+From: Georgy Yakovlev <gyakovlev@g.o> |
27 |
+Date: Mon, 14 Jun 2021 19:38:37 -0700 |
28 |
+Subject: [PATCH] fix cc flag test |
29 |
+ |
30 |
+--- |
31 |
+ src/python/grpcio/commands.py | 3 ++- |
32 |
+ 1 file changed, 2 insertions(+), 1 deletion(-) |
33 |
+ |
34 |
+diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py |
35 |
+index df8fc46..de71ea5 100644 |
36 |
+--- a/src/python/grpcio/commands.py |
37 |
++++ b/src/python/grpcio/commands.py |
38 |
+@@ -234,7 +234,8 @@ class BuildExt(build_ext.build_ext): |
39 |
+ """ |
40 |
+ try: |
41 |
+ # TODO(lidiz) Remove the generated a.out for success tests. |
42 |
+- cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', '-'], |
43 |
++ cc = os.environ.get('CC', 'cc') |
44 |
++ cc_test = subprocess.Popen([cc, '-x', 'c', '-std=c++11', '-'], |
45 |
+ stdin=subprocess.PIPE, |
46 |
+ stdout=subprocess.PIPE, |
47 |
+ stderr=subprocess.PIPE) |
48 |
+-- |
49 |
+2.32.0 |
50 |
+ |
51 |
|
52 |
diff --git a/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch b/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch |
53 |
new file mode 100644 |
54 |
index 00000000000..71e02eafeb6 |
55 |
--- /dev/null |
56 |
+++ b/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch |
57 |
@@ -0,0 +1,35 @@ |
58 |
+From 05ae3c5a87ba1037bd4c7a94e6b574c8df847065 Mon Sep 17 00:00:00 2001 |
59 |
+From: Lidi Zheng <lidiz@××××××.com> |
60 |
+Date: Tue, 6 Apr 2021 06:50:40 -0700 |
61 |
+Subject: [PATCH] Remove -std=gnu99 CFlag when compiling C++ with clang |
62 |
+ (#25778) |
63 |
+ |
64 |
+* Remove -std=gnu99 CFlag when compiling C++ with clang |
65 |
+ |
66 |
+* Use endswith instead of hard-coded slices |
67 |
+ |
68 |
+* Fix a typo |
69 |
+--- |
70 |
+ src/python/grpcio/commands.py | 6 +++++- |
71 |
+ 1 file changed, 5 insertions(+), 1 deletion(-) |
72 |
+ |
73 |
+diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py |
74 |
+index f4a3d2bdc041..df8fc46a3cad 100644 |
75 |
+--- a/src/python/grpcio/commands.py |
76 |
++++ b/src/python/grpcio/commands.py |
77 |
+@@ -258,10 +258,14 @@ def compiler_ok_with_extra_std(): |
78 |
+ old_compile = self.compiler._compile |
79 |
+ |
80 |
+ def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts): |
81 |
+- if src[-2:] == '.c': |
82 |
++ if src.endswith('.c'): |
83 |
+ extra_postargs = [ |
84 |
+ arg for arg in extra_postargs if not '-std=c++' in arg |
85 |
+ ] |
86 |
++ elif src.endswith('.cc') or src.endswith('.cpp'): |
87 |
++ extra_postargs = [ |
88 |
++ arg for arg in extra_postargs if not '-std=gnu99' in arg |
89 |
++ ] |
90 |
+ return old_compile(obj, src, ext, cc_args, extra_postargs, |
91 |
+ pp_opts) |
92 |
+ |
93 |
|
94 |
diff --git a/dev-python/grpcio/grpcio-1.37.1.ebuild b/dev-python/grpcio/grpcio-1.37.1.ebuild |
95 |
index 9516150c799..4c178de93a2 100644 |
96 |
--- a/dev-python/grpcio/grpcio-1.37.1.ebuild |
97 |
+++ b/dev-python/grpcio/grpcio-1.37.1.ebuild |
98 |
@@ -27,6 +27,11 @@ RDEPEND=" |
99 |
|
100 |
DEPEND="${RDEPEND}" |
101 |
|
102 |
+PATCHES=( |
103 |
+ "${FILESDIR}/1.37.1-cxx-no-gnu99.patch" |
104 |
+ "${FILESDIR}/1.37.1-cc-flag-test-fix.patch" |
105 |
+) |
106 |
+ |
107 |
python_prepare_all() { |
108 |
distutils-r1_python_prepare_all |
109 |
hprefixify setup.py |
110 |
|
111 |
diff --git a/dev-python/grpcio/grpcio-1.38.0.ebuild b/dev-python/grpcio/grpcio-1.38.0.ebuild |
112 |
index 9a037a3b070..016123e4194 100644 |
113 |
--- a/dev-python/grpcio/grpcio-1.38.0.ebuild |
114 |
+++ b/dev-python/grpcio/grpcio-1.38.0.ebuild |
115 |
@@ -27,6 +27,8 @@ RDEPEND=" |
116 |
|
117 |
DEPEND="${RDEPEND}" |
118 |
|
119 |
+PATCHES=( "${FILESDIR}/1.37.1-cc-flag-test-fix.patch" ) |
120 |
+ |
121 |
python_prepare_all() { |
122 |
distutils-r1_python_prepare_all |
123 |
hprefixify setup.py |