Sun Apr 25 12:00:24 2021 UTC ()
webkit-gtk: Backport upstream patches to fix the build for ICU >= 69

PKGREVISION++

Thanks to <wiz> for pointing out them!


(leot)
diff -r1.204 -r1.205 pkgsrc/www/webkit-gtk/Makefile
diff -r1.147 -r1.148 pkgsrc/www/webkit-gtk/distinfo
diff -r0 -r1.1 pkgsrc/www/webkit-gtk/patches/patch-Source_JavaScriptCore_Sources.txt
diff -r0 -r1.1 pkgsrc/www/webkit-gtk/patches/patch-Source_JavaScriptCore_runtime_IntlSegmenter.cpp
diff -r0 -r1.1 pkgsrc/www/webkit-gtk/patches/patch-Source_JavaScriptCore_runtime_IntlSegmenter.h
diff -r0 -r1.1 pkgsrc/www/webkit-gtk/patches/patch-Source_JavaScriptCore_runtime_IntlSegments.cpp
diff -r0 -r1.1 pkgsrc/www/webkit-gtk/patches/patch-Source_JavaScriptCore_runtime_IntlWorkaround.cpp

cvs diff -r1.204 -r1.205 pkgsrc/www/webkit-gtk/Makefile (expand / switch to unified diff)

--- pkgsrc/www/webkit-gtk/Makefile 2021/04/21 11:40:44 1.204
+++ pkgsrc/www/webkit-gtk/Makefile 2021/04/25 12:00:24 1.205
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1# $NetBSD: Makefile,v 1.204 2021/04/21 11:40:44 adam Exp $ 1# $NetBSD: Makefile,v 1.205 2021/04/25 12:00:24 leot Exp $
2 2
3DISTNAME= webkitgtk-2.32.0 3DISTNAME= webkitgtk-2.32.0
4PKGNAME= ${DISTNAME:S/webkitgtk/webkit-gtk/} 4PKGNAME= ${DISTNAME:S/webkitgtk/webkit-gtk/}
5PKGREVISION= 1 5PKGREVISION= 2
6CATEGORIES= www 6CATEGORIES= www
7MASTER_SITES= https://www.webkitgtk.org/releases/ 7MASTER_SITES= https://www.webkitgtk.org/releases/
8EXTRACT_SUFX= .tar.xz 8EXTRACT_SUFX= .tar.xz
9 9
10MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
11HOMEPAGE= https://www.webkitgtk.org/ 11HOMEPAGE= https://www.webkitgtk.org/
12COMMENT= GTK port of the WebKit browser engine 12COMMENT= GTK port of the WebKit browser engine
13LICENSE= 2-clause-bsd AND gnu-lgpl-v2 13LICENSE= 2-clause-bsd AND gnu-lgpl-v2
14 14
15# shm_open(3) and shm_unlink(3) appeared in NetBSD 7.0 15# shm_open(3) and shm_unlink(3) appeared in NetBSD 7.0
16NOT_FOR_PLATFORM= NetBSD-[1-6].*-* 16NOT_FOR_PLATFORM= NetBSD-[1-6].*-*
17 17
18TOOL_DEPENDS+= gettext-tools>=0.18:../../devel/gettext-tools 18TOOL_DEPENDS+= gettext-tools>=0.18:../../devel/gettext-tools

cvs diff -r1.147 -r1.148 pkgsrc/www/webkit-gtk/distinfo (expand / switch to unified diff)

