Files
haikuports/dev-libs/icu/patches/icu75-75.1.patchset
2024-09-17 14:19:20 -04:00

229 lines
6.9 KiB
Plaintext

From f195702c2807161401882f8f70eae7297f9df78c 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
diff --git a/source/common/putilimp.h b/source/common/putilimp.h
index 5b95a68..f4ca0c4 100644
--- a/source/common/putilimp.h
+++ b/source/common/putilimp.h
@@ -88,7 +88,7 @@ typedef size_t uintptr_t;
/* Use the predefined value. */
#elif !U_HAVE_NL_LANGINFO_CODESET
# define U_NL_LANGINFO_CODESET -1
-#elif U_PLATFORM == U_PF_OS400
+#elif U_PLATFORM == U_PF_OS400 || defined(__HAIKU__)
/* not defined */
#else
# define U_NL_LANGINFO_CODESET CODESET
@@ -101,7 +101,7 @@ typedef size_t uintptr_t;
#if U_PLATFORM_HAS_WINUWP_API == 0
# define U_TZSET _tzset
#endif
-#elif U_PLATFORM == U_PF_OS400
+#elif U_PLATFORM == U_PF_OS400 || defined(__HAIKU__)
/* not defined */
#else
# define U_TZSET tzset
diff --git a/source/config/mh-haiku b/source/config/mh-haiku
index bb814cd..965c949 100644
--- a/source/config/mh-haiku
+++ b/source/config/mh-haiku
@@ -20,7 +20,7 @@ LIBCPPFLAGS =
THREADSCPPFLAGS =
#
-CPPFLAGS += -D__STDC_ISO_10646__ -DU_CHARSET_IS_UTF8=1
+CPPFLAGS += -DU_CHARSET_IS_UTF8=1
## Compiler switch to embed a runtime search path
LD_RPATH=
diff --git a/source/configure.ac b/source/configure.ac
index 2d7eb30..6b33e74 100644
--- a/source/configure.ac
+++ b/source/configure.ac
@@ -313,7 +313,7 @@ if test "$ENABLE_STATIC" = "YES"; then
OLD_LDFLAGS="${LDFLAGS}"
case "${host}" in
- *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
+ *-linux*|i*86-*-*bsd*|i*86-pc-gnu|*-haiku*)
if test "$GCC" = yes; then
CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
@@ -805,50 +805,12 @@ else
fi
AC_SUBST(U_HAVE_POPEN)
-AC_CHECK_FUNC(tzset)
+#AC_CHECK_FUNC(tzset)
U_HAVE_TZSET=0
-if test x$ac_cv_func_tzset = xyes
-then
- U_TZSET=tzset
- U_HAVE_TZSET=1
-else
- AC_CHECK_FUNC(_tzset)
- if test x$ac_cv_func__tzset = xyes
- then
- U_TZSET=_tzset
- U_HAVE_TZSET=1
- else
- CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
- fi
-fi
AC_SUBST(U_HAVE_TZSET)
AC_SUBST(U_TZSET)
U_HAVE_TZNAME=0
-AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE
-#endif
-#include <stdlib.h>
-#include <time.h>
-#ifndef tzname /* For SGI. */
-extern char *tzname[]; /* RS6000 and others reject char **tzname. */
-#endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])])
-if test $ac_cv_var_tzname = yes; then
- U_TZNAME=tzname
- U_HAVE_TZNAME=1
-else
- AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
- #include <time.h>
- extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])])
- if test $ac_cv_var__tzname = yes; then
- U_TZNAME=_tzname
- U_HAVE_TZNAME=1
- else
- CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0"
- fi
-fi
AC_SUBST(U_HAVE_TZNAME)
AC_SUBST(U_TZNAME)
@@ -1295,6 +1257,7 @@ case "${host}" in
*-*-nto*) platform=U_QNX ;;
*-dec-osf*) platform=U_OSF ;;
*-*-beos) platform=U_BEOS ;;
+ *-*-haiku) platform=U_HAIKU ;;
*-*-irix*) platform=U_IRIX ;;
*-ncr-*) platform=U_MPRAS ;;
*) platform=U_UNKNOWN_PLATFORM ;;
diff --git a/source/tools/tzcode/Makefile.in b/source/tools/tzcode/Makefile.in
index 4ba969f..ea249f0 100644
--- a/source/tools/tzcode/Makefile.in
+++ b/source/tools/tzcode/Makefile.in
@@ -136,7 +136,7 @@ $(ICUZDUMPTARG): $(srcdir)/icuzdump.cpp
$(LINK.cc) -I$(srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/io -pedantic $(srcdir)/icuzdump.cpp $(LIBICUUC) $(LIBICUDT) $(LIBICUI18N) $(LIBICUIO) $(LIBICUTOOLUTIL) -o $@
-$(TDATA): tdatamarker
+$(TDATA) $(XDATA): tdatamarker
tdatamarker: $(TZDATA)
mkdir $(VANGUARD_DIR)
--
2.45.2
From 45df46200c33bcfbd5fd1b08e8cf686e608488dd 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
diff --git a/source/common/putilimp.h b/source/common/putilimp.h
index f4ca0c4..50ff4b5 100644
--- a/source/common/putilimp.h
+++ b/source/common/putilimp.h
@@ -88,7 +88,9 @@ typedef size_t uintptr_t;
/* Use the predefined value. */
#elif !U_HAVE_NL_LANGINFO_CODESET
# define U_NL_LANGINFO_CODESET -1
-#elif U_PLATFORM == U_PF_OS400 || defined(__HAIKU__)
+#elif U_PLATFORM == U_PF_OS400
+ /* not defined */
+#elif U_PLATFORM == U_HAIKU
/* not defined */
#else
# define U_NL_LANGINFO_CODESET CODESET
@@ -101,7 +103,9 @@ typedef size_t uintptr_t;
#if U_PLATFORM_HAS_WINUWP_API == 0
# define U_TZSET _tzset
#endif
-#elif U_PLATFORM == U_PF_OS400 || defined(__HAIKU__)
+#elif U_PLATFORM == U_PF_OS400
+ /* not defined */
+#elif U_PLATFORM == U_HAIKU
/* not defined */
#else
# define U_TZSET tzset
--
2.45.2
From 34d863e5704e3ef47a49757468924921a8149ac2 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: common: prevent potential deadlocks back to ICU
diff --git a/source/common/putilimp.h b/source/common/putilimp.h
index 50ff4b5..29dcf0e 100644
--- a/source/common/putilimp.h
+++ b/source/common/putilimp.h
@@ -145,6 +145,8 @@ typedef size_t uintptr_t;
#endif
#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.45.2
From 6042ef17bc4a52cc02c7f53513248e277aabf77b Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Tue, 17 Sep 2024 13:55:44 -0400
Subject: udata: Load data from packages first on Haiku.
This avoids lots of stat() calls on startup to
look for files that are not present.
diff --git a/source/common/udata.cpp b/source/common/udata.cpp
index 88126fc..effb2ec 100644
--- a/source/common/udata.cpp
+++ b/source/common/udata.cpp
@@ -111,6 +111,10 @@ static u_atomic_int32_t gHaveTriedToLoadCommonData {0}; // See extendICUData()
static UHashtable *gCommonDataCache = nullptr; /* Global hash table of opened ICU data files. */
static icu::UInitOnce gCommonDataCacheInitOnce {};
+#ifdef __HAIKU__
+#define UDATA_DEFAULT_ACCESS UDATA_PACKAGES_FIRST
+#endif
+
#if !defined(ICU_DATA_DIR_WINDOWS)
static UDataFileAccess gDataFileAccess = UDATA_DEFAULT_ACCESS; // Access not synchronized.
// Modifying is documented as thread-unsafe.
--
2.45.2