From 513a33a6432b3737d3b27d8276e32ebcadfcbeda Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Fri, 12 May 2023 17:12:55 +0800
Subject: [PATCH] add loongarch64 support for prost-build

---
 ...-loongarch64-support-for-prost-build.patch | 24 +++++++++++++++++++
 vendor/prost-build/.cargo-checksum.json       |  2 +-
 vendor/prost-build/build.rs                   |  1 +
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 0001-add-loongarch64-support-for-prost-build.patch

diff --git a/0001-add-loongarch64-support-for-prost-build.patch b/0001-add-loongarch64-support-for-prost-build.patch
new file mode 100644
index 0000000..bdf12ba
--- /dev/null
+++ b/0001-add-loongarch64-support-for-prost-build.patch
@@ -0,0 +1,24 @@
+From ec95826dbb862419b631f8ac1b638fab1c40604c Mon Sep 17 00:00:00 2001
+From: Wenlong Zhang <zhangwenlong@loongson.cn>
+Date: Fri, 12 May 2023 17:12:55 +0800
+Subject: [PATCH] add loongarch64 support for prost-build
+
+---
+ vendor/prost-build/build.rs | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/vendor/prost-build/build.rs b/vendor/prost-build/build.rs
+index 6f3b0bf..24014b4 100644
+--- a/vendor/prost-build/build.rs
++++ b/vendor/prost-build/build.rs
+@@ -48,6 +48,7 @@ fn bundled_protoc() -> Option<PathBuf> {
+         ("linux", "x86") => "protoc-linux-x86_32",
+         ("linux", "x86_64") => "protoc-linux-x86_64",
+         ("linux", "aarch64") => "protoc-linux-aarch_64",
++        ("linux", "loongarch64") => "protoc-linux-loongarch_64",
+         ("macos", "x86_64") => "protoc-osx-x86_64",
+         ("windows", _) => "protoc-win32.exe",
+         _ => return None,
+-- 
+2.33.0
+
diff --git a/vendor/prost-build/.cargo-checksum.json b/vendor/prost-build/.cargo-checksum.json
index 8ec5939..30a17af 100644
--- a/vendor/prost-build/.cargo-checksum.json
+++ b/vendor/prost-build/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"520efe6811357bda5521ddf64e5093cdbf2e185c97ffc4a70c5c7d33c272e39c","README.md":"094d454ce347d8fbd4c70e6f79f082e7b6dfa4c9dbb381e5639037b88462c5d1","build.rs":"dcb015749ac7e222dc227982f2889519e328c4f6ccf48c09bc369c4216151af9","src/ast.rs":"c577e41ee140d8d2414cda49bf9b098d821a0a34f16cda7be45f2cec72f8edd5","src/code_generator.rs":"f957be408e3e795c5c59bf41af0ea742797569ca0e2c4fbbd4680d405e2ce4fe","src/extern_paths.rs":"a634f7ee45ae6e1d6d12ff3e9956f5244bdd4f7c5ff7bca6895b5dbb905bbc33","src/ident.rs":"bf6d6294f4ab6626632ba1e0f96b7acdc080cbb0b345619a0f07a9e6bcd3c0ae","src/lib.rs":"03cb4e8cb1188ee327595126884d8c778bbc22acca10f445f84ab89431810faf","src/message_graph.rs":"a21dbdc600e928fd9cbf8cbfbb90c685d12d0cf49d7972495d445e459a91f1fc","src/smoke_test.proto":"05068c3db3f1df2d5737eaaec730e42e3e58eb1d533df630fcb3dc138c7d8c9b","third-party/protobuf/LICENSE":"af67c58de2e18677a0b8cb5fffbe2232aabb8eb2930e8cd684769cef3d74a262","third-party/protobuf/README.md":"678126b0e9bc281ccff096d37726167e54ed8a53b8970b525104ed888ad54b7d","third-party/protobuf/include/google/protobuf/any.proto":"fbf886b5d2f6ac6872acfd61b2ab60f0abe1ecd8f359ed2e2b1276295ec5529a","third-party/protobuf/include/google/protobuf/api.proto":"dc01037a072410e5f7cd08c52fb6415acd6707b59ace2dfb4df878a6e016f9b8","third-party/protobuf/include/google/protobuf/compiler/plugin.proto":"63881dd80d7ddc345d5cc4dd495f6fc0a73fc475cedfc79c78c284ad0b3e8618","third-party/protobuf/include/google/protobuf/descriptor.proto":"7b98a2ab76635880b9fb9c830ea5feeeb43fd902e2532e779efd51e179b61c35","third-party/protobuf/include/google/protobuf/duration.proto":"933001db4a42dba2b99b4c6663b83c8ae0965765a5cbb6ca5da7bbc587741388","third-party/protobuf/include/google/protobuf/empty.proto":"b18e0cd44e0d054202c1403c48327180f3995d08ead2a6d4d012c0551a7a3563","third-party/protobuf/include/google/protobuf/field_mask.proto":"355146e9d480db65632f28a6fe59f6d9649a197c06e1a7b9198f113dcd773925","third-party/protobuf/include/google/protobuf/source_context.proto":"64ac204d47270547bde952a1c7a202d0af0c955292a21f513ef269f6f8a0c78d","third-party/protobuf/include/google/protobuf/struct.proto":"82b23cc319988977fd61eca7b6ad8f17269b36522ca24a06dde374005fa74353","third-party/protobuf/include/google/protobuf/timestamp.proto":"ea8f706782105b6e8150400a4d61895caad81bd6f3c8566f82d46b843bea21d2","third-party/protobuf/include/google/protobuf/type.proto":"e007d8d8763d564ea4724712cc737c60573a411c46572167c0236ec621d21de1","third-party/protobuf/include/google/protobuf/wrappers.proto":"0d0c7cf568359354d6fec5ddb63d80716807625cb13d3a69f5144742257eb1f9","third-party/protobuf/protoc-linux-aarch_64":"0213b5560ac69c9fe1401e073648213ffb73fbffa920e82c2b652708c0b50f88","third-party/protobuf/protoc-linux-x86_32":"bb189ba95422f9e3b85bb8270661ec4cfe70640891cb223acfbf6a90511ff95b","third-party/protobuf/protoc-linux-x86_64":"6ae3cdb31dc68d257f63ce8109b10b944c507ce7dfd493a66fc357e38062cd47","third-party/protobuf/protoc-osx-x86_64":"fd289988a18c461bc9e5c314c55d6a363ebede51a0e854a3b2d32da918a891eb","third-party/protobuf/protoc-win32.exe":"5b7121b3f1cd57efc2396b12605a3c4095770445c9637e0aab0d92a8a10c2482"},"package":"eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e"}
\ No newline at end of file
+{"files":{"Cargo.toml":"520efe6811357bda5521ddf64e5093cdbf2e185c97ffc4a70c5c7d33c272e39c","README.md":"094d454ce347d8fbd4c70e6f79f082e7b6dfa4c9dbb381e5639037b88462c5d1","build.rs":"2dec13595e93d55defb5df55da8a2397a7f66e965653405ff035b275f553fce9","src/ast.rs":"c577e41ee140d8d2414cda49bf9b098d821a0a34f16cda7be45f2cec72f8edd5","src/code_generator.rs":"f957be408e3e795c5c59bf41af0ea742797569ca0e2c4fbbd4680d405e2ce4fe","src/extern_paths.rs":"a634f7ee45ae6e1d6d12ff3e9956f5244bdd4f7c5ff7bca6895b5dbb905bbc33","src/ident.rs":"bf6d6294f4ab6626632ba1e0f96b7acdc080cbb0b345619a0f07a9e6bcd3c0ae","src/lib.rs":"03cb4e8cb1188ee327595126884d8c778bbc22acca10f445f84ab89431810faf","src/message_graph.rs":"a21dbdc600e928fd9cbf8cbfbb90c685d12d0cf49d7972495d445e459a91f1fc","src/smoke_test.proto":"05068c3db3f1df2d5737eaaec730e42e3e58eb1d533df630fcb3dc138c7d8c9b","third-party/protobuf/LICENSE":"af67c58de2e18677a0b8cb5fffbe2232aabb8eb2930e8cd684769cef3d74a262","third-party/protobuf/README.md":"678126b0e9bc281ccff096d37726167e54ed8a53b8970b525104ed888ad54b7d","third-party/protobuf/include/google/protobuf/any.proto":"fbf886b5d2f6ac6872acfd61b2ab60f0abe1ecd8f359ed2e2b1276295ec5529a","third-party/protobuf/include/google/protobuf/api.proto":"dc01037a072410e5f7cd08c52fb6415acd6707b59ace2dfb4df878a6e016f9b8","third-party/protobuf/include/google/protobuf/compiler/plugin.proto":"63881dd80d7ddc345d5cc4dd495f6fc0a73fc475cedfc79c78c284ad0b3e8618","third-party/protobuf/include/google/protobuf/descriptor.proto":"7b98a2ab76635880b9fb9c830ea5feeeb43fd902e2532e779efd51e179b61c35","third-party/protobuf/include/google/protobuf/duration.proto":"933001db4a42dba2b99b4c6663b83c8ae0965765a5cbb6ca5da7bbc587741388","third-party/protobuf/include/google/protobuf/empty.proto":"b18e0cd44e0d054202c1403c48327180f3995d08ead2a6d4d012c0551a7a3563","third-party/protobuf/include/google/protobuf/field_mask.proto":"355146e9d480db65632f28a6fe59f6d9649a197c06e1a7b9198f113dcd773925","third-party/protobuf/include/google/protobuf/source_context.proto":"64ac204d47270547bde952a1c7a202d0af0c955292a21f513ef269f6f8a0c78d","third-party/protobuf/include/google/protobuf/struct.proto":"82b23cc319988977fd61eca7b6ad8f17269b36522ca24a06dde374005fa74353","third-party/protobuf/include/google/protobuf/timestamp.proto":"ea8f706782105b6e8150400a4d61895caad81bd6f3c8566f82d46b843bea21d2","third-party/protobuf/include/google/protobuf/type.proto":"e007d8d8763d564ea4724712cc737c60573a411c46572167c0236ec621d21de1","third-party/protobuf/include/google/protobuf/wrappers.proto":"0d0c7cf568359354d6fec5ddb63d80716807625cb13d3a69f5144742257eb1f9","third-party/protobuf/protoc-linux-aarch_64":"0213b5560ac69c9fe1401e073648213ffb73fbffa920e82c2b652708c0b50f88","third-party/protobuf/protoc-linux-x86_32":"bb189ba95422f9e3b85bb8270661ec4cfe70640891cb223acfbf6a90511ff95b","third-party/protobuf/protoc-linux-x86_64":"6ae3cdb31dc68d257f63ce8109b10b944c507ce7dfd493a66fc357e38062cd47","third-party/protobuf/protoc-osx-x86_64":"fd289988a18c461bc9e5c314c55d6a363ebede51a0e854a3b2d32da918a891eb","third-party/protobuf/protoc-win32.exe":"5b7121b3f1cd57efc2396b12605a3c4095770445c9637e0aab0d92a8a10c2482"},"package":"eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e"}
diff --git a/vendor/prost-build/build.rs b/vendor/prost-build/build.rs
index 6f3b0bf..24014b4 100644
--- a/vendor/prost-build/build.rs
+++ b/vendor/prost-build/build.rs
@@ -48,6 +48,7 @@ fn bundled_protoc() -> Option<PathBuf> {
         ("linux", "x86") => "protoc-linux-x86_32",
         ("linux", "x86_64") => "protoc-linux-x86_64",
         ("linux", "aarch64") => "protoc-linux-aarch_64",
+        ("linux", "loongarch64") => "protoc-linux-loongarch_64",
         ("macos", "x86_64") => "protoc-osx-x86_64",
         ("windows", _) => "protoc-win32.exe",
         _ => return None,
-- 
2.33.0