--- pkgsrc/www/webkit-gtk/distinfo 2021/03/30 12:47:42 1.147
+++ pkgsrc/www/webkit-gtk/distinfo 2021/04/25 12:00:24 1.148
@@ -1,26 +1,31 @@ @@ -1,26 +1,31 @@
1$NetBSD: distinfo,v 1.147 2021/03/30 12:47:42 leot Exp $ 1$NetBSD: distinfo,v 1.148 2021/04/25 12:00:24 leot Exp $
2 2
3SHA1 (webkitgtk-2.32.0.tar.xz) = 8abdb3ba2732c892dd06bb2bd63208b090462bf7 3SHA1 (webkitgtk-2.32.0.tar.xz) = 8abdb3ba2732c892dd06bb2bd63208b090462bf7
4RMD160 (webkitgtk-2.32.0.tar.xz) = c825873ec544e505f84e3b8a900619dac08e01ce 4RMD160 (webkitgtk-2.32.0.tar.xz) = c825873ec544e505f84e3b8a900619dac08e01ce
5SHA512 (webkitgtk-2.32.0.tar.xz) = 4832a4614be24481028ca8a6480a8e6cfacd8e22f5ba9f936703c09944550056f06f75ccf8fffa7dee3f5a1d11ab1870841407745be2e61ebad6557a0934db15 5SHA512 (webkitgtk-2.32.0.tar.xz) = 4832a4614be24481028ca8a6480a8e6cfacd8e22f5ba9f936703c09944550056f06f75ccf8fffa7dee3f5a1d11ab1870841407745be2e61ebad6557a0934db15
6Size (webkitgtk-2.32.0.tar.xz) = 23315936 bytes 6Size (webkitgtk-2.32.0.tar.xz) = 23315936 bytes
7SHA1 (patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh) = f4f117e6c1cd8eb8e4905f74946e0367156ed528 7SHA1 (patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh) = f4f117e6c1cd8eb8e4905f74946e0367156ed528
8SHA1 (patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh) = 308a7c8f687253b4fc75de0c66016dd18666e697 8SHA1 (patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh) = 308a7c8f687253b4fc75de0c66016dd18666e697
 9SHA1 (patch-Source_JavaScriptCore_Sources.txt) = 51de2568e6255ee77f6ea7f3ab657eb3c43c8ce6
9SHA1 (patch-Source_JavaScriptCore_assembler_ARM64Assembler.h) = 79c282ca90d0ba2ef4769da40d4648f5f709951b 10SHA1 (patch-Source_JavaScriptCore_assembler_ARM64Assembler.h) = 79c282ca90d0ba2ef4769da40d4648f5f709951b
10SHA1 (patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h) = 70975aac175ec4131a4ed26a54dfe51e16ffb7cd 11SHA1 (patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h) = 70975aac175ec4131a4ed26a54dfe51e16ffb7cd
11SHA1 (patch-Source_JavaScriptCore_heap_MarkedSpace.cpp) = 709e5dcf4cdb834617c2ef542686bb2aa4aa37b3 12SHA1 (patch-Source_JavaScriptCore_heap_MarkedSpace.cpp) = 709e5dcf4cdb834617c2ef542686bb2aa4aa37b3
12SHA1 (patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp) = 7f6c0c57d46478e83c4ff21dae2415f44085ba32 13SHA1 (patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp) = 7f6c0c57d46478e83c4ff21dae2415f44085ba32
13SHA1 (patch-Source_JavaScriptCore_offlineasm_arm64.rb) = 8c05dafa317667bbf55504d05eeb8ae06fba4e93 14SHA1 (patch-Source_JavaScriptCore_offlineasm_arm64.rb) = 8c05dafa317667bbf55504d05eeb8ae06fba4e93
 15SHA1 (patch-Source_JavaScriptCore_runtime_IntlSegmenter.cpp) = 326b0405fc433e579c115e174e516f1c79e8edc5
 16SHA1 (patch-Source_JavaScriptCore_runtime_IntlSegmenter.h) = 36abe8dd1cf6fceefc05d8f6fe0d1a6c18f4d0c5
 17SHA1 (patch-Source_JavaScriptCore_runtime_IntlSegments.cpp) = 8c357e32a256c06f05c0aeb6bea485f90ef8219d
 18SHA1 (patch-Source_JavaScriptCore_runtime_IntlWorkaround.cpp) = b4a793edefa3c500b167d6fe3cdb9244ec38bcf5
