From 90787bada9b4f027029fed9eead38b39d282ea60 Mon Sep 17 00:00:00 2001
From: Upgrade Helper <auh@yoctoproject.org>
Date: Mon, 18 Nov 2024 12:27:05 +0000
Subject: [PATCH] icu: upgrade 75-1 -> 76-1

---
 .../0001-Disable-LDFLAGSICUDT-for-Linux.patch | 10 +--
 .../icu/0001-icu-Added-armeb-support.patch    | 10 +--
 ...813_rise_buffer_sizes_pkgdata_PR3058.patch | 72 -------------------
 .../icu/icu/fix-install-manx.patch            | 53 --------------
 .../icu/{icu_75-1.bb => icu_76-1.bb}          | 64 +++++++++++++++--
 5 files changed, 70 insertions(+), 139 deletions(-)
 delete mode 100644 meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch
 delete mode 100644 meta/recipes-support/icu/icu/fix-install-manx.patch
 rename meta/recipes-support/icu/{icu_75-1.bb => icu_76-1.bb} (68%)

diff --git a/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch b/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
index c0e9e2806b..eabe420f72 100644
--- a/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
+++ b/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
@@ -1,4 +1,4 @@
-From 0f4e9eee64bd4220aa4fae1ab4f7bbf10b87cd69 Mon Sep 17 00:00:00 2001
+From f49cca36bdeeb81bf18531a0b060b991a96365c0 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 15 Feb 2014 21:06:42 +0000
 Subject: [PATCH] Disable LDFLAGSICUDT for Linux
@@ -7,13 +7,13 @@ Upstream-Status: Inappropriate [ OE Configuration ]
 
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
- config/mh-linux | 2 +-
+ source/config/mh-linux | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/config/mh-linux b/config/mh-linux
+diff --git a/source/config/mh-linux b/source/config/mh-linux
 index 53d6780..b622513 100644
---- a/config/mh-linux
-+++ b/config/mh-linux
+--- a/source/config/mh-linux
++++ b/source/config/mh-linux
 @@ -23,7 +23,7 @@ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
  LD_RPATH_PRE = -Wl,-rpath,
  
diff --git a/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch b/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch
index a25285fb54..a4eda9643b 100644
--- a/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch
+++ b/meta/recipes-support/icu/icu/0001-icu-Added-armeb-support.patch
@@ -1,4 +1,4 @@
-From cf55c077b77b7a219502364eaadf12c074ab005e Mon Sep 17 00:00:00 2001
+From c5a7c056af2e63f0a362e65dba77d78a2b849371 Mon Sep 17 00:00:00 2001
 From: Lei Maohui <leimaohui@cn.fujitsu.com>
 Date: Wed, 8 May 2019 14:42:30 +0900
 Subject: [PATCH] icu: Added armeb support.
@@ -9,13 +9,13 @@ Upstream-Status: Pending
 
 Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
 ---
- i18n/double-conversion-utils.h | 2 +-
+ source/i18n/double-conversion-utils.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/i18n/double-conversion-utils.h b/i18n/double-conversion-utils.h
+diff --git a/source/i18n/double-conversion-utils.h b/source/i18n/double-conversion-utils.h
 index 303668f..7d859dc 100644
