Răsfoiți Sursa

icu4c: Resolve patch application issue during cross-compilation in MSYS (#6902)

* icu4c: update to 77.1

* icu4c: use `package:is_debug()` instead of deprecated `package:debug()`

* icu4c: add support for the `iphoneos` platform

* icu4c: ensure patch is applied when building `icu4c~host` in MSYS

* icu4c: remove workaround for resolved issues
Doekin 5 luni în urmă
părinte
comite
8db5ff1c58
1 a modificat fișierele cu 11 adăugiri și 11 ștergeri
  1. 11 11
      packages/i/icu4c/xmake.lua

+ 11 - 11
packages/i/icu4c/xmake.lua

@@ -5,6 +5,7 @@ package("icu4c")
     add_urls("https://github.com/unicode-org/icu/releases/download/release-$(version)-src.tgz", {version = function (version)
             return (version:gsub("%.", "-")) .. "/icu4c-" .. (version:gsub("%.", "_"))
         end})
+    add_versions("77.1", "588e431f77327c39031ffbb8843c0e3bc122c211374485fa87dc5f3faff24061")
     add_versions("76.1", "dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e")
     add_versions("75.1", "cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef")
     add_versions("73.2", "818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1")
@@ -19,9 +20,6 @@ package("icu4c")
 
     add_patches("69.1", path.join(os.scriptdir(), "patches", "69.1", "replace-py-3.patch"), "ae27a55b0e79a8420024d6d349a7bae850e1dd403a8e1131e711c405ddb099b9")
     add_patches("70.1", path.join(os.scriptdir(), "patches", "70.1", "replace-py-3.patch"), "6469739da001721122b62af513370ed62901caf43af127de3f27ea2128830e35")
-    if is_plat("mingw") then
-        add_patches(">=69.1", path.join(os.scriptdir(), "patches", "72.1", "mingw.patch"), "9ddbe7f691224ccf69f8c0218f788f0a39ab8f1375cc9aad2cc92664ffcf46a5")
-    end
 
     if is_plat("mingw") and is_subhost("msys") then
         add_extsources("pacman::icu")
@@ -41,6 +39,9 @@ package("icu4c")
     end
 
     on_load(function (package)
+        if package:is_plat("mingw", "msys", "cygwin") then
+            package:add("patches", ">=69.1", path.join(os.scriptdir(), "patches", "72.1", "mingw.patch"), "9ddbe7f691224ccf69f8c0218f788f0a39ab8f1375cc9aad2cc92664ffcf46a5")
+        end
         if package:is_cross() then
             package:add("deps", "icu4c~host", {kind = "binary", private = true})
         else
@@ -58,9 +59,9 @@ package("icu4c")
             end
         end
 
-        local libsuffix = package:is_debug() and package:is_plat("mingw", "windows") and "d" or ""
+        local libsuffix = package:is_debug() and package:is_plat("windows", "mingw", "msys", "cygwin") and "d" or ""
         package:add("links", "icutu" .. libsuffix, "icuio" .. libsuffix)
-        if package:is_plat("mingw", "windows") then
+        if package:is_plat("windows", "mingw", "msys", "cygwin") then
             package:add("links", "icuin" .. libsuffix, "icuuc" .. libsuffix, "icudt" .. libsuffix)
         else
             package:add("links", "icui18n" .. libsuffix, "icuuc" .. libsuffix, "icudata" .. libsuffix)
@@ -130,7 +131,7 @@ package("icu4c")
         os.vcp("lib" .. suffix .. "/*", package:installdir("lib"))
     end)
 
-    on_install("@!windows and !wasm and !iphoneos", function (package)
+    on_install("@!windows and !wasm", function (package)
         import("package.tools.autoconf")
 
         os.cd("source")
@@ -144,7 +145,7 @@ package("icu4c")
             end
         end
         local configs = {"--disable-samples", "--disable-tests"}
-        if package:debug() then
+        if package:is_debug() then
             table.insert(configs, "--enable-debug")
             table.insert(configs, "--disable-release")
         end
@@ -155,8 +156,10 @@ package("icu4c")
             table.insert(configs, "--disable-shared")
             table.insert(configs, "--enable-static")
         end
-        if package:is_plat("mingw") then
+        if package:is_plat("mingw", "msys", "cygwin") then
             table.insert(configs, "--with-data-packaging=dll")
+        elseif package:is_plat("iphoneos") then
+            table.insert(configs, "--disable-tools")
         end
         if package:is_cross() then
             table.insert(configs, "--with-cross-build=" .. path.unix(package:dep("icu4c"):installdir()))
@@ -171,9 +174,6 @@ package("icu4c")
         end
         -- suppress ar errors when passing --toolchain=clang
         envs.ARFLAGS = nil
-        if package:is_cross() and not envs.CXX then
-            envs.CXX = path.unix(package:build_getenv("cxx"))
-        end
         autoconf.install(package, configs, {envs = envs})
 
         if not package:is_cross() then