14SHA1 (patch-Source_JavaScriptCore_runtime_MachineContext.h) = 23bc86a389f8009ec829c3ee0fe3effe3f20b012 19SHA1 (patch-Source_JavaScriptCore_runtime_MachineContext.h) = 23bc86a389f8009ec829c3ee0fe3effe3f20b012
15SHA1 (patch-Source_ThirdParty_ANGLE_src_common_third__party_smhasher_src_PMurHash.cpp) = 73dfe781efe7e8aa7d49094af8820a87c501818f 20SHA1 (patch-Source_ThirdParty_ANGLE_src_common_third__party_smhasher_src_PMurHash.cpp) = 73dfe781efe7e8aa7d49094af8820a87c501818f
16SHA1 (patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h) = 10debffda84bc752ed434657a337a466aad19a3a 21SHA1 (patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h) = 10debffda84bc752ed434657a337a466aad19a3a
17SHA1 (patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h) = a5454eb891ad1f9d8285c28af2e9efb4ff439e6b 22SHA1 (patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h) = a5454eb891ad1f9d8285c28af2e9efb4ff439e6b
18SHA1 (patch-Source_WTF_wtf_Assertions.h) = 427de20eba4627578087feaa7de2f23e80b9debf 23SHA1 (patch-Source_WTF_wtf_Assertions.h) = 427de20eba4627578087feaa7de2f23e80b9debf
19SHA1 (patch-Source_WTF_wtf_FileSystem.cpp) = 2fe7b7755646d9a1cc022aec3d01091766378aba 24SHA1 (patch-Source_WTF_wtf_FileSystem.cpp) = 2fe7b7755646d9a1cc022aec3d01091766378aba
20SHA1 (patch-Source_WTF_wtf_PlatformEnable.h) = eb5598c20c8453314daba7897066f15827bbede7 25SHA1 (patch-Source_WTF_wtf_PlatformEnable.h) = eb5598c20c8453314daba7897066f15827bbede7
21SHA1 (patch-Source_WTF_wtf_PlatformHave.h) = 3787817a0e288d00aa747c417aecd9abf52866d1 26SHA1 (patch-Source_WTF_wtf_PlatformHave.h) = 3787817a0e288d00aa747c417aecd9abf52866d1
22SHA1 (patch-Source_WTF_wtf_PlatformOS.h) = 80aa6ff20f10407d447fdb41606d4bb4989351aa 27SHA1 (patch-Source_WTF_wtf_PlatformOS.h) = 80aa6ff20f10407d447fdb41606d4bb4989351aa
23SHA1 (patch-Source_WTF_wtf_PlatformUse.h) = 595486b48e7d89378208c0a209a121ef136415e6 28SHA1 (patch-Source_WTF_wtf_PlatformUse.h) = 595486b48e7d89378208c0a209a121ef136415e6
24SHA1 (patch-Source_WTF_wtf_StackBounds.cpp) = 22a71daac8443f079ad8bcc7285cfd7319c972b3 29SHA1 (patch-Source_WTF_wtf_StackBounds.cpp) = 22a71daac8443f079ad8bcc7285cfd7319c972b3
25SHA1 (patch-Source_WebCore_Scripts_check-xcfilelists.sh) = b292baf2494bcd459d9af91386263123046c6615 30SHA1 (patch-Source_WebCore_Scripts_check-xcfilelists.sh) = b292baf2494bcd459d9af91386263123046c6615
26SHA1 (patch-Source_WebCore_Scripts_generate-unified-sources.sh) = 9b323aa1fa8e6e5599ac0a7ae08fbbed4348c70e 31SHA1 (patch-Source_WebCore_Scripts_generate-unified-sources.sh) = 9b323aa1fa8e6e5599ac0a7ae08fbbed4348c70e

File Added: pkgsrc/www/webkit-gtk/patches/Attic/patch-Source_JavaScriptCore_Sources.txt
$NetBSD: patch-Source_JavaScriptCore_Sources.txt,v 1.1 2021/04/25 12:00:24 leot Exp $

Fix build for ICU >= 69.

From:

 https://trac.webkit.org/changeset/275920/webkit?format=diff&new=275920

--- Source/JavaScriptCore/Sources.txt.orig	2021-02-26 09:57:05.000000000 +0000
+++ Source/JavaScriptCore/Sources.txt
@@ -848,6 +848,7 @@ runtime/IntlSegmenterConstructor.cpp
 runtime/IntlSegmenterPrototype.cpp
 runtime/IntlSegments.cpp
 runtime/IntlSegmentsPrototype.cpp
+runtime/IntlWorkaround.cpp @no-unify // Confine U_HIDE_DRAFT_API's effect to this file.
 runtime/IteratorOperations.cpp
 runtime/IteratorPrototype.cpp
 runtime/JSArray.cpp

File Added: pkgsrc/www/webkit-gtk/patches/Attic/patch-Source_JavaScriptCore_runtime_IntlSegmenter.cpp
$NetBSD: patch-Source_JavaScriptCore_runtime_IntlSegmenter.cpp,v 1.1 2021/04/25 12:00:24 leot Exp $

Fix build for ICU >= 69.

From:

 https://trac.webkit.org/changeset/275920/webkit?format=diff&new=275920

