Bläddra i källkod

update asio2 to 2.9 (#4400)

* update asio2 to 2.9

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* improve xmake.lua

* Update xmake.lua

---------

Co-authored-by: star9029 <[email protected]>
xpxz 1 år sedan
förälder
incheckning
1a33bbd2fd
2 ändrade filer med 29 tillägg och 4 borttagningar
  1. 22 0
      packages/a/asio2/patches/2.9/remove-const.patch
  2. 7 4
      packages/a/asio2/xmake.lua

+ 22 - 0
packages/a/asio2/patches/2.9/remove-const.patch

@@ -0,0 +1,22 @@
+From 34bb2c023d60d22e4b1a31750d9b649d7729209e Mon Sep 17 00:00:00 2001
+From: xpxz <[email protected]>
+Date: Wed, 19 Jun 2024 14:08:48 +0800
+Subject: [PATCH] remove const in set_to_text_limit
+
+---
+ include/asio2/http/detail/flex_body.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/asio2/http/detail/flex_body.hpp b/include/asio2/http/detail/flex_body.hpp
+index 491f5b8a..18e682db 100644
+--- a/include/asio2/http/detail/flex_body.hpp
++++ b/include/asio2/http/detail/flex_body.hpp
+@@ -136,7 +136,7 @@ class basic_flex_body<TextBody, FileBody>::value_type
+ 	inline bool is_text() const noexcept { return !is_file();      }
+ 	inline bool is_file() const noexcept { return file_.is_open(); }
+ 
+-    inline void set_to_text_limit(std::uint64_t v) const noexcept
++    inline void set_to_text_limit(std::uint64_t v) noexcept
+     {
+         this->to_text_limit_ = v;
+     }

+ 7 - 4
packages/a/asio2/xmake.lua

@@ -1,17 +1,20 @@
 package("asio2")
-
     set_kind("library", {headeronly = true})
     set_homepage("https://github.com/zhllxt/asio2")
     set_description("Header only c++ network library, based on asio, support tcp,udp,http,websocket,rpc,ssl,icmp,serial_port.")
     set_license("BSL-1.0")
 
-    add_urls("https://github.com/zhllxt/asio2.git")
-    add_versions("2023.05.09", "ac8c79964d79020091e38fcbb4ae9dccccb3b03c")
+    add_urls("https://github.com/zhllxt/asio2/archive/refs/tags/$(version).zip",
+             "https://github.com/zhllxt/asio2.git")
+
+    add_versions("v2.9", "3ce0b41300954ffc13948bd51af6430e324b1c28e26d2eb5a83e775cf38c12b4")
+
+    add_patches("2.9", "patches/2.9/remove-const.patch", "6326f333ab2d0484c23bb3cd9cfd5a565030b5525d083677565a693f5f8803b6")
 
     add_deps("asio", "cereal", "fmt", "openssl3")
     add_deps("spdlog", { configs = { header_only = false, fmt_external = true } })
 
-    on_install("windows", "linux", "macosx", "mingw", "bsd", function (package)
+    on_install("windows", "linux", "macosx", "mingw", "bsd", "cross", function (package)
         os.cp(path.join("include", "*"), package:installdir("include"))
     end)