git: cb3185cf9860 - main - devel/android-tools: Fix build with protobuf 22+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Thu, 14 Dec 2023 17:03:24 UTC
The branch main has been updated by sunpoet:

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

commit cb3185cf986089a8cc3f2b1c7bd2b75c220db169
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-12-14 16:22:26 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-12-14 17:03:03 +0000

    devel/android-tools: Fix build with protobuf 22+
---
 devel/android-tools/Makefile           |  3 ++-
 devel/android-tools/files/patch-abseil | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/devel/android-tools/Makefile b/devel/android-tools/Makefile
index f447e07430ca..34635918b5b2 100644
--- a/devel/android-tools/Makefile
+++ b/devel/android-tools/Makefile
@@ -20,7 +20,7 @@ LIB_DEPENDS=	libbrotlicommon.so:archivers/brotli \
 		libprotobuf.so:devel/protobuf \
 		libzstd.so:archivers/zstd
 
-USES=		cmake go:no_targets perl5 python shebangfix
+USES=		cmake compiler:c++17-lang go:no_targets localbase:ldflags perl5 python shebangfix
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	neelchauhan
@@ -31,6 +31,7 @@ SHEBANG_FILES=	vendor/mkbootimg/repack_bootimg.py \
 		vendor/mkbootimg/mkbootimg.py \
 		vendor/mkbootimg/unpack_bootimg.py
 
+LDFLAGS+=	-labsl_status
 MAKE_ENV+=	GOFLAGS=-mod=vendor \
 		GOPATH=${WRKSRC}/vendor/boringssl/vendor \
 		GOPROXY=off
diff --git a/devel/android-tools/files/patch-abseil b/devel/android-tools/files/patch-abseil
new file mode 100644
index 000000000000..be949a6aa119
--- /dev/null
+++ b/devel/android-tools/files/patch-abseil
@@ -0,0 +1,26 @@
+--- vendor/extras/libjsonpb/parse/jsonpb.cpp.orig	2022-06-10 23:11:16 UTC
++++ vendor/extras/libjsonpb/parse/jsonpb.cpp
+@@ -49,9 +49,9 @@ ErrorOr<std::string> MessageToJsonString(const Message
+ 
+   if (!status.ok()) {
+ #if GOOGLE_PROTOBUF_VERSION < 3016000
+-    return MakeError<std::string>(status.error_message().as_string());
++    return MakeError<std::string>(std::string(status.error_message()));
+ #else
+-    return MakeError<std::string>(status.message().as_string());
++    return MakeError<std::string>(std::string(status.message()));
+ #endif
+   }
+   return ErrorOr<std::string>(std::move(json));
+@@ -66,9 +66,9 @@ ErrorOr<std::monostate> JsonStringToMessage(const std:
+   auto status = JsonToBinaryString(resolver.get(), GetTypeUrl(*message), content, &binary);
+   if (!status.ok()) {
+ #if GOOGLE_PROTOBUF_VERSION < 3016000
+-    return MakeError<std::monostate>(status.error_message().as_string());
++    return MakeError<std::monostate>(std::string(status.error_message()));
+ #else
+-    return MakeError<std::monostate>(status.message().as_string());
++    return MakeError<std::monostate>(std::string(status.message()));
+ #endif
+   }
+   if (!message->ParseFromString(binary)) {