git: c212fb9fccea - main - devel/py-grpcio-tools: update to 1.49.1, also fix building on i386.

From: Vanilla I. Shu <vanilla_at_FreeBSD.org>
Date: Sat, 01 Oct 2022 14:53:00 UTC
The branch main has been updated by vanilla:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c212fb9fcceacf49ac4f236c7944aaec5d3cfa57

commit c212fb9fcceacf49ac4f236c7944aaec5d3cfa57
Author:     Vanilla I. Shu <vanilla@FreeBSD.org>
AuthorDate: 2022-10-01 14:48:20 +0000
Commit:     Vanilla I. Shu <vanilla@FreeBSD.org>
CommitDate: 2022-10-01 14:52:09 +0000

    devel/py-grpcio-tools: update to 1.49.1, also fix building on i386.
---
 devel/py-grpcio-tools/Makefile                     |  2 +-
 devel/py-grpcio-tools/distinfo                     |  6 ++---
 devel/py-grpcio-tools/files/patch-setup.py         | 29 ++++++++++++++++++++++
 ...arty_protobuf_src_google_protobuf_arena__impl.h | 11 ++++++++
 4 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/devel/py-grpcio-tools/Makefile b/devel/py-grpcio-tools/Makefile
index fc7498dfefe8..eba564cbe266 100644
--- a/devel/py-grpcio-tools/Makefile
+++ b/devel/py-grpcio-tools/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	grpcio-tools
-PORTVERSION=	1.49.0
+PORTVERSION=	1.49.1
 CATEGORIES=	devel python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
diff --git a/devel/py-grpcio-tools/distinfo b/devel/py-grpcio-tools/distinfo
index 82ca0c0a8b98..9dcfdfa0e887 100644
--- a/devel/py-grpcio-tools/distinfo
+++ b/devel/py-grpcio-tools/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1663507524
-SHA256 (grpcio-tools-1.49.0.tar.gz) = 16ac93ac515194f63febcf6f8a96a7f17390268972acc15e765d257f5008f2af
-SIZE (grpcio-tools-1.49.0.tar.gz) = 2238106
+TIMESTAMP = 1664077947
+SHA256 (grpcio-tools-1.49.1.tar.gz) = 84cc64e5b46bad43d5d7bd2fd772b656eba0366961187a847e908e2cb735db91
+SIZE (grpcio-tools-1.49.1.tar.gz) = 2252679
diff --git a/devel/py-grpcio-tools/files/patch-setup.py b/devel/py-grpcio-tools/files/patch-setup.py
new file mode 100644
index 000000000000..05e7375feb7d
--- /dev/null
+++ b/devel/py-grpcio-tools/files/patch-setup.py
@@ -0,0 +1,29 @@
+--- setup.py.orig	2022-10-01 13:52:51 UTC
++++ setup.py
+@@ -149,7 +149,7 @@ if EXTRA_ENV_COMPILE_ARGS is None:
+             # We need to statically link the C++ Runtime, only the C runtime is
+             # available dynamically
+             EXTRA_ENV_COMPILE_ARGS += ' /MT'
+-    elif "linux" in sys.platform or "darwin" in sys.platform:
++    elif "linux" in sys.platform or "darwin" in sys.platform or "freebsd" in sys.platform:
+         EXTRA_ENV_COMPILE_ARGS += ' -fno-wrapv -frtti'
+ if EXTRA_ENV_LINK_ARGS is None:
+     EXTRA_ENV_LINK_ARGS = ''
+@@ -175,7 +175,7 @@ if EXTRA_ENV_LINK_ARGS is None:
+     if "darwin" in sys.platform:
+         EXTRA_ENV_LINK_ARGS += ' -Wl,-exported_symbol,_{}'.format(
+             _EXT_INIT_SYMBOL)
+-    if "linux" in sys.platform or "darwin" in sys.platform:
++    if "linux" in sys.platform or "darwin" in sys.platform or "freebsd" in sys.platform:
+         EXTRA_ENV_LINK_ARGS += ' -lpthread'
+         if check_linker_need_libatomic():
+             EXTRA_ENV_LINK_ARGS += ' -latomic'
+@@ -206,7 +206,7 @@ if "win32" in sys.platform:
+     DEFINE_MACROS += (('WIN32_LEAN_AND_MEAN', 1),)
+     if '64bit' in platform.architecture()[0]:
+         DEFINE_MACROS += (('MS_WIN64', 1),)
+-elif "linux" in sys.platform or "darwin" in sys.platform:
++elif "linux" in sys.platform or "darwin" in sys.platform or "freebsd" in sys.platform:
+     DEFINE_MACROS += (('HAVE_PTHREAD', 1),)
+ 
+ # By default, Python3 distutils enforces compatibility of
diff --git a/devel/py-grpcio-tools/files/patch-third__party_protobuf_src_google_protobuf_arena__impl.h b/devel/py-grpcio-tools/files/patch-third__party_protobuf_src_google_protobuf_arena__impl.h
new file mode 100644
index 000000000000..f96fda395196
--- /dev/null
+++ b/devel/py-grpcio-tools/files/patch-third__party_protobuf_src_google_protobuf_arena__impl.h
@@ -0,0 +1,11 @@
+--- third_party/protobuf/src/google/protobuf/arena_impl.h.orig	2022-09-25 04:12:11 UTC
++++ third_party/protobuf/src/google/protobuf/arena_impl.h
+@@ -640,7 +640,7 @@ class PROTOBUF_EXPORT ThreadSafeArena {
+ #ifdef _MSC_VER
+ #pragma warning(disable : 4324)
+ #endif
+-  struct alignas(kCacheAlignment) CacheAlignedLifecycleIdGenerator {
++  struct alignas(alignof(std::atomic<LifecycleIdAtomic>)) CacheAlignedLifecycleIdGenerator {
+     std::atomic<LifecycleIdAtomic> id;
+   };
+   static CacheAlignedLifecycleIdGenerator lifecycle_id_generator_;