Commit a433482b authored by Timo Teräs's avatar Timo Teräs

main/icu: fix timezone usage

the icu configure script auto-detects proper timezone variable,
but it's never used, and the header #ifdef detection is horribly
broken. fix it for sane libc's.
parent 4819e6ab
......@@ -5,7 +5,7 @@ pkgver=51.2
# convert x.y.z to x_y_z
_ver=${pkgver//./_}
pkgrel=0
pkgrel=1
pkgdesc="International Components for Unicode library"
url="http://www.icu-project.org/"
arch="all"
......@@ -14,13 +14,15 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
depends=
makedepends=
source="http://download.icu-project.org/files/icu4c/${pkgver}/${pkgname}4c-$_ver-src.tgz
icu-timezone-uclibc.patch
icu-timezone.patch
"
_builddir="$srcdir"/icu/source
prepare() {
cd "$_builddir"
update_config_sub || return 1
local x
# https://bugs.icu-project.org/trac/ticket/6102
for x in ARFLAGS CFLAGS CPPFLAGS CXXFLAGS FFLAGS LDFLAGS; do
......@@ -66,8 +68,8 @@ libs() {
}
md5sums="072e501b87065f3a0ca888f1b5165709 icu4c-51_2-src.tgz
70aabd2c1e14477cfa261e729ffd7054 icu-timezone-uclibc.patch"
7c5d8b8105c26afa78fa4300bb4bed48 icu-timezone.patch"
sha256sums="deb027a05f1b3bec03298b96fb93b28c84e9683c22e6f94effa67fdc7bd704cc icu4c-51_2-src.tgz
ce246c007664cb2440ad4c3a224e8133b50b302051783d383c67a0e2b116d176 icu-timezone-uclibc.patch"
b5bff5392e5c6b8bacd8f06fd32bff08688c7884bd33ffc10ef4338f621c6ef5 icu-timezone.patch"
sha512sums="74e22b792d6812c1bf2192f2572f75ec8a14fac5e9b00850f9225279fc09da913082001bef20595f6634a5c3f3335e92906568023544516da69a775bcf5e2a1a icu4c-51_2-src.tgz
4fad17085e9c6b4f16e29b60558fbb594015068466718944ef4a4f2e08bf43d7b0bb81d908f0f7e8e2c1594c44c5923e92a848aef15e7862c64fa65a66a08212 icu-timezone-uclibc.patch"
fc424cf0b78c9dcdea309e161b4ead3537207dc1b0ef8a2b0d824360a261f7b358cc0261e8c9e74f61244b67db106c92902ff63fcbaabf31d701d38e37a8e658 icu-timezone.patch"
--- ./common/putil.cpp.orig
+++ ./common/putil.cpp
@@ -633,7 +633,7 @@
U_CAPI int32_t U_EXPORT2
uprv_timezone()
{
-#ifdef U_TIMEZONE
+#if defined(U_TIMEZONE) && !defined(__UCLIBC__)
return U_TIMEZONE;
#else
time_t t, t1, t2;
--- source/common/putilimp.h
+++ source/common/putilimp.h
@@ -115,11 +115,8 @@
/* Use the predefined value. */
#elif U_PLATFORM == U_PF_ANDROID
# define U_TIMEZONE timezone
-#elif U_PLATFORM_IS_LINUX_BASED
-# if !defined(__UCLIBC__)
- /* __timezone is only available in glibc */
-# define U_TIMEZONE __timezone
-# endif
+#elif U_PLATFORM_IS_LINUX_BASED && defined(__GLIBC__) && !defined(__UCLIBC__)
+# define U_TIMEZONE __timezone
#elif U_PLATFORM_USES_ONLY_WIN32_API
# define U_TIMEZONE _timezone
#elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment