commit:     a275799528a1109e58d7191ead0959a8a570cd7a
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 15 02:49:59 2021 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Tue Jun 15 02:50:43 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2757995

dev-python/grpcio: don't pass gnu99 to cxx

Closes: https://bugs.gentoo.org/730228
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 .../grpcio/files/1.37.1-cc-flag-test-fix.patch     | 26 ++++++++++++++++
 dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch  | 35 ++++++++++++++++++++++
 dev-python/grpcio/grpcio-1.37.1.ebuild             |  5 ++++
 dev-python/grpcio/grpcio-1.38.0.ebuild             |  2 ++
 4 files changed, 68 insertions(+)

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
new file mode 100644
index 00000000000..0869c57dd11
--- /dev/null
+++ b/dev-python/grpcio/files/1.37.1-cc-flag-test-fix.patch
@@ -0,0 +1,26 @@
+From c21ddf679bf46c0a13046060f17d7a87608923e3 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakov...@gentoo.org>
+Date: Mon, 14 Jun 2021 19:38:37 -0700
+Subject: [PATCH] fix cc flag test
+
+---
+ src/python/grpcio/commands.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
+index df8fc46..de71ea5 100644
+--- a/src/python/grpcio/commands.py
++++ b/src/python/grpcio/commands.py
+@@ -234,7 +234,8 @@ class BuildExt(build_ext.build_ext):
+             """
+             try:
+                 # TODO(lidiz) Remove the generated a.out for success tests.
+-                cc_test = subprocess.Popen(['cc', '-x', 'c', '-std=c++11', 
'-'],
++                cc = os.environ.get('CC', 'cc')
++                cc_test = subprocess.Popen([cc, '-x', 'c', '-std=c++11', '-'],
+                                            stdin=subprocess.PIPE,
+                                            stdout=subprocess.PIPE,
+                                            stderr=subprocess.PIPE)
+-- 
+2.32.0
+

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
new file mode 100644
index 00000000000..71e02eafeb6
--- /dev/null
+++ b/dev-python/grpcio/files/1.37.1-cxx-no-gnu99.patch
@@ -0,0 +1,35 @@
+From 05ae3c5a87ba1037bd4c7a94e6b574c8df847065 Mon Sep 17 00:00:00 2001
+From: Lidi Zheng <li...@google.com>
+Date: Tue, 6 Apr 2021 06:50:40 -0700
+Subject: [PATCH] Remove -std=gnu99 CFlag when compiling C++ with clang
+ (#25778)
+
+* Remove -std=gnu99 CFlag when compiling C++ with clang
+
+* Use endswith instead of hard-coded slices
+
+* Fix a typo
+---
+ src/python/grpcio/commands.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
+index f4a3d2bdc041..df8fc46a3cad 100644
+--- a/src/python/grpcio/commands.py
++++ b/src/python/grpcio/commands.py
+@@ -258,10 +258,14 @@ def compiler_ok_with_extra_std():
+             old_compile = self.compiler._compile
+ 
+             def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
+-                if src[-2:] == '.c':
++                if src.endswith('.c'):
+                     extra_postargs = [
+                         arg for arg in extra_postargs if not '-std=c++' in arg
+                     ]
++                elif src.endswith('.cc') or src.endswith('.cpp'):
++                    extra_postargs = [
++                        arg for arg in extra_postargs if not '-std=gnu99' in 
arg
++                    ]
+                 return old_compile(obj, src, ext, cc_args, extra_postargs,
+                                    pp_opts)
+ 

diff --git a/dev-python/grpcio/grpcio-1.37.1.ebuild 
b/dev-python/grpcio/grpcio-1.37.1.ebuild
index 9516150c799..4c178de93a2 100644
--- a/dev-python/grpcio/grpcio-1.37.1.ebuild
+++ b/dev-python/grpcio/grpcio-1.37.1.ebuild
@@ -27,6 +27,11 @@ RDEPEND="
 
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+       "${FILESDIR}/1.37.1-cxx-no-gnu99.patch"
+       "${FILESDIR}/1.37.1-cc-flag-test-fix.patch"
+)
+
 python_prepare_all() {
        distutils-r1_python_prepare_all
        hprefixify setup.py

diff --git a/dev-python/grpcio/grpcio-1.38.0.ebuild 
b/dev-python/grpcio/grpcio-1.38.0.ebuild
index 9a037a3b070..016123e4194 100644
--- a/dev-python/grpcio/grpcio-1.38.0.ebuild
+++ b/dev-python/grpcio/grpcio-1.38.0.ebuild
@@ -27,6 +27,8 @@ RDEPEND="
 
 DEPEND="${RDEPEND}"
 
+PATCHES=( "${FILESDIR}/1.37.1-cc-flag-test-fix.patch" ) 
+
 python_prepare_all() {
        distutils-r1_python_prepare_all
        hprefixify setup.py

Reply via email to