---- a/i18n/double-conversion-utils.h
-+++ b/i18n/double-conversion-utils.h
+--- a/source/i18n/double-conversion-utils.h
++++ b/source/i18n/double-conversion-utils.h
 @@ -146,7 +146,7 @@ int main(int argc, char** argv) {
  //
  // If it prints "correct" then the architecture should be here, in the "correct" section.
diff --git a/meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch b/meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch
deleted file mode 100644
index 5b97350e6f..0000000000
--- a/meta/recipes-support/icu/icu/ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From db70adaddcfa8050db6a69cdfef080a7f1423ad7 Mon Sep 17 00:00:00 2001
-From: Carlos Alberto Lopez Perez <clopez@igalia.com>
-Date: Mon, 1 Jul 2024 22:15:18 +0100
-Subject: [PATCH] ICU-22813 Rise the size of the buffers used for the command
- strings at pkgdata
-
-The tool pkgdata uses snprintf() to build the strings of the commands that
-will execute later during the install process. But the maximum size of this
-buffers is not enough when there is a long path.
-
-This has caused issues on some CI systems that use very long paths, causing
-the install process to produce a wrong result.
-
-The maximum path on Linux is 4096 (defined as PATH_MAX at <linux/limits.h>)
-So the size of SMALL_BUFFER_MAX_SIZE should be 4096 to avoid errors related
-to truncated paths.
-
-Upstream-Status: Backport [https://github.com/unicode-org/icu/pull/3058]
-
-Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
----
- tools/pkgdata/pkgdata.cpp | 6 +++---
- tools/toolutil/pkg_genc.h | 5 ++---
- 2 files changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
-index c2ac112..8d08c85 100644
---- a/tools/pkgdata/pkgdata.cpp
-+++ b/tools/pkgdata/pkgdata.cpp
-@@ -1134,7 +1134,7 @@ static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling)
- 
- static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
-     int32_t result = 0;
--    char cmd[SMALL_BUFFER_MAX_SIZE];
-+    char cmd[LARGE_BUFFER_MAX_SIZE];
- 
-     auto ret = snprintf(cmd,
-             sizeof(cmd),
-@@ -1205,7 +1205,7 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir,
- 
- static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
-     int32_t result = 0;
--    char cmd[SMALL_BUFFER_MAX_SIZE] = "";
-+    char cmd[LARGE_BUFFER_MAX_SIZE] = "";
- 
-     if (!T_FileStream_file_exists(installDir)) {
-         UErrorCode status = U_ZERO_ERROR;
-@@ -1237,7 +1237,7 @@ static int32_t pkg_installCommonMode(const char *installDir, const char *fileNam
- #endif
- static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {
-     int32_t result = 0;
--    char cmd[SMALL_BUFFER_MAX_SIZE] = "";
-+    char cmd[LARGE_BUFFER_MAX_SIZE] = "";
- 
-     if (!T_FileStream_file_exists(installDir)) {
-         UErrorCode status = U_ZERO_ERROR;
-diff --git a/tools/toolutil/pkg_genc.h b/tools/toolutil/pkg_genc.h
-index 2dd1b45..f811fe5 100644
---- a/tools/toolutil/pkg_genc.h
-+++ b/tools/toolutil/pkg_genc.h
-@@ -59,9 +59,8 @@
- #define PKGDATA_FILE_SEP_STRING U_FILE_SEP_STRING
- #endif
- 
--#define LARGE_BUFFER_MAX_SIZE 2048
--#define SMALL_BUFFER_MAX_SIZE 512
--#define SMALL_BUFFER_FLAG_NAMES 32
-+#define LARGE_BUFFER_MAX_SIZE 16384
-+#define SMALL_BUFFER_MAX_SIZE 4096
- #define BUFFER_PADDING_SIZE 20
- 
- /** End platform defines **/
diff --git a/meta/recipes-support/icu/icu/fix-install-manx.patch b/meta/recipes-support/icu/icu/fix-install-manx.patch
deleted file mode 100644
index 7b1ca81451..0000000000
--- a/meta/recipes-support/icu/icu/fix-install-manx.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 2d544cac238eccbfc32cafc9502ddf6e00994211 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Fri, 9 Oct 2015 17:50:41 +0100
-Subject: [PATCH] icu: fix install race
-
-The generic recursive target calls target-local so also adding it to the
-dependency list results in races due to install-local being executed twice in
-parallel.  For example, install-manx can fail if the two install processes race
-and one process tries to chown a file that the other process has just deleted.
-
-Also install-manx should be a phony target, and for clarity use $^ instead of $?
-in the install command.
-
-Upstream-Status: Backport [0f022dca90cfe6bbf6a74f605dcaf1b489d58a9b]
-Signed-off-by: Ross Burton <ross.burton@intel.com>
----
- Makefile.in | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 8366f01..79b91c9 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -77,7 +77,7 @@ EXTRA_DATA =
- 
- ## List of phony targets
- .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls		\
--install-recursive clean clean-local clean-recursive distclean		\
-+install-recursive install-manx clean clean-local clean-recursive distclean		\
- distclean-local distclean-recursive doc dist dist-local dist-recursive	\
- check check-local check-recursive clean-recursive-with-twist install-icu \
- doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
-@@ -88,9 +88,9 @@ check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
- 
- ## List of standard targets
- all: all-local all-recursive
--install: install-recursive install-local
-+install: install-recursive
- clean: clean-recursive-with-twist clean-local
--distclean : distclean-recursive distclean-local
-+distclean : distclean-recursive
- dist: dist-recursive
- check: all check-recursive
- check-recursive: all
-@@ -357,7 +357,7 @@ config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
- install-manx: $(MANX_FILES)
- 	$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
- ifneq ($(MANX_FILES),)
--	$(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
-+	$(INSTALL_DATA) $^ $(DESTDIR)$(mandir)/man$(SECTION)
- endif
- 
- config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
diff --git a/meta/recipes-support/icu/icu_75-1.bb b/meta/recipes-support/icu/icu_76-1.bb
similarity index 68%
rename from meta/recipes-support/icu/icu_75-1.bb
rename to meta/recipes-support/icu/icu_76-1.bb
index 8f7f5e6cc7..db6599edd1 100644
--- a/meta/recipes-support/icu/icu_75-1.bb
+++ b/meta/recipes-support/icu/icu_76-1.bb
@@ -1,3 +1,60 @@
+# FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'.
+# The following is the difference between the old and the new license text.
+# Please update the LICENSE value if needed, and summarize the changes in
+# the commit message via 'License-Update:' tag.
+# (example: 'License-Update: copyright years updated.')
+#
+# The changes:
+#
+# --- ../LICENSE
+# +++ ../LICENSE
+# @@ -433,6 +433,34 @@
+#  
+#  ----------------------------------------------------------------------
+#  
+# +JSON parsing library (nlohmann/json)
+# +
+# +File: vendor/json/upstream/single_include/nlohmann/json.hpp (only for ICU4C)
+# +
+# +MIT License
+# +
+# +Copyright (c) 2013-2022 Niels Lohmann
+# +
+# +Permission is hereby granted, free of charge, to any person obtaining a copy
+# +of this software and associated documentation files (the "Software"), to deal
+# +in the Software without restriction, including without limitation the rights
+# +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# +copies of the Software, and to permit persons to whom the Software is
+# +furnished to do so, subject to the following conditions:
+# +
+# +The above copyright notice and this permission notice shall be included in all
+# +copies or substantial portions of the Software.
+# +
+# +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# +SOFTWARE.
+# +
+# +----------------------------------------------------------------------
+# +
+#  File: aclocal.m4 (only for ICU4C)
+#  Section: pkg.m4 - Macros to locate and utilise pkg-config.
+#  
+# @@ -473,7 +501,7 @@
+#  
+#  This file is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by
+# -the Free Software Foundation; either version 3 of the License, or
+# +the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#  
+#  This program is distributed in the hope that it will be useful, but
+# 
+#
+
 SUMMARY = "International Component for Unicode libraries"
 DESCRIPTION = "The International Component for Unicode (ICU) is a mature, \
 portable set of C/C++ and Java libraries for Unicode support, software \
@@ -92,7 +149,7 @@ FILES:libicuio = "${libdir}/libicuio.so.*"
 
 BBCLASSEXTEND = "native nativesdk"
 
-LIC_FILES_CHKSUM = "file://../LICENSE;md5=9cf7c317c3f2a0962437465a9022dbe9"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=7c364a0debecf16d5a13de2b7f1aaabd"
 
 def icu_download_version(d):
     pvsplit = d.getVar('PV').split('-')
@@ -118,15 +175,14 @@ DATA_SRC_URI = "${GITHUB_BASE_URI}/download/release-${ICU_FOLDER}/icu4c-${ICU_PV
 SRC_URI = "${BASE_SRC_URI};name=code \
            ${DATA_SRC_URI};name=data \
            file://filter.json \
-           file://fix-install-manx.patch \
            file://0001-icu-Added-armeb-support.patch \
-           file://ICU-22813_rise_buffer_sizes_pkgdata_PR3058.patch \
+           file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
            "
 
 SRC_URI:append:class-target = "\
            file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
           "
-SRC_URI[code.sha256sum] = "cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef"
+SRC_URI[code.sha256sum] = "dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e"
 SRC_URI[data.sha256sum] = "a5104212dc317a64f9b035723ea706f2f4fd5a0f37b7923fae7aeb9d1d0061b1"
 
 UPSTREAM_CHECK_REGEX = "releases/tag/release-(?P<pver>(?!.+rc).+)"
-- 
2.44.1