--- Source/JavaScriptCore/runtime/IntlSegmenter.cpp.orig	2021-02-26 09:57:05.000000000 +0000
+++ Source/JavaScriptCore/runtime/IntlSegmenter.cpp
@@ -125,7 +125,7 @@ JSValue IntlSegmenter::segment(JSGlobalO
     auto upconvertedCharacters = Box<Vector<UChar>>::create(string.charactersWithoutNullTermination());
 
     UErrorCode status = U_ZERO_ERROR;
-    auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(ubrk_safeClone(m_segmenter.get(), nullptr, nullptr, &status));
+    auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(cloneUBreakIterator(m_segmenter.get(), &status));
     if (U_FAILURE(status)) {
         throwTypeError(globalObject, scope, "failed to initialize Segments"_s);
         return { };

File Added: pkgsrc/www/webkit-gtk/patches/Attic/patch-Source_JavaScriptCore_runtime_IntlSegmenter.h
$NetBSD: patch-Source_JavaScriptCore_runtime_IntlSegmenter.h,v 1.1 2021/04/25 12:00:24 leot Exp $

Fix build for ICU >= 69.

From:

 https://trac.webkit.org/changeset/275920/webkit?format=diff&new=275920

--- Source/JavaScriptCore/runtime/IntlSegmenter.h.orig	2021-02-26 09:57:05.000000000 +0000
+++ Source/JavaScriptCore/runtime/IntlSegmenter.h
@@ -75,4 +75,8 @@ private:
     Granularity m_granularity { Granularity::Grapheme };
 };
 
+// Abstraction to call ubrk_safeClone or ubrk_clone depending on ICU version.
+// This is implemented in IntlWorkaround.cpp in order to confine draft API visibility.
+UBreakIterator* cloneUBreakIterator(const UBreakIterator*, UErrorCode*);
+
 } // namespace JSC

File Added: pkgsrc/www/webkit-gtk/patches/Attic/patch-Source_JavaScriptCore_runtime_IntlSegments.cpp
$NetBSD: patch-Source_JavaScriptCore_runtime_IntlSegments.cpp,v 1.1 2021/04/25 12:00:24 leot Exp $

Fix build for ICU >= 69.

From:

 https://trac.webkit.org/changeset/275920/webkit?format=diff&new=275920

--- Source/JavaScriptCore/runtime/IntlSegments.cpp.orig	2021-02-26 09:57:05.000000000 +0000
+++ Source/JavaScriptCore/runtime/IntlSegments.cpp
@@ -100,7 +100,7 @@ JSObject* IntlSegments::createSegmentIte
     auto scope = DECLARE_THROW_SCOPE(vm);
 
     UErrorCode status = U_ZERO_ERROR;
-    auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(ubrk_safeClone(m_segmenter.get(), nullptr, nullptr, &status));
+    auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(cloneUBreakIterator(m_segmenter.get(), &status));
     if (U_FAILURE(status)) {
         throwTypeError(globalObject, scope, "failed to initialize SegmentIterator"_s);
         return nullptr;

File Added: pkgsrc/www/webkit-gtk/patches/Attic/patch-Source_JavaScriptCore_runtime_IntlWorkaround.cpp
$NetBSD: patch-Source_JavaScriptCore_runtime_IntlWorkaround.cpp,v 1.1 2021/04/25 12:00:24 leot Exp $

Fix build for ICU >= 69.

From:

 https://trac.webkit.org/changeset/275920/webkit?format=diff&new=275920

--- Source/JavaScriptCore/runtime/IntlWorkaround.cpp.orig	2021-04-25 09:57:43.581734903 +0000
+++ Source/JavaScriptCore/runtime/IntlWorkaround.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2021 Sony Interactive Entertainment Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include <unicode/uvernum.h>
+
+// ICU 69 introduces draft API ubrk_clone and deprecates ubrk_safeClone.
+#if U_ICU_VERSION_MAJOR_NUM >= 69
+#define HAVE_ICU_UBRK_CLONE 1
+#endif
+
+#if defined(U_HIDE_DRAFT_API)
+#undef U_HIDE_DRAFT_API
+#endif
+#include <unicode/ubrk.h>
+
+namespace JSC {
+
+UBreakIterator* cloneUBreakIterator(const UBreakIterator*, UErrorCode*);
+
+UBreakIterator* cloneUBreakIterator(const UBreakIterator* iterator, UErrorCode* status)
+{
+#if HAVE(ICU_UBRK_CLONE)
+    return ubrk_clone(iterator, status);
+#else
+    return ubrk_safeClone(iterator, nullptr, nullptr, status);
+#endif
+}
+
+} // namespace JSC