Skip to content

Commit

Permalink
icu: refix infinite loop in icu74 initialization.
Browse files Browse the repository at this point in the history
* Pretty much what PulkoMandy did, but ✨ tested ✨
* Obeys upstream style mentioned in previous patch commit
  • Loading branch information
kallisti5 committed Feb 6, 2024
1 parent 7962b34 commit ab2c87f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dev-libs/icu/icu74-74.1.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ wrapping when displaying the text."
HOMEPAGE="http://www.icu-project.org"
COPYRIGHT="1995-2020 IBM Corporation and others."
LICENSE="ICU"
REVISION="2"
REVISION="3"
SOURCE_URI="https://github.com/unicode-org/icu/releases/download/release-${portVersion/\./-}/icu4c-${portVersion/\./_}-src.tgz"
CHECKSUM_SHA256="86ce8e60681972e60e4dcb2490c697463fcec60dd400a5f9bffba26d0b52b8d0"
SOURCE_URI_2="https://github.com/unicode-org/icu/releases/download/release-${portVersion/\./-}/icu4c-${portVersion/\./_}-data.zip#noarchive"
Expand Down
51 changes: 30 additions & 21 deletions dev-libs/icu/patches/icu74-74.1.patchset
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 5ab66eab63e922efa10ff19db6a216d8700eca22 Mon Sep 17 00:00:00 2001
From 105fd4cc7fb9dc95548362742360619e1cc67f6f Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Tue, 22 Feb 2022 10:08:48 -0600
Subject: Import changes from icu66 patchset
Expand Down Expand Up @@ -126,10 +126,10 @@ index 4ba969f..ea249f0 100644
tdatamarker: $(TZDATA)
mkdir $(VANGUARD_DIR)
--
2.42.1
2.42.0


From f6e4e1ddaaf61ae06c9934f272bfd0e0a7177c61 Mon Sep 17 00:00:00 2001
From d993329641a68dbf24ec076652b45138b3869fca Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Fri, 19 May 2023 11:46:23 +0200
Subject: Fix patchset according to upstream
Expand Down Expand Up @@ -162,34 +162,43 @@ index f4ca0c4..50ff4b5 100644
#else
# define U_TZSET tzset
--
2.42.1

2.42.0

From bd5d2e1f9e05ba8f64096e79f71c9419f2282c89 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Tue, 6 Feb 2024 21:11:34 +0100
Subject: Haiku: properly undefine U_TZNAME
From f3c4a38b820c4a042240829644ae3c6798d87b6b Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Tue, 6 Feb 2024 15:04:41 -0600
Subject: [PATCH] common: prevent potential deadlocks back to ICU

A previous version of our patches attempted to patch this out of the
configuration files, but that isn't enough, since leaving U_TZNAME
undefined in the configure script ends up defaulting to tzname, which is
what we don't want to happen (in our case, using tzname and related
APIs isn't safe because ICU ends up trying to call itself as it is used
to implement our C library).
---
source/common/putilimp.h | 2 ++
source/configure.ac | 1 +
2 files changed, 3 insertions(+)

This comment has been minimized.

Copy link
@OscarL

OscarL Feb 7, 2024

Contributor

Nitpicking (don't kill me! :-D):

haikuporter -e leaves behind the stats and "[PATCH]" (similarly to git format-patch -p -k -1)


diff --git a/source/common/putilimp.h b/source/common/putilimp.h
index 50ff4b5..b5cc545 100644
index 50ff4b5..29dcf0e 100644
--- a/source/common/putilimp.h
+++ b/source/common/putilimp.h
@@ -143,7 +143,7 @@ typedef size_t uintptr_t;
#if U_PLATFORM_HAS_WINUWP_API == 0
# define U_TZNAME _tzname
@@ -145,6 +145,8 @@ typedef size_t uintptr_t;
#endif
-#elif U_PLATFORM == U_PF_OS400
+#elif (U_PLATFORM == U_PF_OS400) || (U_PLATFORM == U_HAIKU)
#elif U_PLATFORM == U_PF_OS400
/* not defined */
+#elif U_PLATFORM == U_HAIKU
+ /* not defined, (well it is but a loop back to icu) */
#else
# define U_TZNAME tzname
#endif
diff --git a/source/configure.ac b/source/configure.ac
index 6b33e74..41a357d 100644
--- a/source/configure.ac
+++ b/source/configure.ac
@@ -809,6 +809,7 @@ AC_SUBST(U_HAVE_POPEN)
U_HAVE_TZSET=0
AC_SUBST(U_HAVE_TZSET)
AC_SUBST(U_TZSET)
+CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"

U_HAVE_TZNAME=0
AC_SUBST(U_HAVE_TZNAME)
--
2.42.1

0 comments on commit ab2c87f

Please sign in to comment.