Jelajahi Sumber

add libpsl for libcurl (#1981)

* add libpsl for libcurl

* support mingw for meson

* update libcurl
ruki 2 tahun lalu
induk
melakukan
cc9c86c0e6

+ 1 - 0
packages/l/libcurl/versions.lua

@@ -1,4 +1,5 @@
 function add_versions_list()
+    add_versions("8.0.1", "9b6b1e96b748d04b968786b6bdf407aa5c75ab53a3d37c1c8c81cdb736555ccf")
     add_versions("7.87.0", "5d6e128761b7110946d1276aff6f0f266f2b726f5e619f7e0a057a474155f307")
     add_versions("7.86.0", "f5ca69db03eea17fa8705bdfb1a9f58d76a46c9010518109bb38f313137e0a28")
     add_versions("7.85.0", "21a7e83628ee96164ac2b36ff6bf99d467c7b0b621c1f7e317d8f0d96011539c")

+ 9 - 6
packages/l/libcurl/xmake.lua

@@ -31,6 +31,7 @@ package("libcurl")
     add_configs("zstd",     {description = "Enable zstd support.", default = false, type = "boolean"})
     add_configs("brotli",   {description = "Enable brotli support.", default = false, type = "boolean"})
     add_configs("libssh2",  {description = "Use libSSH2 library.", default = false, type = "boolean"})
+    add_configs("libpsl",   {description = "Use libpsl library.", default = false, type = "boolean"})
 
     if not is_plat("windows", "mingw@windows") then
         add_configs("libpsl",   {description = "Use libpsl for Public Suffix List.", default = false, type = "boolean"})
@@ -52,7 +53,8 @@ package("libcurl")
                             zlib     = "zlib",
                             zstd     = "zstd",
                             brotli   = "brotli",
-                            libssh2  = "libssh2"}
+                            libssh2  = "libssh2",
+                            libpsl   = "libpsl"}
         local has_deps = false
         for name, dep in pairs(configdeps) do
             if package:config(name) then
@@ -73,9 +75,9 @@ package("libcurl")
         local version = package:version()
 
         if (package:is_plat("mingw") and version:ge("7.85")) then
-            package:add("syslinks", "Bcrypt")
+            package:add("syslinks", "bcrypt")
         end
-            
+
         local configopts = {cares    = "ENABLE_ARES",
                             openssl  = (version:ge("7.81") and "CURL_USE_OPENSSL" or "CMAKE_USE_OPENSSL"),
                             mbedtls  = (version:ge("7.81") and "CURL_USE_MBEDTLS" or "CMAKE_USE_MBEDTLS"),
@@ -85,7 +87,8 @@ package("libcurl")
                             zlib     = "CURL_ZLIB",
                             zstd     = "CURL_ZSTD",
                             brotli   = "CURL_BROTLI",
-                            libssh2  = (version:ge("7.81") and "CURL_USE_LIBSSH2" or "CMAKE_USE_LIBSSH2")}
+                            libssh2  = (version:ge("7.81") and "CURL_USE_LIBSSH2" or "CMAKE_USE_LIBSSH2"),
+                            libpsl   = "CURL_USE_LIBPSL"}
         for name, opt in pairs(configopts) do
             table.insert(configs, "-D" .. opt .. "=" .. (package:config(name) and "ON" or "OFF"))
         end
@@ -98,7 +101,7 @@ package("libcurl")
         import("package.tools.cmake").install(package, configs)
     end)
 
-    on_install("macosx", "linux", "iphoneos", "cross", function (package)
+    on_install("macosx", "linux", "cross", function (package)
         local configs = {"--disable-silent-rules",
                          "--disable-dependency-tracking",
                          "--without-hyper",
@@ -112,7 +115,7 @@ package("libcurl")
         if (package:is_plat("mingw") and version:ge("7.85")) then
             package:add("syslinks", "Bcrypt")
         end
-                
+
         table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
         table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
         if package:debug() then

+ 2 - 2
packages/l/libpsl/xmake.lua

@@ -8,7 +8,7 @@ package("libpsl")
     add_versions("0.21.1", "ac6ce1e1fbd4d0254c4ddb9d37f1fa99dec83619c1253328155206b896210d4c")
 
     add_deps("meson", "ninja")
-    if is_plat("windows") then
+    if is_plat("windows", "mingw") then
         add_syslinks("ws2_32")
     end
     on_load("windows", function (package)
@@ -17,7 +17,7 @@ package("libpsl")
         end
     end)
 
-    on_install("windows", "macosx", "linux", function (package)
+    on_install("windows", "macosx", "linux", "mingw", function (package)
         io.replace("meson.build", "subdir('tests')", "", {plain = true})
         io.replace("meson.build", "subdir('fuzz')", "", {plain = true})
         if package:is_plat("windows") and not package:config("shared") then

+ 1 - 1
packages/m/meson/xmake.lua

@@ -23,7 +23,7 @@ package("meson")
     -- https://github.com/xmake-io/xmake-repo/issues/1937
     set_policy("package.precompiled", false)
 
-    on_install("@macosx", "@linux", "@windows", function (package)
+    on_install("@macosx", "@linux", "@windows", "@msys", function (package)
         local envs = {PYTHONPATH = package:installdir()}
         local python = package:is_plat("windows") and "python" or "python3"
         os.vrunv(python, {"-m", "pip", "install", "--target=" .. package:installdir(), "."}, {envs = envs})