depends: protobuf: don't use android system logging

This commit is contained in:
tobtoht
2026-08-26 21:39:33 +02:00
parent 454075bc61
commit cd8beb75b9
3 changed files with 28 additions and 1 deletions
+5
View File
@@ -5,6 +5,7 @@ $(package)_download_path=$(native_$(package)_download_path)
$(package)_file_name=$(native_$(package)_file_name)
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
$(package)_dependencies=native_$(package)
$(package)_patches=no-android-logging.patch
define $(package)_set_vars
$(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc
@@ -15,6 +16,10 @@ define $(package)_config_cmds
$($(package)_autoconf) AR_FLAGS=$($(package)_arflags)
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/no-android-logging.patch
endef
define $(package)_build_cmds
$(MAKE) -C src libprotobuf.la
endef
@@ -0,0 +1,22 @@
diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc
index e0a807f..7f2e7e7 100644
--- a/src/google/protobuf/stubs/common.cc
+++ b/src/google/protobuf/stubs/common.cc
@@ -45,7 +45,7 @@
#include <windows.h>
#define snprintf _snprintf // see comment in strutil.cc
#endif
-#if defined(__ANDROID__)
+#if 0
#include <android/log.h>
#endif
@@ -121,7 +121,7 @@ std::string VersionString(int version) {
namespace internal {
-#if defined(__ANDROID__)
+#if 0
inline void DefaultLogHandler(LogLevel level, const char* filename, int line,
const std::string& message) {
if (level < GOOGLE_PROTOBUF_MIN_LOG_LEVEL) {
+1 -1
View File
@@ -75,7 +75,7 @@ if(DEVICE_TREZOR_READY)
message(STATUS "Trezor: debugging enabled")
endif()
if(ANDROID)
if(ANDROID AND NOT DEPENDS)
set(TREZOR_EXTRA_LIBRARIES "log")
endif()