git: ea231aeffcf9 - 2025Q2 - www/{iridium,ungoogled-chromium}: unbreak build with gperf 3.2

From: Robert Nagy <rnagy_at_FreeBSD.org>
Date: Tue, 06 May 2025 06:47:52 UTC
The branch 2025Q2 has been updated by rnagy:

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

commit ea231aeffcf94888e92fbaa2f883c6c6a6424470
Author:     Robert Nagy <rnagy@FreeBSD.org>
AuthorDate: 2025-05-06 06:46:12 +0000
Commit:     Robert Nagy <rnagy@FreeBSD.org>
CommitDate: 2025-05-06 06:47:47 +0000

    www/{iridium,ungoogled-chromium}: unbreak build with gperf 3.2
    
    PR:     286547
    (cherry picked from commit 994082a1c7ecc63fabd0a69769bf697473ee3eb6)
---
 ...hird__party_blink_renderer_build_scripts_gperf.py | 20 ++++++++++++++++++++
 ...hird__party_blink_renderer_build_scripts_gperf.py | 20 ++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/www/iridium/files/patch-third__party_blink_renderer_build_scripts_gperf.py b/www/iridium/files/patch-third__party_blink_renderer_build_scripts_gperf.py
new file mode 100644
index 000000000000..53da5d93f0b8
--- /dev/null
+++ b/www/iridium/files/patch-third__party_blink_renderer_build_scripts_gperf.py
@@ -0,0 +1,20 @@
+--- third_party/blink/renderer/build/scripts/gperf.py.orig	2025-05-05 18:35:31 UTC
++++ third_party/blink/renderer/build/scripts/gperf.py
+@@ -35,10 +35,13 @@ def generate_gperf(gperf_path, gperf_input, gperf_args
+         # https://savannah.gnu.org/bugs/index.php?53028
+         gperf_output = re.sub(r'\bregister ', '', gperf_output)
+         # -Wimplicit-fallthrough needs an explicit fallthrough statement,
+-        # so replace gperf's /*FALLTHROUGH*/ comment with the statement.
+-        # https://savannah.gnu.org/bugs/index.php?53029
+-        gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
+-                                            '  [[fallthrough]];')
++        # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement.
++        # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2)
++        if re.search(
++                r'/\* C\+\+ code produced by gperf version 3\.[01](\.\d+)? \*/',
++                gperf_output):
++            gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
++                                                '  [[fallthrough]];')
+         # -Wpointer-to-int-cast warns about casting pointers to smaller ints
+         # Replace {(int)(long)&(foo), bar} with
+         # {static_cast<int>(reinterpret_cast<uintptr_t>(&(foo)), bar}
diff --git a/www/ungoogled-chromium/files/patch-third__party_blink_renderer_build_scripts_gperf.py b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_build_scripts_gperf.py
new file mode 100644
index 000000000000..53da5d93f0b8
--- /dev/null
+++ b/www/ungoogled-chromium/files/patch-third__party_blink_renderer_build_scripts_gperf.py
@@ -0,0 +1,20 @@
+--- third_party/blink/renderer/build/scripts/gperf.py.orig	2025-05-05 18:35:31 UTC
++++ third_party/blink/renderer/build/scripts/gperf.py
+@@ -35,10 +35,13 @@ def generate_gperf(gperf_path, gperf_input, gperf_args
+         # https://savannah.gnu.org/bugs/index.php?53028
+         gperf_output = re.sub(r'\bregister ', '', gperf_output)
+         # -Wimplicit-fallthrough needs an explicit fallthrough statement,
+-        # so replace gperf's /*FALLTHROUGH*/ comment with the statement.
+-        # https://savannah.gnu.org/bugs/index.php?53029
+-        gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
+-                                            '  [[fallthrough]];')
++        # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement.
++        # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2)
++        if re.search(
++                r'/\* C\+\+ code produced by gperf version 3\.[01](\.\d+)? \*/',
++                gperf_output):
++            gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
++                                                '  [[fallthrough]];')
+         # -Wpointer-to-int-cast warns about casting pointers to smaller ints
+         # Replace {(int)(long)&(foo), bar} with
+         # {static_cast<int>(reinterpret_cast<uintptr_t>(&(foo)), bar}