diff --git a/dev-libs/icu/icu76-76.1.recipe b/dev-libs/icu/icu76-76.1.recipe new file mode 100644 index 000000000..6e83ab232 --- /dev/null +++ b/dev-libs/icu/icu76-76.1.recipe @@ -0,0 +1,206 @@ +SUMMARY="Libraries to support Unicode and globalization" +DESCRIPTION="International Components for Unicode (ICU) is a mature, widely \ +used set of C/C++ and Java libraries providing Unicode and Globalization \ +support for software applications. ICU is widely portable and gives \ +applications the same results on all platforms and between C/C++ and Java \ +software. +ICU is released under a nonrestrictive open source license that is suitable \ +for use with both commercial software and with other open source or free \ +software. + +Here are a few highlights of the services provided by ICU: + +* Code Page Conversion: Convert text data to or from Unicode and nearly any \ +other character set or encoding. ICU's conversion tables are based on charset \ +data collected by IBM over the course of many decades, and is the most \ +complete available anywhere. +* Collation: Compare strings according to the conventions and standards of a \ +particular language, region or country. ICU's collation is based on the \ +Unicode Collation Algorithm plus locale-specific comparison rules from the \ +Common Locale Data Repository, a comprehensive source for this type of data. +* Formatting: Format numbers, dates, times and currency amounts according the \ +conventions of a chosen locale. This includes translating month and day names \ +into the selected language, choosing appropriate abbreviations, ordering \ +fields correctly, etc. This data also comes from the Common Locale Data \ +Repository. +* Time Calculations: Multiple types of calendars are provided beyond the \ +traditional Gregorian calendar. A thorough set of timezone calculation APIs \ +are provided. +* Unicode Support: ICU closely tracks the Unicode standard, providing easy \ +access to all of the many Unicode character properties, Unicode Normalization, \ +Case Folding and other fundamental operations as specified by the Unicode \ +Standard. +* Regular Expression: ICU's regular expressions fully support Unicode while \ +providing very competitive performance. +* Bidi: support for handling text containing a mixture of left to right \ +(English) and right to left (Arabic or Hebrew) data. +* Text Boundaries: Locate the positions of words, sentences, paragraphs within \ +a range of text, or identify locations that would be suitable for line \ +wrapping when displaying the text." +HOMEPAGE="http://www.icu-project.org" +COPYRIGHT="2016 and later: Unicode, Inc. and others. + 1995-2020 IBM Corporation and others." +LICENSE="ICU" +REVISION="1" +SOURCE_URI="https://github.com/unicode-org/icu/releases/download/release-${portVersion/\./-}/icu4c-${portVersion/\./_}-src.tgz" +CHECKSUM_SHA256="dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e" +SOURCE_URI_2="https://github.com/unicode-org/icu/releases/download/release-${portVersion/\./-}/icu4c-${portVersion/\./_}-data.zip#noarchive" +CHECKSUM_SHA256_2="133ae58a67d68b46f7296822904cd3c30126a0b4b2f65f0f905e7f47c0ef9e47" +SOURCE_DIR="icu" +PATCHES="icu76-$portVersion.patchset" + +ARCHITECTURES="?all !x86_gcc2" +SECONDARY_ARCHITECTURES="?x86" + +libVersion="$portVersion" +libVersionCompat="$libVersion compat >= ${libVersion%.*}" + +PROVIDES=" + icu76$secondaryArchSuffix = $portVersion compat >= 75 + lib:libicudata$secondaryArchSuffix = $libVersionCompat + lib:libicui18n$secondaryArchSuffix = $libVersionCompat + lib:libicuio$secondaryArchSuffix = $libVersionCompat + lib:libicutest$secondaryArchSuffix = $libVersionCompat + lib:libicutu$secondaryArchSuffix = $libVersionCompat + lib:libicuuc$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +SUMMARY_devel="The ICU development files" +PROVIDES_devel=" + icu76${secondaryArchSuffix}_devel = $portVersion + cmd:icu_config${secondaryArchSuffix} = $libVersionCompat + devel:libicudata${secondaryArchSuffix} = $libVersionCompat + devel:libicui18n${secondaryArchSuffix} = $libVersionCompat + devel:libicuio${secondaryArchSuffix} = $libVersionCompat + devel:libicutest${secondaryArchSuffix} = $libVersionCompat + devel:libicutu${secondaryArchSuffix} = $libVersionCompat + devel:libicuuc${secondaryArchSuffix} = $libVersionCompat + " +REQUIRES_devel=" + icu76${secondaryArchSuffix} == $portVersion base + " +CONFLICTS_devel=" + icu66${secondaryArchSuffix}_devel + icu70${secondaryArchSuffix}_devel + icu73${secondaryArchSuffix}_devel + icu74${secondaryArchSuffix}_devel + icu75${secondaryArchSuffix}_devel + " + +if [ -z "$secondaryArchSuffix" ]; then + SUMMARY_tools="The ICU support tools" + PROVIDES_tools=" + icu76_tools = $portVersion + cmd:derb + cmd:icuexportdata + cmd:escapesrc + cmd:genbrk + cmd:genccode + cmd:gencfu + cmd:gencmn + cmd:gencnval + cmd:gendict + cmd:gennorm2 + cmd:genrb + cmd:gensprep + cmd:icuinfo + cmd:icupkg + cmd:makeconv + cmd:pkgdata + " + REQUIRES_tools=" + icu76 == $portVersion base + haiku + " + CONFLICTS_tools=" + icu66_tools + icu70_tools + icu73_tools + icu74_tools + icu75_tools + " +fi + + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:autoconf + cmd:awk + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:python3 + cmd:sed + cmd:unzip + cmd:tar + cmd:gunzip + " + +BUILD() +{ + cd source + + # Created during build and prevent rebuilds. + #rm -rf tools/tzcode/vanguard + #cp ../../../sources-3/tzdata*.tar.gz tools/tzcode/ + + # optimize & make symbol lookups faster (and prevent symbols being overridden) + export CFLAGS="-O2 -fno-semantic-interposition" + export CXXFLAGS="-O2 -fno-semantic-interposition" + export LDFLAGS=-Wl,-Bsymbolic-functions + + unzip -oq ../../../sources-2/icu4c-*-data.zip + rm -f data/in/icudt??l.dat + + autoconf + runConfigure ./configure \ + --disable-samples --disable-extras --with-data-packaging=archive + make $jobArgs +} + +INSTALL() +{ + cd source + make install + + prepareInstalledDevelLibs \ + libicudata \ + libicui18n \ + libicuio \ + libicutest \ + libicutu \ + libicuuc + fixPkgconfig + + # Update icu-config to point to the develop/lib dir + fixDevelopLibDirReferences \ + $binDir/icu-config + + # devel package + packageEntries devel \ + $developDir \ + $libDir/icu \ + $binDir/icu-config \ + $manDir/man1/icu-config.1 + + # tools package + if [ -z "$secondaryArchSuffix" ]; then + packageEntries tools \ + $binDir \ + $manDir + else + rm -r $binDir $manDir + fi +} + +TEST() +{ + cd source + make check VERBOSE=1 +} diff --git a/dev-libs/icu/patches/icu76-76.1.patchset b/dev-libs/icu/patches/icu76-76.1.patchset new file mode 100644 index 000000000..173971162 --- /dev/null +++ b/dev-libs/icu/patches/icu76-76.1.patchset @@ -0,0 +1,127 @@ +From b5bd9fb9ada83f237896a31d4d6e0fb4a60ad42b Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Tue, 22 Feb 2022 10:08:48 -0600 +Subject: Import changes from icu66 patchset + + +diff --git a/source/configure.ac b/source/configure.ac +index be1cca6..a2db44d 100644 +--- a/source/configure.ac ++++ b/source/configure.ac +@@ -751,50 +751,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 +-#include +-#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 +- #include +- 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) + +diff --git a/source/tools/tzcode/Makefile.in b/source/tools/tzcode/Makefile.in +index ac51771..3cfca55 100644 +--- a/source/tools/tzcode/Makefile.in ++++ b/source/tools/tzcode/Makefile.in +@@ -137,7 +137,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.48.1 + + +From 35e9c78d1534c5240084b00bd01795870a892ab7 Mon Sep 17 00:00:00 2001 +From: Alexander von Gluck IV +Date: Tue, 6 Feb 2024 15:04:41 -0600 +Subject: common: prevent potential deadlocks back to ICU + + +diff --git a/source/configure.ac b/source/configure.ac +index a2db44d..cfad5a7 100644 +--- a/source/configure.ac ++++ b/source/configure.ac +@@ -755,6 +755,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.48.1 + + +From a77c2f7f6a13f142afe38a047ec398f9fbab9b0d Mon Sep 17 00:00:00 2001 +From: Augustin Cavalier +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 68b6227..eb7a0f8 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.48.1 +