Skip to content

Commit 3ba9f10

Browse files
committed
icu: export C API on MinGW
1 parent f80ad7b commit 3ba9f10

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 0a92e43809209c210cf77a4d63a255e4093ea73f Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
3+
Date: Fri, 6 Jun 2025 09:42:02 +0200
4+
Subject: [PATCH] Add visibility attributes for MinGW.
5+
6+
---
7+
source/common/unicode/platform.h | 4 ++++
8+
source/config/icu.pc.in | 1 +
9+
2 files changed, 5 insertions(+)
10+
11+
diff --git a/source/common/unicode/platform.h b/source/common/unicode/platform.h
12+
index 45741a83deb..60be4987eb2 100644
13+
--- a/source/common/unicode/platform.h
14+
+++ b/source/common/unicode/platform.h
15+
@@ -780,6 +780,8 @@
16+
#elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \
17+
UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
18+
# define U_EXPORT __declspec(dllexport)
19+
+#elif defined (_WIN32) || defined (__CYGWIN__)
20+
+# define U_EXPORT __attribute__ ((dllexport))
21+
#elif defined(__GNUC__) || defined(__open_xl__)
22+
# define U_EXPORT __attribute__((visibility("default")))
23+
#elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \
24+
@@ -806,6 +808,8 @@
25+
UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__))
26+
/* Windows needs to export/import data. */
27+
# define U_IMPORT __declspec(dllimport)
28+
+#elif defined (_WIN32) || defined (__CYGWIN__)
29+
+# define U_IMPORT __attribute__ ((dllimport))
30+
#else
31+
# define U_IMPORT
32+
#endif
33+
diff --git a/source/config/icu.pc.in b/source/config/icu.pc.in
34+
index 4d8db206c2b..9adc2e208a1 100644
35+
--- a/source/config/icu.pc.in
36+
+++ b/source/config/icu.pc.in
37+
@@ -33,4 +33,5 @@ ICUDESC=International Components for Unicode
38+
39+
Version: @VERSION@
40+
Cflags: -I${includedir}
41+
+Cflags.private: -DU_STATIC_IMPLEMENTATION
42+
# end of icu.pc.in
43+
--
44+
2.47.1.windows.2
45+

mingw-w64-icu/PKGBUILD

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _realname=icu
66
pkgbase=mingw-w64-${_realname}
77
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
88
pkgver=77.1
9-
pkgrel=1
9+
pkgrel=2
1010
arch=('any')
1111
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
1212
pkgdesc="International Components for Unicode library (mingw-w64)"
@@ -21,7 +21,8 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
2121
"${MINGW_PACKAGE_PREFIX}-autotools"
2222
"autoconf-archive")
2323
source=(https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-src.tgz
24-
https://sources.debian.org/data/main/i/icu/76.1-3/debian/patches/reverse_of_ICU-22610.patch
24+
https://sources.debian.org/data/main/i/icu/76.1-4/debian/patches/reverse_of_ICU-22610.patch
25+
0001-Add-visibility-attributes-for-MinGW.patch
2526
0011-sbin-dir.mingw.patch
2627
0012-libprefix.mingw.patch
2728
0014-mingwize-pkgdata.mingw.patch
@@ -31,6 +32,7 @@ source=(https://github.com/unicode-org/icu/releases/download/release-${pkgver//.
3132
0023-fix-twice-include-platform_make_fragment.patch)
3233
sha256sums=('588e431f77327c39031ffbb8843c0e3bc122c211374485fa87dc5f3faff24061'
3334
'c515e2b37e230895080d36207dfe078eb638f974220baa487ede2593e820944c'
35+
'6537454d4f94bb25fb61aec2d9138d443cbba49122e64f0be154f92d739085f7'
3436
'4f4787caeccf70607cf0cbde0c005f05f5c6de1543265a927839122405b4054f'
3537
'e7ecdafe85e18a4a4b5f29bbfde38776521a848e5b65089a2379b90e59f1592d'
3638
'd9f5f756443d7d14175aca06f4f1bb33237b58907e5db7a6ff7e38d2c4ea7957'
@@ -54,6 +56,7 @@ prepare() {
5456

5557
apply_patch_with_msg \
5658
reverse_of_ICU-22610.patch \
59+
0001-Add-visibility-attributes-for-MinGW.patch \
5760
0011-sbin-dir.mingw.patch \
5861
0012-libprefix.mingw.patch \
5962
0014-mingwize-pkgdata.mingw.patch \

0 commit comments

Comments
 (0)