Jelajahi Sumber

Auto-update drogon to v1.9.11 (#7504)

* Update drogon to v1.9.11

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* fix openssl syslinks

* Update xmake.lua

---------

Co-authored-by: star9029 <[email protected]>
ruki 1 bulan lalu
induk
melakukan
5c7dee1d37
2 mengubah file dengan 27 tambahan dan 10 penghapusan
  1. 26 9
      packages/d/drogon/xmake.lua
  2. 1 1
      packages/t/trantor/xmake.lua

+ 26 - 9
packages/d/drogon/xmake.lua

@@ -6,6 +6,7 @@ package("drogon")
     add_urls("https://github.com/an-tao/drogon/archive/refs/tags/$(version).tar.gz",
              "https://github.com/an-tao/drogon.git", {submodules = false})
 
+    add_versions("v1.9.11", "f50098bb21bd0013f8da16b796313816bf79b0ecb1d74bfe33216d5400ab2002")
     add_versions("v1.9.10", "5de93fe16682388f363bb4b26ab00b0253d39108d8e7f53d5637c1b7da59a48f")
     add_versions("v1.9.9", "4155f78196902ef2f9d06b708897c9e8acaa1536cc4a8c8da9726ceb8ada2aaf")
     add_versions("v1.9.8", "62332a4882cc7db1c7cf04391b65c91ddf6fcbb49af129fc37eb0130809e0449")
@@ -53,7 +54,7 @@ package("drogon")
 
     add_deps("cmake")
     add_deps("jsoncpp", "brotli", "zlib")
-    if not is_plat("windows") then
+    if not is_plat("windows", "mingw", "msys") then
         add_deps("libuuid")
     end
 
@@ -61,10 +62,18 @@ package("drogon")
         -- enable mtt for drogon
         set_policy("package.msbuild.multi_tool_task", true)
         add_syslinks("ws2_32", "rpcrt4", "crypt32", "advapi32", "iphlpapi")
-    elseif is_plat("linux") then
+    elseif is_plat("mingw") then
+        add_syslinks("ws2_32", "rpcrt4", "crypt32", "advapi32", "iphlpapi")
+    elseif is_plat("linux", "bsd") then
         add_syslinks("pthread", "dl")
     end
 
+    if on_check then
+        on_check("wasm", function (target)
+            raise("package(drogon) dep(openssl) unsupported platform")
+        end)
+    end
+
     on_load(function(package)
         local configdeps = {c_ares     = "c-ares",
                             mysql      = "mariadb-connector-c",
@@ -79,7 +88,7 @@ package("drogon")
                 package:add("deps", dep)
             end
         end
-        if package:version():le("v1.9.2") then
+        if package:version() and package:version():le("v1.9.2") then
             package:config_set("spdlog", false)
         end
         if package:config("spdlog") then
@@ -90,14 +99,17 @@ package("drogon")
         end
     end)
 
-    on_install("windows", "macosx", "linux", function (package)
-        if package:is_plat("macosx") and package:is_arch("x86_64") then
-            wprint([[package(drogon) unsupported cmake4 on macos/x86, please use `add_requireconfs("**.cmake", {override = true, version = "<4.0.0"})`]])
-        end
-
+    on_install("!android", function (package)
         io.replace("cmake/templates/config.h.in", "\"@COMPILATION_FLAGS@@DROGON_CXX_STANDARD@\"", "R\"(@COMPILATION_FLAGS@@DROGON_CXX_STANDARD@)\"", {plain = true})
         io.replace("cmake_modules/FindMySQL.cmake", "PATH_SUFFIXES mysql", "PATH_SUFFIXES mysql mariadb", {plain = true})
 
+        local trantor = package:dep("trantor")
+        if (not trantor:is_system() and not trantor:config("shared")) or package:config("openssl") then
+            if package:is_plat("windows", "mingw") then
+                io.replace("CMakeLists.txt", "Trantor::Trantor", "Trantor::Trantor ws2_32 user32 crypt32 advapi32", {plain = true})
+            end
+        end
+
         local configs = {
             "-DBUILD_EXAMPLES=OFF",
             "-DUSE_SUBMODULE=OFF",
@@ -113,7 +125,7 @@ package("drogon")
                 if name == "sqlite3" then
                     table.insert(configs, "-DBUILD_SQLITE=" .. (enabled and "ON" or "OFF"))
                 elseif name == "yaml" then
-                    if package:version():ge("1.8.4") then
+                    if package:version() and package:version():ge("1.8.4") then
                         table.insert(configs, "-DBUILD_YAML_CONFIG=" .. (enabled and "ON" or "OFF"))
                     end
                 elseif name == "cpp20" then
@@ -123,6 +135,11 @@ package("drogon")
                 end
             end
         end
+
+        local openssl = package:dep("openssl")
+        if not openssl:is_system() then
+            table.insert(configs, "-DOPENSSL_ROOT_DIR=" .. openssl:installdir())
+        end
         import("package.tools.cmake").install(package, configs)
     end)
 

+ 1 - 1
packages/t/trantor/xmake.lua

@@ -72,7 +72,7 @@ package("trantor")
         local openssl = package:dep("openssl")
         if not openssl:is_system() then
             table.insert(configs, "-DOPENSSL_ROOT_DIR=" .. openssl:installdir())
-            if package:is_plat("macosx") then
+            if not package:is_cross() and is_subhost("macosx", "msys") then
                 opt.cxflags = "-I" .. openssl:installdir("include")
             end
         end