diff --git a/packages/i/icu4c/patches/72.1/mingw.patch b/packages/i/icu4c/patches/72.1/mingw.patch new file mode 100644 index 000000000..13111bcd8 --- /dev/null +++ b/packages/i/icu4c/patches/72.1/mingw.patch @@ -0,0 +1,54 @@ +diff --git a/source/config/mh-mingw b/source/config/mh-mingw +index 30f6e5b..7cadf9d 100644 +--- a/source/config/mh-mingw ++++ b/source/config/mh-mingw +@@ -15,11 +15,6 @@ + # If you prefer to have the DLLs in the lib folder, then set this to NO instead. + MINGW_MOVEDLLSTOBINDIR = YES + +-# We install sbin tools into the same bin directory because +-# pkgdata needs some of the tools in sbin, and we can't always depend on +-# icu-config working on Windows. +-sbindir=$(bindir) +- + ## Commands to generate dependency files + GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) + GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) +@@ -81,6 +76,10 @@ else + SO_TARGET_VERSION_SUFFIX = + endif + ++## Remove shared library 's' ++STATIC_PREFIX_WHEN_USED = ++STATIC_PREFIX = ++ + # Static library prefix and file extension + LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX) + A = a +diff --git a/source/config/mh-mingw64 b/source/config/mh-mingw64 +index fb64c56..40b436a 100644 +--- a/source/config/mh-mingw64 ++++ b/source/config/mh-mingw64 +@@ -15,11 +15,6 @@ MINGW_MOVEDLLSTOBINDIR = YES + # This file is similar to mh-mingw + # Any changes made here may also need to be made in mh-mingw + +-# We install sbin tools into the same bin directory because +-# pkgdata needs some of the tools in sbin, and we can't always depend on +-# icu-config working on Windows. +-sbindir=$(bindir) +- + ## Commands to generate dependency files + GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) + GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) +@@ -81,6 +76,10 @@ else + SO_TARGET_VERSION_SUFFIX = + endif + ++## Remove shared library 's' ++STATIC_PREFIX_WHEN_USED = ++STATIC_PREFIX = ++ + # Static library prefix and file extension + LIBSICU = lib$(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX) + A = a diff --git a/packages/i/icu4c/xmake.lua b/packages/i/icu4c/xmake.lua index 1947942e5..3114acb68 100644 --- a/packages/i/icu4c/xmake.lua +++ b/packages/i/icu4c/xmake.lua @@ -16,8 +16,17 @@ 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("72.1", path.join(os.scriptdir(), "patches", "72.1", "mingw.patch"), "9ddbe7f691224ccf69f8c0218f788f0a39ab8f1375cc9aad2cc92664ffcf46a5") + end + + add_links("icuuc", "icutu", "icui18n", "icuio") + if is_plat("mingw") then + add_links("icudt") + else + add_links("icudata") + end - add_links("icuuc", "icutu", "icui18n", "icuio", "icudata") if is_plat("linux") then add_syslinks("dl") end @@ -36,7 +45,7 @@ package("icu4c") package:addenv("PATH", "bin") end) - on_install("macosx", "linux", function (package) + on_install("macosx", "linux", "mingw@msys", function (package) import("package.tools.autoconf") os.cd("source") @@ -52,6 +61,9 @@ package("icu4c") table.insert(configs, "--disable-shared") table.insert(configs, "--enable-static") end + if package:is_plat("mingw") then + table.insert(configs, "--with-data-packaging=dll") + end local envs = {} if package:is_plat("linux") and package:config("pic") ~= false then