From b0abc9efd33f0842181fe063ae98cc8b406c4e69 Mon Sep 17 00:00:00 2001 From: Yaksh Bariya Date: Wed, 20 Oct 2021 07:45:26 +0530 Subject: [PATCH] libicu: Respect TZ environment variable --- packages/libicu/build.sh | 1 + packages/libicu/source-common-putil.cpp.patch | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 packages/libicu/source-common-putil.cpp.patch diff --git a/packages/libicu/build.sh b/packages/libicu/build.sh index 3b2999dab..e0af9d254 100644 --- a/packages/libicu/build.sh +++ b/packages/libicu/build.sh @@ -6,6 +6,7 @@ TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_LICENSE_FILE="../LICENSE" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=69.1 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/unicode-org/icu/releases/download/release-${TERMUX_PKG_VERSION//./-}/icu4c-${TERMUX_PKG_VERSION//./_}-src.tgz TERMUX_PKG_SHA256=4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745 TERMUX_PKG_DEPENDS="libc++" diff --git a/packages/libicu/source-common-putil.cpp.patch b/packages/libicu/source-common-putil.cpp.patch new file mode 100644 index 000000000..963a16b98 --- /dev/null +++ b/packages/libicu/source-common-putil.cpp.patch @@ -0,0 +1,17 @@ +--- ./common/putil.cpp 2021-10-20 07:38:51.711938975 +0530 ++++ ./common/putil.cpp.mod 2021-10-20 07:40:29.671938937 +0530 +@@ -1132,10 +1132,11 @@ + + /* This code can be temporarily disabled to test tzname resolution later on. */ + #ifndef DEBUG_TZNAME +-#if U_PLATFORM == U_PF_ANDROID +- tzid = gAndroidTimeZone; +-#else + tzid = getenv("TZ"); ++#if U_PLATFORM == U_PF_ANDROID ++ if (tzid == NULL) { ++ tzid = gAndroidTimeZone; ++ } + #endif + if (tzid != NULL && isValidOlsonID(tzid) + #if U_PLATFORM == U_PF_SOLARIS