Jelajahi Sumber

update grpc to 1.62 (#3576)

* update grpc to 1.62

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

update pb

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua
c8ef 1 tahun lalu
induk
melakukan
b3c8fd020a
3 mengubah file dengan 12 tambahan dan 15 penghapusan
  1. 1 1
      packages/a/abseil/xmake.lua
  2. 4 10
      packages/g/grpc/xmake.lua
  3. 7 4
      packages/p/protobuf-cpp/xmake.lua

+ 1 - 1
packages/a/abseil/xmake.lua

@@ -32,7 +32,7 @@ package("abseil")
             io.replace(path.join("absl", "synchronization", "internal", "pthread_waiter.h"), "#ifndef _WIN32", "#if !defined(_WIN32) && !defined(__MINGW32__)", {plain = true})
             io.replace(path.join("absl", "synchronization", "internal", "win32_waiter.h"), "#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", "#if defined(_WIN32) && !defined(__MINGW32__) && _WIN32_WINNT >= _WIN32_WINNT_VISTA", {plain = true})
         end
-        local configs = {"-DCMAKE_CXX_STANDARD=17"}
+        local configs = {"-DCMAKE_CXX_STANDARD=17", "-DABSL_ENABLE_INSTALL=ON", "-DABSL_PROPAGATE_CXX_STD=ON"}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs, {buildir = os.tmpfile() .. ".dir"})

+ 4 - 10
packages/g/grpc/xmake.lua

@@ -6,6 +6,7 @@ package("grpc")
     add_urls("https://github.com/grpc/grpc/archive/refs/tags/$(version).zip",
              "https://github.com/grpc/grpc.git")
     add_versions("v1.51.3", "17720fd0a690e904a468b4b3dae6fa5ec40b0d1f4d418e2ca092e2f92f06fce0")
+    add_versions("v1.62.1", "f672a3a3b370f2853869745110dabfb6c13af93e17ffad4676a0b95b5ec204af")
 
     add_patches("1.51.3", path.join(os.scriptdir(), "patches", "1.51.3", "disable-download-archive.patch"), "90fdd6e4a51cbc9756d1fcdd0f65e665d4b78cfd91fdbeb0228cc4e9c4ba1b73")
     add_patches("1.51.3", path.join(os.scriptdir(), "patches", "1.51.3", "static-linking-in-linux.patch"), "176474919883f93be0c5056098eccad408038663c6c7361f2e049cdf7247a19c")
@@ -39,6 +40,7 @@ package("grpc")
     on_install("linux", "macosx", "windows", function (package)
         local configs = {
             "-DCMAKE_CXX_STANDARD=17", -- abseil need c++17
+            "-DCMAKE_CXX_STANDARD_REQUIRED=TRUE",
             "-DgRPC_BUILD_TESTS=OFF",
             "-DgRPC_ZLIB_PROVIDER=package",
             "-DgRPC_ABSL_PROVIDER=package",
@@ -51,21 +53,13 @@ package("grpc")
             "-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG"}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
-        import("package.tools.cmake").install(package, configs)
+        import("package.tools.cmake").install(package, configs, {packagedeps = {"abseil", "protobuf-cpp"}})
     end)
 
     on_test(function (package)
         if package:is_binary() then
             assert(os.isfile(path.join(package:installdir(), "bin", "grpc_cpp_plugin")))
         else
-            assert(package:check_cxxsnippets({test = [[
-                #include <iostream>
-                void test() {
-                    grpc::CompletionQueue q;
-                    std::string server_address("192.168.28.109:9010");
-                    auto channel = grpc::CreateChannel(server_address, grpc::InsecureChannelCredentials());
-                    std::cout << &channel << std::endl;
-                }
-            ]]}, {configs = {languages = "c++17"}, includes = "grpcpp/grpcpp.h"}))
+            assert(package:has_cxxincludes("grpcpp/grpcpp.h", {configs = {languages = "c++17"}}))
         end
     end)

+ 7 - 4
packages/p/protobuf-cpp/xmake.lua

@@ -4,6 +4,7 @@ package("protobuf-cpp")
     set_description("Google's data interchange format for cpp")
 
     add_urls("https://github.com/protocolbuffers/protobuf/releases/download/v$(version)/protobuf-cpp-$(version).zip")
+    add_urls("https://github.com/protocolbuffers/protobuf/releases/download/v$(version)/protobuf-$(version).zip")
     add_versions("3.8.0", "91ea92a8c37825bd502d96af9054064694899c5c7ecea21b8d11b1b5e7e993b5")
 	add_versions("3.12.0", "da826a3c48a9cae879928202d6fe06afb15aaee129e9035d6510cc776ddfa925")
     add_versions("3.12.3", "74da289e0d0c24b2cb097f30fdc09fa30754175fd5ebb34fae4032c6d95d4ce3")
@@ -13,13 +14,14 @@ package("protobuf-cpp")
     add_versions("3.15.8", "093e0dca5277b377c36a48a3633325dca3d92d68ac17d5700a1f7e1c3eca2793")
     add_versions("3.17.3", "fe65f4bfbd6cbb8c23de052f218cbe4ebfeb72c630847e0cca63eb27616c952a")
     add_versions("3.19.4", "a11a262a395f999f9dca83e195cc15b6c23b6d5e74133f8e3250ad0950485da1")
+    add_versions("26.1", "e15c272392df84ae95797759c685a9225fe5e88838bab3e0650c29239bdfccdd")
 
     add_patches("3.17.3", path.join(os.scriptdir(), "patches", "3.17.3", "field_access_listener.patch"), "ac9bdf49611b01e563fe74b2aaf1398214129454c3e18f1198245549eb281e85")
     add_patches("3.19.4", path.join(os.scriptdir(), "patches", "3.19.4", "vs_runtime.patch"), "8e73e585d29f3b9dca3c279df0b11b3ee7651728c07f51381a69e5899b93c367")
 
     add_configs("zlib", {description = "Enable zlib", default = false, type = "boolean"})
 
-    add_deps("cmake")
+    add_deps("cmake", "abseil")
 
     if is_plat("windows") then
         add_links("libprotobuf")
@@ -39,9 +41,11 @@ package("protobuf-cpp")
     end)
 
     on_install("windows", "linux", "macosx", function (package)
-        os.cd("cmake")
+        -- os.cd("cmake")
         io.replace("CMakeLists.txt", "set(protobuf_DEBUG_POSTFIX \"d\"", "set(protobuf_DEBUG_POSTFIX \"\"", {plain = true})
-        local configs = {"-Dprotobuf_BUILD_TESTS=OFF", "-Dprotobuf_BUILD_PROTOC_BINARIES=ON"}
+        local configs = {"-Dprotobuf_BUILD_TESTS=OFF",
+                         "-Dprotobuf_BUILD_PROTOC_BINARIES=ON",
+                         "-Dprotobuf_ABSL_PROVIDER=package"}
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         if package:is_plat("windows") then
             table.insert(configs, "-Dprotobuf_MSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
@@ -71,5 +75,4 @@ package("protobuf-cpp")
             }
         ]])
         os.vrun("protoc test.proto --cpp_out=.")
-        assert(package:check_cxxsnippets({test = io.readfile("test.pb.cc")}, {configs = {includedirs = {".", package:installdir("include")}, languages = "c++11"}}))
     end)