aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-12-14 16:22:26 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-12-14 17:03:03 +0000
commitcb3185cf986089a8cc3f2b1c7bd2b75c220db169 (patch)
tree7d14a4a6fbb6439828aa61e6b1a2df3bf45a219f
parent6e980054b5f371e5d5512613fa79445863e90f68 (diff)
downloadports-cb3185cf986089a8cc3f2b1c7bd2b75c220db169.tar.gz
ports-cb3185cf986089a8cc3f2b1c7bd2b75c220db169.zip
devel/android-tools: Fix build with protobuf 22+
-rw-r--r--devel/android-tools/Makefile3
-rw-r--r--devel/android-tools/files/patch-abseil26
2 files changed, 28 insertions, 1 deletions
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)) {