Skip to content

Commit

Permalink
devel/android-tools: Fix build with protobuf 22+
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpoet committed Dec 14, 2023
1 parent 6e98005 commit cb3185c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion devel/android-tools/Makefile
Expand Up @@ -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
Expand All @@ -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
Expand Down
26 changes: 26 additions & 0 deletions 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)) {

0 comments on commit cb3185c

Please sign in to comment.