Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1f949c
commit 049a305
Showing
7 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
patches/extras/0002-libjsonpbparse-Fix-build-after-protobuf-util-Status-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From aba6bdbbe26285c5bee14c88a514995e4c0e99d1 Mon Sep 17 00:00:00 2001 | ||
From: MoetaYuko <loli@yuko.moe> | ||
Date: Fri, 10 Dec 2021 17:36:31 +0800 | ||
Subject: [PATCH] libjsonpbparse: Fix build after protobuf util::Status | ||
refactorization | ||
|
||
--- | ||
libjsonpb/parse/jsonpb.cpp | 8 ++++++++ | ||
1 file changed, 8 insertions(+) | ||
|
||
diff --git a/libjsonpb/parse/jsonpb.cpp b/libjsonpb/parse/jsonpb.cpp | ||
index 3a042e7..62d651d 100644 | ||
--- a/libjsonpb/parse/jsonpb.cpp | ||
+++ b/libjsonpb/parse/jsonpb.cpp | ||
@@ -48,7 +48,11 @@ ErrorOr<std::string> MessageToJsonString(const Message& message) { | ||
&json, options); | ||
|
||
if (!status.ok()) { | ||
+#if GOOGLE_PROTOBUF_VERSION < 3016000 | ||
return MakeError<std::string>(status.error_message().as_string()); | ||
+#else | ||
+ return MakeError<std::string>(status.message().as_string()); | ||
+#endif | ||
} | ||
return ErrorOr<std::string>(std::move(json)); | ||
} | ||
@@ -61,7 +65,11 @@ ErrorOr<std::monostate> JsonStringToMessage(const std::string& content, Message* | ||
std::string binary; | ||
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()); | ||
+#else | ||
+ return MakeError<std::monostate>(status.message().as_string()); | ||
+#endif | ||
} | ||
if (!message->ParseFromString(binary)) { | ||
return MakeError<std::monostate>("Fail to parse."); |
21 changes: 21 additions & 0 deletions
21
patches/extras/0003-lpadd-Add-missing-header-for-strerror.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
From 70d3294a12f05aea953cae415810345f516d778d Mon Sep 17 00:00:00 2001 | ||
From: MoetaYuko <loli@yuko.moe> | ||
Date: Fri, 10 Dec 2021 17:43:17 +0800 | ||
Subject: [PATCH] lpadd: Add missing header for strerror | ||
|
||
--- | ||
partition_tools/lpadd.cc | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/partition_tools/lpadd.cc b/partition_tools/lpadd.cc | ||
index 48cad72..2d19059 100644 | ||
--- a/partition_tools/lpadd.cc | ||
+++ b/partition_tools/lpadd.cc | ||
@@ -16,6 +16,7 @@ | ||
#include <sysexits.h> | ||
#include <unistd.h> | ||
|
||
+#include <cstring> | ||
#include <iostream> | ||
#include <optional> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
add_library(liblp STATIC | ||
core/fs_mgr/liblp/builder.cpp | ||
core/fs_mgr/liblp/images.cpp | ||
core/fs_mgr/liblp/partition_opener.cpp | ||
core/fs_mgr/liblp/property_fetcher.cpp | ||
core/fs_mgr/liblp/reader.cpp | ||
core/fs_mgr/liblp/utility.cpp | ||
core/fs_mgr/liblp/writer.cpp) | ||
|
||
target_link_libraries(liblp PRIVATE | ||
libbase libext4 libsparse crypto z) | ||
target_include_directories(liblp PRIVATE | ||
boringssl/include) | ||
target_include_directories(liblp PUBLIC | ||
core/fs_mgr/liblp/include) | ||
|
||
protobuf_generate_cpp(DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_SRCS DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_HDRS | ||
extras/partition_tools/dynamic_partitions_device_info.proto) | ||
|
||
add_library(libjsonpbparse STATIC | ||
extras/libjsonpb/parse/jsonpb.cpp) | ||
target_link_libraries(libjsonpbparse PRIVATE libbase) | ||
target_include_directories(libjsonpbparse PUBLIC | ||
extras/libjsonpb/parse/include) | ||
|
||
add_library(liblpdump STATIC | ||
${DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_SRCS} ${DYNAMIC_PARTITIONS_DEVICE_INFO_PROTO_HDRS} | ||
extras/partition_tools/lpdump.cc) | ||
target_link_libraries(liblpdump PRIVATE | ||
libbase libjsonpbparse liblp ${PROTOBUF_LIBRARIES}) | ||
|
||
add_executable(lpdump | ||
extras/partition_tools/lpdump_host.cc) | ||
target_link_libraries(lpdump | ||
libbase liblpdump libsparse) | ||
|
||
add_executable(lpmake | ||
extras/partition_tools/lpmake.cc) | ||
target_link_libraries(lpmake | ||
libbase liblog liblp libsparse) | ||
|
||
add_executable(lpadd | ||
extras/partition_tools/lpadd.cc) | ||
target_link_libraries(lpadd | ||
libbase liblog liblp libsparse) | ||
|
||
add_executable(lpflash | ||
extras/partition_tools/lpflash.cc) | ||
target_link_libraries(lpflash | ||
libbase liblog liblp libsparse) | ||
|
||
add_executable(lpunpack | ||
extras/partition_tools/lpunpack.cc) | ||
target_link_libraries(lpunpack | ||
libbase liblog liblp libsparse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters