git: a65233d4d0f2 - main - devel/electron32: fix build with ICU 76

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Thu, 30 Jan 2025 21:12:27 UTC
The branch main has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a65233d4d0f25d61355f21cc8040fa2133cb62ad

commit a65233d4d0f25d61355f21cc8040fa2133cb62ad
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2025-01-30 21:10:11 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2025-01-30 21:12:20 +0000

    devel/electron32: fix build with ICU 76
    
    PR:             284316
    Reported by:    diizzy
    Obtained from:  https://cgit.freebsd.org/ports/tree/www/chromium?id=ca048c2884dc9822310a87e2dfebb8b1647095e2
---
 devel/electron32/files/patch-.gn                    | 11 +++++++++++
 .../files/patch-build_linux_unbundle_icu.gn         | 21 ++++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/devel/electron32/files/patch-.gn b/devel/electron32/files/patch-.gn
new file mode 100644
index 000000000000..2c072f8c7103
--- /dev/null
+++ b/devel/electron32/files/patch-.gn
@@ -0,0 +1,11 @@
+--- .gn.orig	2025-01-29 08:44:44 UTC
++++ .gn
+@@ -173,6 +173,8 @@ exec_script_whitelist =
+       "//tools/grit/grit_rule.gni",
+       "//tools/gritsettings/BUILD.gn",
+ 
++      "//third_party/icu/BUILD.gn",
++
+       "//electron/BUILD.gn",
+       "//third_party/electron_node/deps/base64/BUILD.gn",
+       "//third_party/electron_node/deps/base64/unofficial.gni",
diff --git a/devel/electron32/files/patch-build_linux_unbundle_icu.gn b/devel/electron32/files/patch-build_linux_unbundle_icu.gn
index bd3567f59977..d1588b8a6ff0 100644
--- a/devel/electron32/files/patch-build_linux_unbundle_icu.gn
+++ b/devel/electron32/files/patch-build_linux_unbundle_icu.gn
@@ -1,4 +1,4 @@
---- build/linux/unbundle/icu.gn.orig	2023-04-04 21:42:43 UTC
+--- build/linux/unbundle/icu.gn.orig	2024-11-06 12:34:11 UTC
 +++ build/linux/unbundle/icu.gn
 @@ -17,6 +17,15 @@ config("icu_config") {
      "USING_SYSTEM_ICU=1",
@@ -16,3 +16,22 @@
      # U_EXPORT (defined in unicode/platform.h) is used to set public visibility
      # on classes through the U_COMMON_API and U_I18N_API macros (among others).
      # When linking against the system ICU library, we want its symbols to have
+@@ -35,6 +44,18 @@ config("icu_config") {
+     # please see: https://crbug.com/822820
+     "U_IMPORT=U_EXPORT",
+   ]
++
++  _icu_version = exec_script(pkg_config_script,
++                              common_pkg_config_args + pkg_config_args + [
++                                    "icu-i18n",
++                                    "--version-as-components",
++                                  ],
++                              "value")
++
++  # Unbreak with icu 76 where private symbols are picked up
++  if (_icu_version[0] >= 76) {
++    defines += [ "U_HIDE_DRAFT_API" ]
++  }
+ }
+ 
+ pkg_config("system_icui18n") {