pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
webkit-gtk: Import webkit-gtk-2.30.2 as wip/webkit-gtk4
Module Name: pkgsrc-wip
Committed By: Dan Cîrnaț <dan%alt.md@localhost>
Pushed By: cirnatdan
Date: Sat Nov 21 01:17:06 2020 +0100
Changeset: fdd6fafaef89f8cf8e997b5e0179f759d7c9ee34
Added Files:
webkit-gtk4/DESCR
webkit-gtk4/MESSAGE
webkit-gtk4/Makefile
webkit-gtk4/PLIST
webkit-gtk4/buildlink3.mk
webkit-gtk4/distinfo
webkit-gtk4/hacks.mk
webkit-gtk4/options.mk
webkit-gtk4/patches/patch-CMakeLists.txt
webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh
webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh
webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARM64Assembler.h
webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h
webkit-gtk4/patches/patch-Source_JavaScriptCore_heap_MarkedSpace.cpp
webkit-gtk4/patches/patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp
webkit-gtk4/patches/patch-Source_JavaScriptCore_offlineasm_arm64.rb
webkit-gtk4/patches/patch-Source_JavaScriptCore_runtime_MachineContext.h
webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_adjust-angle-include-paths.sh
webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h
webkit-gtk4/patches/patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h
webkit-gtk4/patches/patch-Source_WTF_CMakeLists.txt
webkit-gtk4/patches/patch-Source_WTF_wtf_FileSystem.cpp
webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformEnable.h
webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformGTK.cmake
webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformHave.h
webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformOS.h
webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformUse.h
webkit-gtk4/patches/patch-Source_WTF_wtf_RAMSize.cpp
webkit-gtk4/patches/patch-Source_WTF_wtf_StackBounds.cpp
webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProvider.h
webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderLatin1.cpp
webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderUTF16.cpp
webkit-gtk4/patches/patch-Source_WebCore_Scripts_check-xcfilelists.sh
webkit-gtk4/patches/patch-Source_WebCore_Scripts_generate-unified-sources.sh
webkit-gtk4/patches/patch-Source_WebCore_crypto_algorithms_CryptoAlgorithmAES__GCM.cpp
webkit-gtk4/patches/patch-Source_WebCore_inspector_InspectorFrontendHost.cpp
webkit-gtk4/patches/patch-Source_WebCore_platform_graphics_filters_FEMorphology.cpp
webkit-gtk4/patches/patch-Source_WebCore_platform_gtk_PlatformScreenGtk.cpp
webkit-gtk4/patches/patch-Source_WebCore_platform_text_TextCodecICU.cpp
webkit-gtk4/patches/patch-Source_WebCore_rendering_RenderLayerBacking.h
webkit-gtk4/patches/patch-Source_WebCore_rendering_shapes_RasterShape.cpp
webkit-gtk4/patches/patch-Source_WebKit_CMakeLists.txt
webkit-gtk4/patches/patch-Source_WebKit_NetworkProcess_cache_NetworkCacheFileSystem.cpp
webkit-gtk4/patches/patch-Source_WebKit_PlatformGTK.cmake
webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_ArgumentCoders.h
webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_unix_ConnectionUnix.cpp
webkit-gtk4/patches/patch-Source_WebKit_Platform_SharedMemory.h
webkit-gtk4/patches/patch-Source_WebKit_Platform_classifier_ResourceLoadStatisticsClassifier.cpp
webkit-gtk4/patches/patch-Source_WebKit_Scripts_check-xcfilelists.sh
webkit-gtk4/patches/patch-Source_WebKit_Scripts_generate-unified-sources.sh
webkit-gtk4/patches/patch-Source_WebKit_Shared_SandboxExtension.h
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitAuthenticationDialog.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitScriptDialogImpl.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewBase.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewDialog.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewGtk.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_CoordinatedGraphics_DrawingAreaProxyCoordinatedGraphics.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_Inspector_gtk_WebKitInspectorWindow.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebDataListSuggestionsDropdownGtk.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPageProxyGtk.cpp
webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPopupMenuProxyGtk.cpp
webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_BPlatform.h
webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_VMAllocate.h
webkit-gtk4/patches/patch-Source_cmake_FindGTK.cmake
webkit-gtk4/patches/patch-Source_cmake_OptionsCommon.cmake
webkit-gtk4/patches/patch-Source_cmake_WebKitFindPackage.cmake
webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserSearchBox.c
webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserWindow.c
webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_check-xcfilelists.sh
webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_generate-unified-sources.sh
webkit-gtk4/patches/patch-aj
Log Message:
webkit-gtk: Import webkit-gtk-2.30.2 as wip/webkit-gtk4
Contains patches for GTK4 and the Quartz backend
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=fdd6fafaef89f8cf8e997b5e0179f759d7c9ee34
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
webkit-gtk4/DESCR | 7 +
webkit-gtk4/MESSAGE | 14 ++
webkit-gtk4/Makefile | 168 +++++++++++++
webkit-gtk4/PLIST | 278 +++++++++++++++++++++
webkit-gtk4/buildlink3.mk | 39 +++
webkit-gtk4/distinfo | 69 +++++
webkit-gtk4/hacks.mk | 25 ++
webkit-gtk4/options.mk | 97 +++++++
webkit-gtk4/patches/patch-CMakeLists.txt | 37 +++
...rce_JavaScriptCore_Scripts_check-xcfilelists.sh | 18 ++
...aScriptCore_Scripts_generate-unified-sources.sh | 15 ++
...ource_JavaScriptCore_assembler_ARM64Assembler.h | 17 ++
...ource_JavaScriptCore_assembler_ARMv7Assembler.h | 30 +++
...atch-Source_JavaScriptCore_heap_MarkedSpace.cpp | 15 ++
...urce_JavaScriptCore_jit_ExecutableAllocator.cpp | 19 ++
...patch-Source_JavaScriptCore_offlineasm_arm64.rb | 19 ++
...-Source_JavaScriptCore_runtime_MachineContext.h | 121 +++++++++
..._ThirdParty_ANGLE_adjust-angle-include-paths.sh | 15 ++
...rty_ANGLE_src_compiler_translator_SymbolTable.h | 14 ++
...Party_gtest_include_gtest_internal_gtest-port.h | 36 +++
.../patches/patch-Source_WTF_CMakeLists.txt | 14 ++
.../patches/patch-Source_WTF_wtf_FileSystem.cpp | 16 ++
.../patches/patch-Source_WTF_wtf_PlatformEnable.h | 22 ++
.../patches/patch-Source_WTF_wtf_PlatformGTK.cmake | 15 ++
.../patches/patch-Source_WTF_wtf_PlatformHave.h | 24 ++
.../patches/patch-Source_WTF_wtf_PlatformOS.h | 26 ++
.../patches/patch-Source_WTF_wtf_PlatformUse.h | 15 ++
.../patches/patch-Source_WTF_wtf_RAMSize.cpp | 49 ++++
.../patches/patch-Source_WTF_wtf_StackBounds.cpp | 14 ++
.../patch-Source_WTF_wtf_text_icu_UTextProvider.h | 39 +++
...Source_WTF_wtf_text_icu_UTextProviderLatin1.cpp | 64 +++++
...-Source_WTF_wtf_text_icu_UTextProviderUTF16.cpp | 27 ++
...tch-Source_WebCore_Scripts_check-xcfilelists.sh | 18 ++
...rce_WebCore_Scripts_generate-unified-sources.sh | 24 ++
...e_crypto_algorithms_CryptoAlgorithmAES__GCM.cpp | 17 ++
...rce_WebCore_inspector_InspectorFrontendHost.cpp | 15 ++
...Core_platform_graphics_filters_FEMorphology.cpp | 15 ++
...urce_WebCore_platform_gtk_PlatformScreenGtk.cpp | 32 +++
...h-Source_WebCore_platform_text_TextCodecICU.cpp | 18 ++
...h-Source_WebCore_rendering_RenderLayerBacking.h | 17 ++
...Source_WebCore_rendering_shapes_RasterShape.cpp | 15 ++
.../patches/patch-Source_WebKit_CMakeLists.txt | 17 ++
...NetworkProcess_cache_NetworkCacheFileSystem.cpp | 19 ++
.../patches/patch-Source_WebKit_PlatformGTK.cmake | 27 ++
...tch-Source_WebKit_Platform_IPC_ArgumentCoders.h | 15 ++
...rce_WebKit_Platform_IPC_unix_ConnectionUnix.cpp | 24 ++
.../patch-Source_WebKit_Platform_SharedMemory.h | 17 ++
...classifier_ResourceLoadStatisticsClassifier.cpp | 15 ++
...atch-Source_WebKit_Scripts_check-xcfilelists.sh | 18 ++
...urce_WebKit_Scripts_generate-unified-sources.sh | 15 ++
.../patch-Source_WebKit_Shared_SandboxExtension.h | 15 ++
...IProcess_API_gtk_WebKitAuthenticationDialog.cpp | 37 +++
...it_UIProcess_API_gtk_WebKitScriptDialogImpl.cpp | 29 +++
..._WebKit_UIProcess_API_gtk_WebKitWebViewBase.cpp | 34 +++
...ebKit_UIProcess_API_gtk_WebKitWebViewDialog.cpp | 35 +++
...e_WebKit_UIProcess_API_gtk_WebKitWebViewGtk.cpp | 23 ++
...raphics_DrawingAreaProxyCoordinatedGraphics.cpp | 18 ++
...Process_Inspector_gtk_WebKitInspectorWindow.cpp | 21 ++
...ocess_gtk_WebDataListSuggestionsDropdownGtk.cpp | 29 +++
...Source_WebKit_UIProcess_gtk_WebPageProxyGtk.cpp | 17 ++
...e_WebKit_UIProcess_gtk_WebPopupMenuProxyGtk.cpp | 36 +++
.../patch-Source_bmalloc_bmalloc_BPlatform.h | 25 ++
.../patch-Source_bmalloc_bmalloc_VMAllocate.h | 28 +++
.../patches/patch-Source_cmake_FindGTK.cmake | 28 +++
.../patches/patch-Source_cmake_OptionsCommon.cmake | 21 ++
.../patch-Source_cmake_WebKitFindPackage.cmake | 26 ++
.../patch-Tools_MiniBrowser_gtk_BrowserSearchBox.c | 15 ++
.../patch-Tools_MiniBrowser_gtk_BrowserWindow.c | 88 +++++++
...ools_TestWebKitAPI_Scripts_check-xcfilelists.sh | 18 ++
...stWebKitAPI_Scripts_generate-unified-sources.sh | 15 ++
webkit-gtk4/patches/patch-aj | 15 ++
71 files changed, 2289 insertions(+)
diffs:
diff --git a/webkit-gtk4/DESCR b/webkit-gtk4/DESCR
new file mode 100644
index 0000000000..8f5106660f
--- /dev/null
+++ b/webkit-gtk4/DESCR
@@ -0,0 +1,7 @@
+WebKit is an open source web browser engine. WebKit is also the name of
+the Mac OS X system framework version of the engine that's used by
+Safari, Dashboard, Mail, and many other OS X applications. WebKit's HTML
+and JavaScript code began as a branch of the KHTML and KJS libraries
+from KDE.
+
+This is the GTK port of the engine.
diff --git a/webkit-gtk4/MESSAGE b/webkit-gtk4/MESSAGE
new file mode 100644
index 0000000000..97df427a4e
--- /dev/null
+++ b/webkit-gtk4/MESSAGE
@@ -0,0 +1,14 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2020/04/23 17:01:16 nia Exp $
+
+WebKit needs GStreamer plugins to play web audio and video.
+
+Installing the following should be enough on BSD/Solaris:
+
+* gst-plugins1-libav
+* gst-plugins1-oss
+
+Installing gst-plugins1-alsa or gst-plugins1-pulse will be necessary
+for audio output on Linux.
+
+===========================================================================
diff --git a/webkit-gtk4/Makefile b/webkit-gtk4/Makefile
new file mode 100644
index 0000000000..7aa4111b3b
--- /dev/null
+++ b/webkit-gtk4/Makefile
@@ -0,0 +1,168 @@
+# $NetBSD: Makefile,v 1.197 2020/11/06 15:06:49 nia Exp $
+
+DISTNAME= webkitgtk-2.30.2
+PKGNAME= ${DISTNAME:S/webkitgtk/webkit-gtk4/}
+CATEGORIES= www
+MASTER_SITES= https://www.webkitgtk.org/releases/
+EXTRACT_SUFX= .tar.xz
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://www.webkitgtk.org/
+COMMENT= GTK port of the WebKit browser engine
+LICENSE= 2-clause-bsd AND gnu-lgpl-v2
+
+# shm_open(3) and shm_unlink(3) appeared in NetBSD 7.0
+NOT_FOR_PLATFORM= NetBSD-[1-6].*-*
+
+TOOL_DEPENDS+= gettext-tools>=0.18:../../devel/gettext-tools
+TOOL_DEPENDS+= ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat
+
+USE_CMAKE= yes
+USE_LANGUAGES= c c++11
+USE_TOOLS+= automake bash bison flex gmake perl pkg-config msgfmt
+
+# Enabling -gdwarf-2 hits GNU ar limits on file size.
+CTF_SUPPORTED= no
+
+# GCC >= 7.3.0 is required, checked via CMakeLists.txt
+GCC_REQD+= 7
+USE_GCC_RUNTIME= yes
+
+# Using ld.gold subverts Pkgsrc wrappers, and this package also crashes buggy
+# versions of ld.gold.
+CMAKE_ARGS+= -DUSE_LD_GOLD=OFF
+
+PKGCONFIG_OVERRIDE+= Source/JavaScriptCore/javascriptcoregtk.pc.in
+PKGCONFIG_OVERRIDE+= Source/WebKit/gtk/webkit2gtk-web-extension.pc.in
+PKGCONFIG_OVERRIDE+= Source/WebKit/gtk/webkit2gtk.pc.in
+
+CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+= -DPORT=GTK
+CMAKE_ARGS+= -DENABLE_X11_TARGET=ON
+CMAKE_ARGS+= -DENABLE_MINIBROWSER=ON
+CMAKE_ARGS+= -DENABLE_GEOLOCATION=OFF
+CMAKE_ARGS+= -DENABLE_BUBBLEWRAP_SANDBOX=OFF
+CMAKE_ARGS+= -DUSE_GSTREAMER_GL=OFF
+CMAKE_ARGS+= -DUSE_LIBHYPHEN=OFF
+CMAKE_ARGS+= -DUSE_OPENJPEG=OFF
+CMAKE_ARGS+= -DUSE_SYSTEMD=OFF
+CMAKE_ARGS+= -DUSE_GTK4=ON
+CMAKE_ARGS+= -DCMAKE_INSTALL_OLDINCLUDEDIR=${PREFIX}/include
+
+REPLACE_PERL+= Source/JavaScriptCore/Scripts/*.pl
+REPLACE_PERL+= Source/JavaScriptCore/create_hash_table
+REPLACE_PERL+= Source/WebCore/Scripts/*.pl
+REPLACE_PERL+= Source/WebCore/bindings/scripts/*.pl
+REPLACE_PERL+= Source/WebCore/bindings/scripts/*.pm
+REPLACE_PERL+= Source/WebCore/css/*.pl
+REPLACE_PERL+= Source/WebCore/dom/*.pl
+REPLACE_PERL+= Source/WebCore/make-hash-tools.pl
+REPLACE_PERL+= Source/WebInspectorUI/Scripts/*.pl
+REPLACE_PERL+= Source/WebKit/Scripts/*.pl
+REPLACE_PERL+= Source/cmake/tools/scripts/*.pl
+
+REPLACE_PYTHON+= Source/JavaScriptCore/Scripts/*.py
+REPLACE_PYTHON+= Source/JavaScriptCore/Scripts/wkbuiltins/*.py
+REPLACE_PYTHON+= Source/JavaScriptCore/inspector/scripts/*.py
+REPLACE_PYTHON+= Source/JavaScriptCore/inspector/scripts/codegen/*.py
+REPLACE_PYTHON+= Source/JavaScriptCore/wasm/*.py
+REPLACE_PYTHON+= Source/JavaScriptCore/yarr/*.py
+REPLACE_PYTHON+= Source/JavaScriptCore/yarr/create_regex_tables
+REPLACE_PYTHON+= Source/JavaScriptCore/yarr/generateYarrCanonicalizeUnicode
+REPLACE_PYTHON+= Source/ThirdParty/ANGLE/src/compiler/translator/*.py
+REPLACE_PYTHON+= Source/ThirdParty/ANGLE/src/libANGLE/*.py
+REPLACE_PYTHON+= Source/ThirdParty/gtest/scripts/*.py
+REPLACE_PYTHON+= Source/ThirdParty/gtest/test/*.py
+REPLACE_PYTHON+= Source/ThirdParty/gtest/xcode/Scripts/*.py
+REPLACE_PYTHON+= Source/WebCore/css/*.py
+REPLACE_PYTHON+= Source/WebCore/html/parser/create-html-entity-table
+REPLACE_PYTHON+= Source/WebCore/platform/network/create-http-header-name-table
+REPLACE_PYTHON+= Source/WebKit/Scripts/*.py
+REPLACE_PYTHON+= Tools/glib/*.py
+REPLACE_PYTHON+= Tools/gtkdoc/generate-gtkdoc
+
+REPLACE_BASH+= Source/JavaScriptCore/postprocess-headers.sh
+REPLACE_BASH+= Source/ThirdParty/ANGLE/adjust-angle-include-paths-rule
+REPLACE_BASH+= Source/ThirdParty/gtest/xcode/Samples/FrameworkSample/runtests.sh
+REPLACE_BASH+= Source/ThirdParty/gtest/xcode/Scripts/runtests.sh
+REPLACE_BASH+= Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh
+REPLACE_BASH+= Source/WebKit/Scripts/generate-https-upgrade-database.sh
+REPLACE_BASH+= Source/WebKit/Scripts/process-entitlements.sh
+REPLACE_BASH+= Tools/gtk/install-dependencies
+
+REPLACE_RUBY+= Source/JavaScriptCore/b3/air/*.rb
+REPLACE_RUBY+= Source/JavaScriptCore/offlineasm/*.rb
+REPLACE_RUBY+= Source/WebCore/Scripts/*.rb
+REPLACE_RUBY+= Source/WebCore/domjit/*.rb
+REPLACE_RUBY+= Source/WebInspectorUI/Scripts/*.rb
+REPLACE_RUBY+= Source/WebKit/Scripts/*.rb
+
+SUBST_CLASSES+= python
+SUBST_FILES.python+= Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl
+SUBST_SED.python+= -e 's,\(.\)python.;,\1${PYTHONBIN}\1;,'
+SUBST_STAGE.python= pre-configure
+SUBST_MESSAGE.python= Fixing path to python binary.
+
+.include "../../lang/ruby/rubyversion.mk"
+.include "../../lang/ruby/replace.mk"
+TOOL_DEPENDS+= ${RUBY_BASE}>=${RUBY_VERSION}:${RUBY_SRCDIR}
+CMAKE_ARGS+= -DRUBY_EXECUTABLE=${RUBY}
+
+PYTHON_FOR_BUILD_ONLY= yes
+.include "../../lang/python/application.mk"
+CMAKE_ARGS+= -DPYTHON_EXECUTABLE=${PYTHONBIN}
+
+CXXFLAGS.SunOS+= -fpermissive
+
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+CXXFLAGS+= -Wno-c++11-narrowing
+.endif
+
+# This does not disable optimisations, merely avoids #error if there are none.
+CFLAGS+= -DRELEASE_WITHOUT_OPTIMIZATIONS
+
+# Needed for JavaScript JIT
+NOT_PAX_MPROTECT_SAFE+= libexec/webkit2gtk-4.0/WebKitWebProcess
+NOT_PAX_MPROTECT_SAFE+= libexec/webkit2gtk-4.0/jsc
+
+.include "options.mk"
+
+
+.if ${OPSYS} == "Darwin"
+.include "../../graphics/MesaLib/buildlink3.mk"
+CMAKE_ARGS+= -DENABLE_X11_TARGET=OFF
+CMAKE_ARGS+= -DENABLE_QUARTZ_TARGET=ON
+CMAKE_ARGS+= -DENABLE_GRAPHICS_CONTEXT_GL=OFF
+.endif
+
+BUILDLINK_API_DEPENDS.glib2+= glib2>=2.32.1
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../devel/gperf/buildlink3.mk"
+.include "../../wip/pango/buildlink3.mk"
+.include "../../fonts/harfbuzz-icu/buildlink3.mk"
+.include "../../fonts/woff2/buildlink3.mk"
+.include "../../graphics/cairo-gobject/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../graphics/libwebp/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+BUILDLINK_API_DEPENDS.png+= png>=1.5.1beta08
+.include "../../graphics/png/buildlink3.mk"
+BUILDLINK_API_DEPENDS.gstreamer1+= gstreamer1>=1.0.3
+.include "../../multimedia/gstreamer1/buildlink3.mk"
+BUILDLINK_API_DEPENDS.gst-plugins1-base+= gst-plugins1-base>=1.0.3
+.include "../../multimedia/gst-plugins1-base/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libsoup+= libsoup>=2.42.2nb3
+.include "../../net/libsoup/buildlink3.mk"
+.include "../../security/libsecret/buildlink3.mk"
+.include "../../security/libtasn1/buildlink3.mk"
+.include "../../sysutils/libnotify/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../wip/gtk4/buildlink3.mk"
+.include "../../x11/libXdamage/buildlink3.mk"
+.include "../../x11/libXt/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/webkit-gtk4/PLIST b/webkit-gtk4/PLIST
new file mode 100644
index 0000000000..2bf3b3e622
--- /dev/null
+++ b/webkit-gtk4/PLIST
@@ -0,0 +1,278 @@
+@comment $NetBSD$
+bin/WebKitWebDriver
+include/webkitgtk-5.0/JavaScriptCore/JSBase.h
+include/webkitgtk-5.0/JavaScriptCore/JSContextRef.h
+include/webkitgtk-5.0/JavaScriptCore/JSObjectRef.h
+include/webkitgtk-5.0/JavaScriptCore/JSStringRef.h
+include/webkitgtk-5.0/JavaScriptCore/JSTypedArray.h
+include/webkitgtk-5.0/JavaScriptCore/JSValueRef.h
+include/webkitgtk-5.0/JavaScriptCore/JavaScript.h
+include/webkitgtk-5.0/JavaScriptCore/WebKitAvailability.h
+include/webkitgtk-5.0/jsc/JSCAutocleanups.h
+include/webkitgtk-5.0/jsc/JSCClass.h
+include/webkitgtk-5.0/jsc/JSCContext.h
+include/webkitgtk-5.0/jsc/JSCDefines.h
+include/webkitgtk-5.0/jsc/JSCException.h
+include/webkitgtk-5.0/jsc/JSCOptions.h
+include/webkitgtk-5.0/jsc/JSCValue.h
+include/webkitgtk-5.0/jsc/JSCVersion.h
+include/webkitgtk-5.0/jsc/JSCVirtualMachine.h
+include/webkitgtk-5.0/jsc/JSCWeakValue.h
+include/webkitgtk-5.0/jsc/jsc.h
+include/webkitgtk-5.0/webkit2/WebKitApplicationInfo.h
+include/webkitgtk-5.0/webkit2/WebKitAuthenticationRequest.h
+include/webkitgtk-5.0/webkit2/WebKitAutocleanups.h
+include/webkitgtk-5.0/webkit2/WebKitAutomationSession.h
+include/webkitgtk-5.0/webkit2/WebKitBackForwardList.h
+include/webkitgtk-5.0/webkit2/WebKitBackForwardListItem.h
+include/webkitgtk-5.0/webkit2/WebKitColorChooserRequest.h
+include/webkitgtk-5.0/webkit2/WebKitConsoleMessage.h
+include/webkitgtk-5.0/webkit2/WebKitContextMenu.h
+include/webkitgtk-5.0/webkit2/WebKitContextMenuActions.h
+include/webkitgtk-5.0/webkit2/WebKitContextMenuItem.h
+include/webkitgtk-5.0/webkit2/WebKitCookieManager.h
+include/webkitgtk-5.0/webkit2/WebKitCredential.h
+include/webkitgtk-5.0/webkit2/WebKitDefines.h
+include/webkitgtk-5.0/webkit2/WebKitDeviceInfoPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitDownload.h
+include/webkitgtk-5.0/webkit2/WebKitEditingCommands.h
+include/webkitgtk-5.0/webkit2/WebKitEditorState.h
+include/webkitgtk-5.0/webkit2/WebKitEnumTypes.h
+include/webkitgtk-5.0/webkit2/WebKitError.h
+include/webkitgtk-5.0/webkit2/WebKitFaviconDatabase.h
+include/webkitgtk-5.0/webkit2/WebKitFileChooserRequest.h
+include/webkitgtk-5.0/webkit2/WebKitFindController.h
+include/webkitgtk-5.0/webkit2/WebKitFormSubmissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitForwardDeclarations.h
+include/webkitgtk-5.0/webkit2/WebKitFrame.h
+include/webkitgtk-5.0/webkit2/WebKitGeolocationManager.h
+include/webkitgtk-5.0/webkit2/WebKitGeolocationPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitHitTestResult.h
+include/webkitgtk-5.0/webkit2/WebKitInputMethodContext.h
+include/webkitgtk-5.0/webkit2/WebKitInstallMissingMediaPluginsPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitJavascriptResult.h
+include/webkitgtk-5.0/webkit2/WebKitMimeInfo.h
+include/webkitgtk-5.0/webkit2/WebKitNavigationAction.h
+include/webkitgtk-5.0/webkit2/WebKitNavigationPolicyDecision.h
+include/webkitgtk-5.0/webkit2/WebKitNetworkProxySettings.h
+include/webkitgtk-5.0/webkit2/WebKitNotification.h
+include/webkitgtk-5.0/webkit2/WebKitNotificationPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitOptionMenu.h
+include/webkitgtk-5.0/webkit2/WebKitOptionMenuItem.h
+include/webkitgtk-5.0/webkit2/WebKitPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitPlugin.h
+include/webkitgtk-5.0/webkit2/WebKitPointerLockPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitPolicyDecision.h
+include/webkitgtk-5.0/webkit2/WebKitPrintCustomWidget.h
+include/webkitgtk-5.0/webkit2/WebKitPrintOperation.h
+include/webkitgtk-5.0/webkit2/WebKitResponsePolicyDecision.h
+include/webkitgtk-5.0/webkit2/WebKitScriptDialog.h
+include/webkitgtk-5.0/webkit2/WebKitScriptWorld.h
+include/webkitgtk-5.0/webkit2/WebKitSecurityManager.h
+include/webkitgtk-5.0/webkit2/WebKitSecurityOrigin.h
+include/webkitgtk-5.0/webkit2/WebKitSettings.h
+include/webkitgtk-5.0/webkit2/WebKitURIRequest.h
+include/webkitgtk-5.0/webkit2/WebKitURIResponse.h
+include/webkitgtk-5.0/webkit2/WebKitURISchemeRequest.h
+include/webkitgtk-5.0/webkit2/WebKitURIUtilities.h
+include/webkitgtk-5.0/webkit2/WebKitUserContent.h
+include/webkitgtk-5.0/webkit2/WebKitUserContentFilterStore.h
+include/webkitgtk-5.0/webkit2/WebKitUserContentManager.h
+include/webkitgtk-5.0/webkit2/WebKitUserMediaPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitUserMessage.h
+include/webkitgtk-5.0/webkit2/WebKitVersion.h
+include/webkitgtk-5.0/webkit2/WebKitWebContext.h
+include/webkitgtk-5.0/webkit2/WebKitWebEditor.h
+include/webkitgtk-5.0/webkit2/WebKitWebExtension.h
+include/webkitgtk-5.0/webkit2/WebKitWebExtensionAutocleanups.h
+include/webkitgtk-5.0/webkit2/WebKitWebHitTestResult.h
+include/webkitgtk-5.0/webkit2/WebKitWebInspector.h
+include/webkitgtk-5.0/webkit2/WebKitWebPage.h
+include/webkitgtk-5.0/webkit2/WebKitWebProcessEnumTypes.h
+include/webkitgtk-5.0/webkit2/WebKitWebResource.h
+include/webkitgtk-5.0/webkit2/WebKitWebView.h
+include/webkitgtk-5.0/webkit2/WebKitWebViewBase.h
+include/webkitgtk-5.0/webkit2/WebKitWebViewSessionState.h
+include/webkitgtk-5.0/webkit2/WebKitWebsiteData.h
+include/webkitgtk-5.0/webkit2/WebKitWebsiteDataAccessPermissionRequest.h
+include/webkitgtk-5.0/webkit2/WebKitWebsiteDataManager.h
+include/webkitgtk-5.0/webkit2/WebKitWebsitePolicies.h
+include/webkitgtk-5.0/webkit2/WebKitWindowProperties.h
+include/webkitgtk-5.0/webkit2/webkit-web-extension.h
+include/webkitgtk-5.0/webkit2/webkit2.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMAttr.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMBlob.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCDATASection.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCSSRule.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCSSRuleList.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCSSStyleDeclaration.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCSSStyleSheet.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCSSValue.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCharacterData.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMClientRect.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMClientRectList.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMComment.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCustom.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMCustomUnstable.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDOMImplementation.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDOMSelection.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDOMTokenList.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDOMWindow.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDOMWindowUnstable.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDeprecated.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDocument.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDocumentFragment.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDocumentFragmentUnstable.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDocumentType.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMDocumentUnstable.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMElementUnstable.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMEvent.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMEventTarget.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMFile.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMFileList.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLAnchorElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLAppletElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLAreaElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLBRElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLBaseElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLBodyElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLButtonElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLCanvasElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLCollection.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLDListElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLDirectoryElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLDivElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLDocument.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLElementUnstable.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLEmbedElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLFieldSetElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLFontElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLFormElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLFrameElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLFrameSetElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLHRElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLHeadElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLHeadingElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLHtmlElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLIFrameElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLImageElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLInputElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLLIElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLLabelElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLLegendElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLLinkElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLMapElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLMarqueeElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLMenuElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLMetaElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLModElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLOListElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLObjectElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLOptGroupElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLOptionElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLOptionsCollection.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLParagraphElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLParamElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLPreElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLQuoteElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLScriptElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLSelectElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLStyleElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTableCaptionElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTableCellElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTableColElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTableElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTableRowElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTableSectionElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTextAreaElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLTitleElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMHTMLUListElement.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMKeyboardEvent.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMMediaList.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMMouseEvent.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMNamedNodeMap.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMNode.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMNodeFilter.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMNodeIterator.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMNodeList.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMObject.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMProcessingInstruction.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMRange.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMRangeUnstable.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMStyleSheet.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMStyleSheetList.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMText.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMTreeWalker.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMUIEvent.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMWheelEvent.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMXPathExpression.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMXPathNSResolver.h
+include/webkitgtk-5.0/webkitdom/WebKitDOMXPathResult.h
+include/webkitgtk-5.0/webkitdom/webkitdom.h
+include/webkitgtk-5.0/webkitdom/webkitdomautocleanups.h
+include/webkitgtk-5.0/webkitdom/webkitdomdefines.h
+lib/libjavascriptcoregtk-5.0.18.17.10.dylib
+lib/libjavascriptcoregtk-5.0.18.dylib
+lib/libjavascriptcoregtk-5.0.dylib
+lib/libwebkit2gtk-5.0.0.0.0.dylib
+lib/libwebkit2gtk-5.0.0.dylib
+lib/libwebkit2gtk-5.0.dylib
+lib/pkgconfig/javascriptcoregtk-5.0.pc
+lib/pkgconfig/webkit2gtk-5.0.pc
+lib/pkgconfig/webkit2gtk-web-extension-5.0.pc
+lib/webkit2gtk-5.0/injected-bundle/libwebkit2gtkinjectedbundle.so
+libexec/webkit2gtk-5.0/MiniBrowser
+libexec/webkit2gtk-5.0/WebKitNetworkProcess
+libexec/webkit2gtk-5.0/WebKitWebProcess
+libexec/webkit2gtk-5.0/jsc
+share/locale/ar/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/as/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/bg/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/ca/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/cs/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/da/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/de/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/el/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/en_CA/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/en_GB/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/eo/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/es/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/et/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/eu/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/fi/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/fr/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/gl/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/gu/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/he/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/hi/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/hu/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/id/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/it/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/ja/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/kn/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/ko/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/lt/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/lv/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/ml/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/mr/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/nb/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/nl/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/or/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/pa/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/pl/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/pt/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/pt_BR/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/ro/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/ru/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/sl/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/sr/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/sr@latin/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/sv/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/ta/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/te/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/tr/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/uk/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/vi/LC_MESSAGES/WebKit2GTK-5.0.mo
+share/locale/zh_CN/LC_MESSAGES/WebKit2GTK-5.0.mo
diff --git a/webkit-gtk4/buildlink3.mk b/webkit-gtk4/buildlink3.mk
new file mode 100644
index 0000000000..48ed2723df
--- /dev/null
+++ b/webkit-gtk4/buildlink3.mk
@@ -0,0 +1,39 @@
+# $NetBSD: buildlink3.mk,v 1.81 2020/11/05 09:07:13 ryoon Exp $
+
+BUILDLINK_TREE+= webkit-gtk4
+
+.if !defined(WEBKIT_GTK_BUILDLINK3_MK)
+WEBKIT_GTK4_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.webkit-gtki4+= webkit-gtk>=2.8
+BUILDLINK_ABI_DEPENDS.webkit-gtk4?= webkit-gtk>=2.30.2nb1
+BUILDLINK_PKGSRCDIR.webkit-gtk?= ../../wip/webkit-gtk4
+
+# This is necessary to match the package requirement.
+GCC_REQD+= 7.3
+
+pkgbase := webkit-gtk
+.include "../../mk/pkg-build-options.mk"
+
+.if !empty(PKG_BUILD_OPTIONS.webkit-gtk4:Menchant)
+.include "../../textproc/enchant2/buildlink3.mk"
+.endif
+
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../devel/gperf/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/libwebp/buildlink3.mk"
+.include "../../multimedia/gstreamer1/buildlink3.mk"
+.include "../../multimedia/gst-plugins1-base/buildlink3.mk"
+.include "../../net/libsoup/buildlink3.mk"
+.include "../../security/libsecret/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../x11/gtk4/buildlink3.mk"
+.include "../../x11/libXdamage/buildlink3.mk"
+.include "../../x11/libXt/buildlink3.mk"
+.endif # WEBKIT_GTK4_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -webkit-gtk4
diff --git a/webkit-gtk4/distinfo b/webkit-gtk4/distinfo
new file mode 100644
index 0000000000..f668fd814b
--- /dev/null
+++ b/webkit-gtk4/distinfo
@@ -0,0 +1,69 @@
+$NetBSD: distinfo,v 1.141 2020/11/06 22:21:35 leot Exp $
+
+SHA1 (webkitgtk-2.30.2.tar.xz) = e27d336570226645f861b5a00116c17da39f9df4
+RMD160 (webkitgtk-2.30.2.tar.xz) = 9544d4796cfb33bae33c41719764a775b3b6bd29
+SHA512 (webkitgtk-2.30.2.tar.xz) = caecd765ce92942fc07d0d18b834b8f1acb13e6dc1e504ed9f104862285a6032a8824ab98a7439e6f8664d83dacb4ece2011f4ec822308e5b40d1f82ca601243
+Size (webkitgtk-2.30.2.tar.xz) = 22308908 bytes
+SHA1 (patch-CMakeLists.txt) = 26a7dfe913ef347fa4c2768256a6328eabc9cfd0
+SHA1 (patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh) = f4f117e6c1cd8eb8e4905f74946e0367156ed528
+SHA1 (patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh) = 308a7c8f687253b4fc75de0c66016dd18666e697
+SHA1 (patch-Source_JavaScriptCore_assembler_ARM64Assembler.h) = 79c282ca90d0ba2ef4769da40d4648f5f709951b
+SHA1 (patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h) = 70975aac175ec4131a4ed26a54dfe51e16ffb7cd
+SHA1 (patch-Source_JavaScriptCore_heap_MarkedSpace.cpp) = 709e5dcf4cdb834617c2ef542686bb2aa4aa37b3
+SHA1 (patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp) = 7f6c0c57d46478e83c4ff21dae2415f44085ba32
+SHA1 (patch-Source_JavaScriptCore_offlineasm_arm64.rb) = 8c05dafa317667bbf55504d05eeb8ae06fba4e93
+SHA1 (patch-Source_JavaScriptCore_runtime_MachineContext.h) = 23bc86a389f8009ec829c3ee0fe3effe3f20b012
+SHA1 (patch-Source_ThirdParty_ANGLE_adjust-angle-include-paths.sh) = b6506b0f273a81f2a16a19abc604c3402f57f259
+SHA1 (patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h) = 10debffda84bc752ed434657a337a466aad19a3a
+SHA1 (patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h) = a5454eb891ad1f9d8285c28af2e9efb4ff439e6b
+SHA1 (patch-Source_WTF_CMakeLists.txt) = 3d318bf2eae53354f40f759c3f98282c478c2de5
+SHA1 (patch-Source_WTF_wtf_FileSystem.cpp) = 2fe7b7755646d9a1cc022aec3d01091766378aba
+SHA1 (patch-Source_WTF_wtf_PlatformEnable.h) = eb5598c20c8453314daba7897066f15827bbede7
+SHA1 (patch-Source_WTF_wtf_PlatformGTK.cmake) = 727a760ee35baec56da4710965b25e5a92c836d4
+SHA1 (patch-Source_WTF_wtf_PlatformHave.h) = 4b027b3cbfa120595fb600370c25d4c78b6b56a6
+SHA1 (patch-Source_WTF_wtf_PlatformOS.h) = 80aa6ff20f10407d447fdb41606d4bb4989351aa
+SHA1 (patch-Source_WTF_wtf_PlatformUse.h) = 595486b48e7d89378208c0a209a121ef136415e6
+SHA1 (patch-Source_WTF_wtf_RAMSize.cpp) = c4fd7f67cbb414318577c93d642f26827ba638c0
+SHA1 (patch-Source_WTF_wtf_StackBounds.cpp) = 22a71daac8443f079ad8bcc7285cfd7319c972b3
+SHA1 (patch-Source_WTF_wtf_text_icu_UTextProvider.h) = 9ff5aa3ffcec45866106a99b2bc0bdd656b0ff9e
+SHA1 (patch-Source_WTF_wtf_text_icu_UTextProviderLatin1.cpp) = bb5bf01d8a4ab78d2fd16bbb84d4dc46f13313ee
+SHA1 (patch-Source_WTF_wtf_text_icu_UTextProviderUTF16.cpp) = 74b5c0b87da1b0acf8ca3324cfbad55cf73294d2
+SHA1 (patch-Source_WebCore_Scripts_check-xcfilelists.sh) = b292baf2494bcd459d9af91386263123046c6615
+SHA1 (patch-Source_WebCore_Scripts_generate-unified-sources.sh) = 9b323aa1fa8e6e5599ac0a7ae08fbbed4348c70e
+SHA1 (patch-Source_WebCore_crypto_algorithms_CryptoAlgorithmAES__GCM.cpp) = 03337c5eec54d6974dfea1766b14cb2c1b9f7750
+SHA1 (patch-Source_WebCore_inspector_InspectorFrontendHost.cpp) = daf6351a1a0b5a49592a2bb6db0d54620c7b09e3
+SHA1 (patch-Source_WebCore_platform_graphics_filters_FEMorphology.cpp) = 16b36d2d91fd7f43156b9ee09bcafd19602ebbd9
+SHA1 (patch-Source_WebCore_platform_gtk_PlatformScreenGtk.cpp) = fbca8d1529327be27d2b0bbd19856406a035d40a
+SHA1 (patch-Source_WebCore_platform_text_TextCodecICU.cpp) = a3ac5b8ed98c52a50581fffc52394a46255d22bc
+SHA1 (patch-Source_WebCore_rendering_RenderLayerBacking.h) = ecf722df1d1cca13573786b34fe1e3d85edf1e1e
+SHA1 (patch-Source_WebCore_rendering_shapes_RasterShape.cpp) = 551e47698dee50d097b11e3218f13bb3447edfea
+SHA1 (patch-Source_WebKit_CMakeLists.txt) = 228cc4734de3b08a3877ac839b1ffa2fbf2d3aa8
+SHA1 (patch-Source_WebKit_NetworkProcess_cache_NetworkCacheFileSystem.cpp) = 14dfbee895aa7c70bf3b61b4dbb5bccd96d9583a
+SHA1 (patch-Source_WebKit_PlatformGTK.cmake) = c174093c51755e3d4f189e397d3d96e09abf9388
+SHA1 (patch-Source_WebKit_Platform_IPC_ArgumentCoders.h) = d994b7e780b8fce57431d07a0a7f6b8e2d729871
+SHA1 (patch-Source_WebKit_Platform_IPC_unix_ConnectionUnix.cpp) = 35b62538d09af8725202673a2a23d814f624f8bd
+SHA1 (patch-Source_WebKit_Platform_SharedMemory.h) = 6ec52cc7d4842219d88b083b60d00e3d6a44bc91
+SHA1 (patch-Source_WebKit_Platform_classifier_ResourceLoadStatisticsClassifier.cpp) = 920376ec8697780637f376b2fff312b7e214a7f6
+SHA1 (patch-Source_WebKit_Scripts_check-xcfilelists.sh) = 22cc5ba1ababc6395aa0ef467db0c27c2fbf6878
+SHA1 (patch-Source_WebKit_Scripts_generate-unified-sources.sh) = def930cf3f706ac657b2f8835c8c0278ade8f663
+SHA1 (patch-Source_WebKit_Shared_SandboxExtension.h) = f1cd3ca964a1858c0d7704c5923992579069e88b
+SHA1 (patch-Source_WebKit_UIProcess_API_gtk_WebKitAuthenticationDialog.cpp) = 6892ec1e456340e9f8bf3a697ebb7f63feac3e14
+SHA1 (patch-Source_WebKit_UIProcess_API_gtk_WebKitScriptDialogImpl.cpp) = b65cece44e4684b75f3cc8fb2af4091df6aa8474
+SHA1 (patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewBase.cpp) = 1881ba295b29fd737990f6e30aa9f379a9b36fc6
+SHA1 (patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewDialog.cpp) = ea418efa824f7f6171c34af92d0244030834b5b8
+SHA1 (patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewGtk.cpp) = 941768b4a8a1bdb1562594965b2020e2b8f2b49b
+SHA1 (patch-Source_WebKit_UIProcess_CoordinatedGraphics_DrawingAreaProxyCoordinatedGraphics.cpp) = 42086291df0fc2d691feeea9668d8452aff4b79e
+SHA1 (patch-Source_WebKit_UIProcess_Inspector_gtk_WebKitInspectorWindow.cpp) = 93e4f7e9734ab632759dde66d2f934c377b6cf52
+SHA1 (patch-Source_WebKit_UIProcess_gtk_WebDataListSuggestionsDropdownGtk.cpp) = 9bead2f6841a78188a5777651a407786b366a7a8
+SHA1 (patch-Source_WebKit_UIProcess_gtk_WebPageProxyGtk.cpp) = daacb603be5e24fa5ad2cee73d51705f102bee8e
+SHA1 (patch-Source_WebKit_UIProcess_gtk_WebPopupMenuProxyGtk.cpp) = 7bff0d64e5a51025e254ba9083a14a0ea979d61e
+SHA1 (patch-Source_bmalloc_bmalloc_BPlatform.h) = 28d1f657fde427062a729b26398e96825082fc4d
+SHA1 (patch-Source_bmalloc_bmalloc_VMAllocate.h) = b1eb6ab93f2ce272cfee94a544d19806feb9a625
+SHA1 (patch-Source_cmake_FindGTK.cmake) = 0e3e033138840f2b4c60696d9dcda3b983f6e4d9
+SHA1 (patch-Source_cmake_OptionsCommon.cmake) = 03b72552414e7114bfa7ddc2d68fd97009a5ff7d
+SHA1 (patch-Source_cmake_WebKitFindPackage.cmake) = a9ab58e205cac80bc504cc10265323700ff23f54
+SHA1 (patch-Tools_MiniBrowser_gtk_BrowserSearchBox.c) = 10b30218167010ab0770b4d8cf7a1f9918c37ae1
+SHA1 (patch-Tools_MiniBrowser_gtk_BrowserWindow.c) = b3229ca594064cdddfea1aab3a59f496888a4cef
+SHA1 (patch-Tools_TestWebKitAPI_Scripts_check-xcfilelists.sh) = 6e8327bf46150806910b21b298767f313e1eb3ce
+SHA1 (patch-Tools_TestWebKitAPI_Scripts_generate-unified-sources.sh) = 06747f279263558f05bb01c8da9c994a357ce74a
+SHA1 (patch-aj) = ec60907df4336b755d1d1924c026b3041805f431
diff --git a/webkit-gtk4/hacks.mk b/webkit-gtk4/hacks.mk
new file mode 100644
index 0000000000..94abdb9a7d
--- /dev/null
+++ b/webkit-gtk4/hacks.mk
@@ -0,0 +1,25 @@
+# $NetBSD: hacks.mk,v 1.2 2020/09/11 09:21:32 he Exp $
+
+.if !defined(WEBKIT_GTK_HACKS_MK)
+WEBKIT_GTK_HACKS_MK= defined
+
+# [Sat Oct 3 16:44:53 CEST 2015 : leot]
+# On i386 archs -latomic is added during the build phase when linking
+# libwebkit2gtk-4.0.so for atomic operations.
+# Forcing -march=i586 (or better) avoids that (i[56]86 provide required
+# 64-bit compare-and-swap instruction).
+.if ${MACHINE_ARCH} == "i386"
+PKG_HACKS+= i386-atomicops
+CXXFLAGS+= -march=i586
+.endif
+
+# [Mon Sep 7 20:40:36 CEST 2020 : he]
+# On NetBSD/powerpc, we don't have native 8-byte atomics,
+# but webkit-gtk insists on using them, so here we need libatomic.
+# (This is a trial balloon -- let's see if autoconf will pick it up...)
+.if ${MACHINE_ARCH} == "powerpc"
+PKG_HACKS+= powerpc-libatomic
+.include "../../devel/libatomic/buildlink3.mk"
+.endif
+
+.endif # WEBKIT_GTK_HACKS_MK
diff --git a/webkit-gtk4/options.mk b/webkit-gtk4/options.mk
new file mode 100644
index 0000000000..57a353c72b
--- /dev/null
+++ b/webkit-gtk4/options.mk
@@ -0,0 +1,97 @@
+# $NetBSD: options.mk,v 1.21 2020/03/10 18:14:04 leot Exp $
+#
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.webkit-gtk4
+PKG_SUPPORTED_OPTIONS= debug enchant introspection opengl webkit-jit wayland
+PKG_SUGGESTED_OPTIONS= enchant introspection opengl
+.include "../../devel/wayland/platform.mk"
+.if ${PLATFORM_SUPPORTS_WAYLAND} == "yes"
+PKG_SUGGESTED_OPTIONS+= wayland
+.endif
+
+PLIST_VARS= introspection
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+#
+# Platforms that support the webkit-jit option
+#
+# Please see:
+# Source/cmake/WebKitFeatures.cmake
+# Source/WTF/wtf/PlatformEnable.h
+#
+WEBKIT_JIT_MACHINE_PLATFORMS+= Darwin-*-*
+WEBKIT_JIT_MACHINE_PLATFORMS+= DragonFly-*-*
+WEBKIT_JIT_MACHINE_PLATFORMS+= FreeBSD-*-x86_64 FreeBSD-*-aarch64
+WEBKIT_JIT_MACHINE_PLATFORMS+= Linux-*-x86_64 Linux-*-arm*
+WEBKIT_JIT_MACHINE_PLATFORMS+= Linux-*-aarch64 Linux-*-mips*
+WEBKIT_JIT_MACHINE_PLATFORMS+= NetBSD-*-x86_64 NetBSD-*-aarch64
+
+.if !empty(WEBKIT_JIT_MACHINE_PLATFORMS:@.PLAT.@${MACHINE_PLATFORM:M${.PLAT.}}@)
+PKG_SUGGESTED_OPTIONS+= webkit-jit
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+#
+# JIT support
+#
+.if !empty(PKG_OPTIONS:Mwebkit-jit)
+CMAKE_ARGS+= -DENABLE_JIT=ON
+CMAKE_ARGS+= -DENABLE_C_LOOP=OFF
+.else
+CMAKE_ARGS+= -DENABLE_JIT=OFF
+.endif
+
+#
+# OpenGL support: enable support for GLX, WebGL and accelerated compositing
+#
+.if !empty(PKG_OPTIONS:Mopengl)
+CMAKE_ARGS+= -DENABLE_OPENGL=ON
+.else
+CMAKE_ARGS+= -DENABLE_OPENGL=OFF
+CMAKE_ARGS+= -DENABLE_GRAPHICS_CONTEXT_GL=OFF
+.endif
+
+#
+# Spellcheck support using enchant
+#
+.if !empty(PKG_OPTIONS:Menchant)
+CMAKE_ARGS+= -DENABLE_SPELLCHECK=ON
+.include "../../textproc/enchant2/buildlink3.mk"
+.else
+CMAKE_ARGS+= -DENABLE_SPELLCHECK=OFF
+.endif
+
+#
+# Debug build
+#
+.if !empty(PKG_OPTIONS:Mdebug)
+CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Debug
+.else
+CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
+.endif
+
+#
+# Introspection
+#
+.if !empty(PKG_OPTIONS:Mintrospection)
+PLIST.introspection= yes
+BUILDLINK_API_DEPENDS.gobject-introspection+= gobject-introspection>=0.9.5
+BUILDLINK_DEPMETHOD.gobject-introspection+= build
+.include "../../devel/gobject-introspection/buildlink3.mk"
+CMAKE_ARGS+= -DENABLE_INTROSPECTION=ON
+.else
+CMAKE_ARGS+= -DENABLE_INTROSPECTION=OFF
+.endif
+
+#
+# Wayland display server support
+#
+.if !empty(PKG_OPTIONS:Mwayland)
+CMAKE_ARGS+= -DENABLE_WAYLAND_TARGET=ON
+CMAKE_ARGS+= -DUSE_WPE_RENDERER=OFF # TODO
+.include "../../devel/wayland/buildlink3.mk"
+.else
+CMAKE_ARGS+= -DENABLE_WAYLAND_TARGET=OFF
+.endif
diff --git a/webkit-gtk4/patches/patch-CMakeLists.txt b/webkit-gtk4/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..6bbe2d0777
--- /dev/null
+++ b/webkit-gtk4/patches/patch-CMakeLists.txt
@@ -0,0 +1,37 @@
+$NetBSD: patch-CMakeLists.txt,v 1.12 2020/09/11 14:47:35 leot Exp $
+
+- Fix support for arm
+- Fix support for ppc, from FreeBSD.
+
+--- CMakeLists.txt.orig 2020-08-12 09:17:37.000000000 +0000
++++ CMakeLists.txt
+@@ -19,7 +19,7 @@ else ()
+ message(STATUS "The CMake build type is: ${CMAKE_BUILD_TYPE}")
+ endif ()
+
+-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
++set (CMAKE_MODULE_PATH "/opt/pkg/src/wip/webkit-gtk4/work/.buildlink/cmake-Modules" "/opt/pkg/src/wip/webkit-gtk4/work/.buildlink/cmake-Modules" "${CMAKE_SOURCE_DIR}/Source/cmake")
+
+ set(ENABLE_WEBCORE ON)
+
+@@ -91,7 +91,7 @@ else ()
+ endif ()
+ if (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(^aarch64|^arm64)")
+ set(WTF_CPU_ARM64 1)
+-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
++elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(^arm|^earm)")
+ set(WTF_CPU_ARM 1)
+ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64")
+ set(WTF_CPU_MIPS64 1)
+@@ -109,9 +109,9 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR
+ endif ()
+ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
+ set(WTF_CPU_X86 1)
+-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc")
++elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(ppc|powerpc)")
+ set(WTF_CPU_PPC 1)
+-elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
++elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(ppc64|powerpc64)")
+ set(WTF_CPU_PPC64 1)
+ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
+ set(WTF_CPU_PPC64LE 1)
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh b/webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh
new file mode 100644
index 0000000000..b8e938b9ac
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh
@@ -0,0 +1,18 @@
+$NetBSD: patch-Source_JavaScriptCore_Scripts_check-xcfilelists.sh,v 1.2 2019/09/10 22:10:04 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Source/JavaScriptCore/Scripts/check-xcfilelists.sh.orig 2019-08-28 11:46:27.000000000 +0000
++++ Source/JavaScriptCore/Scripts/check-xcfilelists.sh
+@@ -1,8 +1,8 @@
+ #!/bin/sh
+
+-[ "${WK_DISABLE_CHECK_XCFILELISTS}" == "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
+-[ "${DEPLOYMENT_LOCATION}" == "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
+-[ "${USE_INTERNAL_SDK}" == "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
++[ "${WK_DISABLE_CHECK_XCFILELISTS}" = "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
++[ "${DEPLOYMENT_LOCATION}" = "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
++[ "${USE_INTERNAL_SDK}" = "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
+
+ SCRIPT="${BUILD_SCRIPTS_DIR}/generate-xcfilelists"
+ [ -f "${SCRIPT}" ] || SCRIPT="${PROJECT_DIR}/../../../${WK_ADDITIONAL_SCRIPTS_DIR}/generate-xcfilelists"
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh b/webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh
new file mode 100644
index 0000000000..6bf6296dc4
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_JavaScriptCore_Scripts_generate-unified-sources.sh,v 1.1 2019/03/13 20:49:40 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Source/JavaScriptCore/Scripts/generate-unified-sources.sh.orig 2019-02-12 11:21:03.000000000 +0000
++++ Source/JavaScriptCore/Scripts/generate-unified-sources.sh
+@@ -7,7 +7,7 @@ ARGS=("$@")
+ cd $SRCROOT
+
+ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
+- if [ "${DEPLOYMENT_LOCATION}" == "YES" ]; then
++ if [ "${DEPLOYMENT_LOCATION}" = "YES" ]; then
+ BUILD_SCRIPTS_DIR="${SDKROOT}${WK_ALTERNATE_WEBKIT_SDK_PATH}/usr/local/include/wtf/Scripts"
+ else
+ BUILD_SCRIPTS_DIR="${BUILT_PRODUCTS_DIR}/usr/local/include/wtf/Scripts"
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARM64Assembler.h b/webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARM64Assembler.h
new file mode 100644
index 0000000000..38e8011156
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARM64Assembler.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-Source_JavaScriptCore_assembler_ARM64Assembler.h,v 1.5 2020/03/10 18:14:04 leot Exp $
+
+- Add support for FreeBSD and NetBSD.
+ Based on patch from FreeBSD ports but using __builtin___clear_cache()
+ instead of __clear_cache() (the former is also available in gcc).
+
+--- Source/JavaScriptCore/assembler/ARM64Assembler.h.orig 2020-02-04 10:23:58.000000000 +0000
++++ Source/JavaScriptCore/assembler/ARM64Assembler.h
+@@ -2809,6 +2809,8 @@ public:
+ {
+ #if OS(DARWIN)
+ sys_cache_control(kCacheFunctionPrepareForExecution, code, size);
++#elif OS(FREEBSD) || OS(NETBSD)
++ __builtin___clear_cache(code, reinterpret_cast<char*>(code) + size);
+ #elif OS(FUCHSIA)
+ zx_cache_flush(code, size, ZX_CACHE_FLUSH_INSN);
+ #elif OS(LINUX)
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h b/webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h
new file mode 100644
index 0000000000..2f20d189cf
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h
@@ -0,0 +1,30 @@
+$NetBSD: patch-Source_JavaScriptCore_assembler_ARMv7Assembler.h,v 1.2 2019/09/10 22:10:04 leot Exp $
+
+Add support for NetBSD.
+
+--- Source/JavaScriptCore/assembler/ARMv7Assembler.h.orig 2019-08-28 11:46:27.000000000 +0000
++++ Source/JavaScriptCore/assembler/ARMv7Assembler.h
+@@ -28,6 +28,11 @@
+
+ #if ENABLE(ASSEMBLER) && CPU(ARM_THUMB2)
+
++#if OS(NETBSD)
++#include <sys/types.h>
++#include <machine/sysarch.h>
++#endif
++
+ #include "AssemblerBuffer.h"
+ #include "AssemblerCommon.h"
+ #include "RegisterInfo.h"
+@@ -2394,6 +2399,11 @@ public:
+ linuxPageFlush(current, current + page);
+
+ linuxPageFlush(current, end);
++#elif OS(NETBSD)
++ struct arm_sync_icache_args arg;
++ arg.addr = reinterpret_cast<uintptr_t>(code);
++ arg.len = size;
++ sysarch(ARM_SYNC_ICACHE, (void *)&arg);
+ #else
+ #error "The cacheFlush support is missing on this platform."
+ #endif
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_heap_MarkedSpace.cpp b/webkit-gtk4/patches/patch-Source_JavaScriptCore_heap_MarkedSpace.cpp
new file mode 100644
index 0000000000..5c079974be
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_heap_MarkedSpace.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_JavaScriptCore_heap_MarkedSpace.cpp,v 1.3 2020/09/11 14:47:35 leot Exp $
+
+Avoid ambiguous function call.
+
+--- Source/JavaScriptCore/heap/MarkedSpace.cpp.orig 2020-08-12 09:17:52.000000000 +0000
++++ Source/JavaScriptCore/heap/MarkedSpace.cpp
+@@ -28,6 +28,8 @@
+ #include "MarkedSpaceInlines.h"
+ #include <wtf/ListDump.h>
+
++using std::pow;
++
+ namespace JSC {
+
+ std::array<unsigned, MarkedSpace::numSizeClasses> MarkedSpace::s_sizeClassForSizeStep;
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp b/webkit-gtk4/patches/patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp
new file mode 100644
index 0000000000..0825520e9e
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp
@@ -0,0 +1,19 @@
+$NetBSD: patch-Source_JavaScriptCore_jit_ExecutableAllocator.cpp,v 1.5 2020/09/11 14:47:35 leot Exp $
+
+Avoid to (pre)allocate 1GB of memory on OpenBSD:
+
+ <https://bugs.webkit.org/show_bug.cgi?id=61137>
+
+From OpenBSD ports.
+
+--- Source/JavaScriptCore/jit/ExecutableAllocator.cpp.orig 2020-08-12 09:17:53.000000000 +0000
++++ Source/JavaScriptCore/jit/ExecutableAllocator.cpp
+@@ -93,7 +93,7 @@ static constexpr size_t maxIslandsPerReg
+ #else
+ static constexpr size_t fixedExecutableMemoryPoolSize = 128 * MB;
+ #endif
+-#elif CPU(X86_64)
++#elif CPU(X86_64) && !OS(OPENBSD)
+ static constexpr size_t fixedExecutableMemoryPoolSize = 1 * GB;
+ #else
+ static constexpr size_t fixedExecutableMemoryPoolSize = 32 * MB;
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_offlineasm_arm64.rb b/webkit-gtk4/patches/patch-Source_JavaScriptCore_offlineasm_arm64.rb
new file mode 100644
index 0000000000..6521177f99
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_offlineasm_arm64.rb
@@ -0,0 +1,19 @@
+$NetBSD: patch-Source_JavaScriptCore_offlineasm_arm64.rb,v 1.2 2019/03/13 20:49:40 leot Exp $
+
+Add support for FreeBSD and NetBSD.
+
+From FreeBSD ports.
+
+--- Source/JavaScriptCore/offlineasm/arm64.rb.orig 2019-02-12 11:21:03.000000000 +0000
++++ Source/JavaScriptCore/offlineasm/arm64.rb
+@@ -1033,8 +1033,8 @@ class Instruction
+ $asm.puts "L_offlineasm_loh_ldr_#{uid}:"
+ $asm.puts "ldr #{operands[1].arm64Operand(:quad)}, [#{operands[1].arm64Operand(:quad)}, #{operands[0].asmLabel}@GOTPAGEOFF]"
+
+- # On Linux, use ELF GOT relocation specifiers.
+- $asm.putStr("#elif OS(LINUX)")
++ # On Linux, FreeBSD and NetBSD, use ELF GOT relocation specifiers.
++ $asm.putStr("#elif OS(LINUX) || OS(FREEBSD) || OS(NETBSD)")
+ $asm.puts "adrp #{operands[1].arm64Operand(:quad)}, :got:#{operands[0].asmLabel}"
+ $asm.puts "ldr #{operands[1].arm64Operand(:quad)}, [#{operands[1].arm64Operand(:quad)}, :got_lo12:#{operands[0].asmLabel}]"
+
diff --git a/webkit-gtk4/patches/patch-Source_JavaScriptCore_runtime_MachineContext.h b/webkit-gtk4/patches/patch-Source_JavaScriptCore_runtime_MachineContext.h
new file mode 100644
index 0000000000..6ed0f90019
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_JavaScriptCore_runtime_MachineContext.h
@@ -0,0 +1,121 @@
+$NetBSD: patch-Source_JavaScriptCore_runtime_MachineContext.h,v 1.1 2018/10/24 18:31:07 leot Exp $
+
+Add support for NetBSD.
+
+--- Source/JavaScriptCore/runtime/MachineContext.h.orig 2018-08-21 16:06:10.000000000 +0000
++++ Source/JavaScriptCore/runtime/MachineContext.h
+@@ -188,6 +188,22 @@ static inline void*& stackPointerImpl(mc
+ #error Unknown Architecture
+ #endif
+
++#elif OS(NETBSD)
++
++#if CPU(X86)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_UESP]);
++#elif CPU(X86_64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_RSP]);
++#elif CPU(ARM)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_SP]);
++#elif CPU(ARM64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_SP]);
++#elif CPU(MIPS)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_SP]);
++#else
++#error Unknown Architecture
++#endif
++
+ #elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+
+ #if CPU(X86)
+@@ -335,6 +351,22 @@ static inline void*& framePointerImpl(mc
+ #error Unknown Architecture
+ #endif
+
++#elif OS(NETBSD)
++
++#if CPU(X86)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_EBP]);
++#elif CPU(X86_64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_RBP]);
++#elif CPU(ARM)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_FP]);
++#elif CPU(ARM64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_FP]);
++#elif CPU(MIPS)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_S8]);
++#else
++#error Unknown Architecture
++#endif
++
+ #elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+@@ -482,6 +514,22 @@ static inline void*& instructionPointerI
+ #error Unknown Architecture
+ #endif
+
++#elif OS(NETBSD)
++
++#if CPU(X86)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_EIP]);
++#elif CPU(X86_64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_RIP]);
++#elif CPU(ARM)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_PC]);
++#elif CPU(ARM64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_PC]);
++#elif CPU(MIPS)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_EPC]);
++#else
++#error Unknown Architecture
++#endif
++
+ #elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+@@ -639,6 +687,22 @@ inline void*& argumentPointer<1>(mcontex
+ #error Unknown Architecture
+ #endif
+
++#elif OS(NETBSD)
++
++#if CPU(X86)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_EDX]);
++#elif CPU(X86_64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_RSI]);
++#elif CPU(ARM)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_R1]);
++#elif CPU(ARM64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_X1]);
++#elif CPU(MIPS)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_A1]);
++#else
++#error Unknown Architecture
++#endif
++
+ #elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+@@ -756,6 +820,22 @@ inline void*& llintInstructionPointer(mc
+ #error Unknown Architecture
+ #endif
+
++#elif OS(NETBSD)
++
++#if CPU(X86)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_ESI]);
++#elif CPU(X86_64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_R8]);
++#elif CPU(ARM)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_R8]);
++#elif CPU(ARM64)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_X4]);
++#elif CPU(MIPS)
++ return reinterpret_cast<void*&>((uintptr_t&) machineContext.__gregs[_REG_T4]);
++#else
++#error Unknown Architecture
++#endif
++
+ #elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
diff --git a/webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_adjust-angle-include-paths.sh b/webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_adjust-angle-include-paths.sh
new file mode 100644
index 0000000000..183c556c2a
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_adjust-angle-include-paths.sh
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_ThirdParty_ANGLE_adjust-angle-include-paths.sh,v 1.3 2020/09/11 14:47:35 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Source/ThirdParty/ANGLE/adjust-angle-include-paths.sh.orig 2020-08-12 09:17:53.000000000 +0000
++++ Source/ThirdParty/ANGLE/adjust-angle-include-paths.sh
+@@ -19,7 +19,7 @@
+ # that they refer to each other. This avoids modifying the ANGLE
+ # sources, and allows WebCore to more easily call ANGLE APIs directly.
+
+-if [ "$DEPLOYMENT_LOCATION" == "YES" ] ; then
++if [ "$DEPLOYMENT_LOCATION" = "YES" ] ; then
+ # Apple-internal build.
+ output_dir=${DSTROOT}${PUBLIC_HEADERS_FOLDER_PATH}
+ else
diff --git a/webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h b/webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h
new file mode 100644
index 0000000000..73e24a103e
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-Source_ThirdParty_ANGLE_src_compiler_translator_SymbolTable.h,v 1.2 2020/03/10 18:14:04 leot Exp $
+
+Include <cmath> for is isinf/isnan used in SymbolTable_autogen.cpp.
+
+--- Source/ThirdParty/ANGLE/src/compiler/translator/SymbolTable.h.orig 2020-02-04 10:24:05.000000000 +0000
++++ Source/ThirdParty/ANGLE/src/compiler/translator/SymbolTable.h
+@@ -30,6 +30,7 @@
+ // are tracked in the intermediate representation, not the symbol table.
+ //
+
++#include <cmath>
+ #include <limits>
+ #include <memory>
+ #include <set>
diff --git a/webkit-gtk4/patches/patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h b/webkit-gtk4/patches/patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h
new file mode 100644
index 0000000000..382329760a
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h
@@ -0,0 +1,36 @@
+$NetBSD: patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h,v 1.4 2019/03/13 20:49:40 leot Exp $
+
+--- Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h.orig 2019-02-12 11:21:03.000000000 +0000
++++ Source/ThirdParty/gtest/include/gtest/internal/gtest-port.h
+@@ -42,6 +42,7 @@
+
+ #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
+ #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
++#include <ciso646>
+
+ // Environment-describing macros
+ // -----------------------------
+@@ -268,6 +269,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <unistd.h>
+ #ifndef _WIN32_WCE
+ # include <sys/types.h>
+ # include <sys/stat.h>
+@@ -755,7 +757,14 @@ typedef struct _RTL_CRITICAL_SECTION GTE
+ // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
+ // not conform to the TR1 spec, which requires the header to be <tuple>.
+
+-# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
++#if defined(_LIBCPP_VERSION)
++#include <tuple>
++namespace std {
++ namespace tr1 {
++ using ::std::tuple;
++ }
++}
++#elif !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
+ // Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
+ // which is #included by <tr1/tuple>, to not compile when RTTI is
+ // disabled. _TR1_FUNCTIONAL is the header guard for
diff --git a/webkit-gtk4/patches/patch-Source_WTF_CMakeLists.txt b/webkit-gtk4/patches/patch-Source_WTF_CMakeLists.txt
new file mode 100644
index 0000000000..d77bf60247
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_CMakeLists.txt
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- Source/WTF/CMakeLists.txt.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/CMakeLists.txt
+@@ -3,9 +3,3 @@ include(WebKitCommon)
+ set_property(DIRECTORY . PROPERTY FOLDER "WTF")
+
+ add_subdirectory(wtf)
+-
+-# Apple builds have the ICU headers checked into ${WTF_DIR}/icu
+-# Copy them into ${ICU_INCLUDE_DIRS} so the build behaves like find_package was used
+-if (APPLE)
+- file(COPY ${WTF_DIR}/icu/unicode DESTINATION ${ICU_INCLUDE_DIRS})
+-endif ()
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_FileSystem.cpp b/webkit-gtk4/patches/patch-Source_WTF_wtf_FileSystem.cpp
new file mode 100644
index 0000000000..c1772527a1
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_FileSystem.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-Source_WTF_wtf_FileSystem.cpp,v 1.3 2020/09/11 14:47:35 leot Exp $
+
+Support MAP_FILE if unavailable.
+
+--- Source/WTF/wtf/FileSystem.cpp.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/wtf/FileSystem.cpp
+@@ -339,6 +339,9 @@ bool MappedFileData::mapFileHandle(Platf
+ #endif
+ }
+
++#ifndef MAP_FILE
++#define MAP_FILE 0
++#endif
+ void* data = mmap(0, size, pageProtection, MAP_FILE | (mapMode == MappedFileMode::Shared ? MAP_SHARED : MAP_PRIVATE), fd, 0);
+
+ if (data == MAP_FAILED) {
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformEnable.h b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformEnable.h
new file mode 100644
index 0000000000..95d347c82e
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformEnable.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-Source_WTF_wtf_PlatformEnable.h,v 1.1 2020/03/10 18:14:04 leot Exp $
+
+Enable the JIT on NetBSD.
+
+--- Source/WTF/wtf/PlatformEnable.h.orig 2020-02-04 10:24:07.000000000 +0000
++++ Source/WTF/wtf/PlatformEnable.h
+@@ -625,12 +625,12 @@
+ #if !defined(ENABLE_DFG_JIT) && ENABLE(JIT)
+
+ /* Enable the DFG JIT on X86 and X86_64. */
+-#if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD) || OS(WINDOWS))
++#if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(NETBSD) || OS(HURD) || OS(WINDOWS))
+ #define ENABLE_DFG_JIT 1
+ #endif
+
+-/* Enable the DFG JIT on ARMv7. Only tested on iOS, Linux, and FreeBSD. */
+-#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD))
++/* Enable the DFG JIT on ARMv7. Only tested on iOS, Linux, and FreeBSD and NetBSD. */
++#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(NETBSD))
+ #define ENABLE_DFG_JIT 1
+ #endif
+
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformGTK.cmake b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformGTK.cmake
new file mode 100644
index 0000000000..b953a70cd6
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformGTK.cmake
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- Source/WTF/wtf/PlatformGTK.cmake.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/wtf/PlatformGTK.cmake
+@@ -18,6 +18,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+ linux/ProcessMemoryFootprint.h
+ linux/CurrentProcessMemoryStatus.h
+ )
++elseif (APPLE)
++ list(APPEND WTF_PUBLIC_HEADERS
++ spi/darwin/ProcessMemoryFootprint.h
++ )
+ endif ()
+
+ list(APPEND WTF_SOURCES
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformHave.h b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformHave.h
new file mode 100644
index 0000000000..cbc748165a
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformHave.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-Source_WTF_wtf_PlatformHave.h,v 1.1 2020/03/10 18:14:04 leot Exp $
+
+Add support for NetBSD.
+
+--- Source/WTF/wtf/PlatformHave.h.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/wtf/PlatformHave.h
+@@ -191,7 +191,7 @@
+ #endif
+
+ #if OS(DARWIN)
+-#define HAVE_AUDIT_TOKEN 1
++//#define HAVE_AUDIT_TOKEN 1
+ #endif
+
+ #if OS(DARWIN) && __has_include(<mach/mach_exc.defs>) && !PLATFORM(GTK)
+@@ -202,7 +202,7 @@
+ #define HAVE_HOSTED_CORE_ANIMATION 1
+ #endif
+
+-#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
++#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || OS(NETBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
+ #define HAVE_MACHINE_CONTEXT 1
+ #endif
+
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformOS.h b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformOS.h
new file mode 100644
index 0000000000..596754fbb7
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformOS.h
@@ -0,0 +1,26 @@
+$NetBSD: patch-Source_WTF_wtf_PlatformOS.h,v 1.1 2020/03/10 18:14:04 leot Exp $
+
+Add OS(SOLARIS) definition and add them to Unix systems.
+
+--- Source/WTF/wtf/PlatformOS.h.orig 2020-02-04 10:24:07.000000000 +0000
++++ Source/WTF/wtf/PlatformOS.h
+@@ -114,6 +114,11 @@
+ #define WTF_OS_OPENBSD 1
+ #endif
+
++/* OS(SOLARIS) - Solaris and derivatives */
++#ifdef __sun
++#define WTF_OS_SOLARIS 1
++#endif
++
+ /* OS(WINDOWS) - Any version of Windows */
+ #if defined(WIN32) || defined(_WIN32)
+ #define WTF_OS_WINDOWS 1
+@@ -129,6 +134,7 @@
+ || OS(LINUX) \
+ || OS(NETBSD) \
+ || OS(OPENBSD) \
++ || OS(SOLARIS) \
+ || defined(unix) \
+ || defined(__unix) \
+ || defined(__unix__)
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformUse.h b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformUse.h
new file mode 100644
index 0000000000..d2e4aa35eb
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_PlatformUse.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_WTF_wtf_PlatformUse.h,v 1.1 2020/03/10 18:14:04 leot Exp $
+
+Avoid flock() on SunOS, not supported on older platforms.
+
+--- Source/WTF/wtf/PlatformUse.h.orig 2020-02-04 10:24:07.000000000 +0000
++++ Source/WTF/wtf/PlatformUse.h
+@@ -87,7 +87,7 @@
+ #define USE_CF 1
+ #endif
+
+-#if PLATFORM(COCOA) || (PLATFORM(GTK) || PLATFORM(WPE))
++#if (PLATFORM(COCOA) || (PLATFORM(GTK) || PLATFORM(WPE))) && !OS(SOLARIS)
+ #define USE_FILE_LOCK 1
+ #endif
+
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_RAMSize.cpp b/webkit-gtk4/patches/patch-Source_WTF_wtf_RAMSize.cpp
new file mode 100644
index 0000000000..3c75e325ed
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_RAMSize.cpp
@@ -0,0 +1,49 @@
+$NetBSD: patch-Source_WTF_wtf_RAMSize.cpp,v 1.5 2020/09/11 14:47:35 leot Exp $
+
+Add support for NetBSD and SunOS.
+
+--- Source/WTF/wtf/RAMSize.cpp.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/wtf/RAMSize.cpp
+@@ -34,13 +34,19 @@
+ #if OS(LINUX)
+ #include <sys/sysinfo.h>
+ #endif // OS(LINUX)
++#if OS(SOLARIS)
++#include <unistd.h>
++#endif
++#if OS(NETBSD)
++#include <sys/sysctl.h>
++#endif // OS(NETBSD)
+ #else
+ #include <bmalloc/bmalloc.h>
+ #endif
+
+ namespace WTF {
+
+-#if OS(WINDOWS)
++#if OS(WINDOWS) || (OS(NETBSD) && defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC)
+ static constexpr size_t ramSizeGuess = 512 * MB;
+ #endif
+
+@@ -58,9 +64,20 @@ static size_t computeRAMSize()
+ struct sysinfo si;
+ sysinfo(&si);
+ return si.totalram * si.mem_unit;
++#elif OS(SOLARIS)
++ return (sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE));
++#elif OS(NETBSD)
++ int mib[2];
++ size_t len, totalram;
++ mib[0] = CTL_HW;
++ mib[1] = HW_USERMEM64;
++ len = sizeof(totalram);
++ if (sysctl(mib, 2, &totalram, &len, NULL, 0))
++ return ramSizeGuess;
++ return totalram;
+ #else
+ #error "Missing a platform specific way of determining the available RAM"
+-#endif // OS(LINUX) || OS(FREEBSD)
++#endif // USE_SYSTEM_MALLOC
+ #else
+ return bmalloc::api::availableMemory();
+ #endif
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_StackBounds.cpp b/webkit-gtk4/patches/patch-Source_WTF_wtf_StackBounds.cpp
new file mode 100644
index 0000000000..043ef1520c
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_StackBounds.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-Source_WTF_wtf_StackBounds.cpp,v 1.2 2018/10/24 18:31:07 leot Exp $
+
+SunOS does not have pthread_getattr_np.
+
+--- Source/WTF/wtf/StackBounds.cpp.orig 2018-02-19 07:45:30.000000000 +0000
++++ Source/WTF/wtf/StackBounds.cpp
+@@ -131,6 +131,7 @@ StackBounds StackBounds::newThreadStackB
+ #if HAVE(PTHREAD_NP_H) || OS(NETBSD)
+ // e.g. on FreeBSD 5.4, neundorf%kde.org@localhost
+ pthread_attr_get_np(thread, &sattr);
++#elif OS(SOLARIS)
+ #else
+ // FIXME: this function is non-portable; other POSIX systems may have different np alternatives
+ pthread_getattr_np(thread, &sattr);
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProvider.h b/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProvider.h
new file mode 100644
index 0000000000..e72db39683
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProvider.h
@@ -0,0 +1,39 @@
+$NetBSD: patch-Source_WTF_wtf_text_icu_UTextProvider.h,v 1.1 2020/11/06 22:21:35 leot Exp $
+
+Backport upstream changeset 269325.
+
+[WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and TRUE
+macros by default https://bugs.webkit.org/show_bug.cgi?id=218522
+
+--- Source/WTF/wtf/text/icu/UTextProvider.h.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/wtf/text/icu/UTextProvider.h
+@@ -79,12 +79,12 @@ inline bool uTextAccessInChunkOrOutOfRan
+ // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+ ASSERT(offset < std::numeric_limits<int32_t>::max());
+ text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+- isAccessible = TRUE;
++ isAccessible = true;
+ return true;
+ }
+ if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+ text->chunkOffset = text->chunkLength;
+- isAccessible = FALSE;
++ isAccessible = false;
+ return true;
+ }
+ } else {
+@@ -93,12 +93,12 @@ inline bool uTextAccessInChunkOrOutOfRan
+ // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+ ASSERT(offset < std::numeric_limits<int32_t>::max());
+ text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+- isAccessible = TRUE;
++ isAccessible = true;
+ return true;
+ }
+ if (nativeIndex <= 0 && !text->chunkNativeStart) {
+ text->chunkOffset = 0;
+- isAccessible = FALSE;
++ isAccessible = false;
+ return true;
+ }
+ }
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderLatin1.cpp b/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderLatin1.cpp
new file mode 100644
index 0000000000..6ff570eea0
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderLatin1.cpp
@@ -0,0 +1,64 @@
+$NetBSD: patch-Source_WTF_wtf_text_icu_UTextProviderLatin1.cpp,v 1.1 2020/11/06 22:21:35 leot Exp $
+
+Backport upstream changeset 269325.
+
+[WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and TRUE
+macros by default https://bugs.webkit.org/show_bug.cgi?id=218522
+
+--- Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp
+@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uT
+ if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+ // Already inside the buffer. Set the new offset.
+ uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+- return TRUE;
++ return true;
+ }
+ if (index >= length && uText->chunkNativeLimit == length) {
+ // Off the end of the buffer, but we can't get it.
+ uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+- return FALSE;
++ return false;
+ }
+ } else {
+ if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+ // Already inside the buffer. Set the new offset.
+ uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+- return TRUE;
++ return true;
+ }
+ if (!index && !uText->chunkNativeStart) {
+ // Already at the beginning; can't go any farther.
+ uText->chunkOffset = 0;
+- return FALSE;
++ return false;
+ }
+ }
+
+@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uT
+
+ uText->nativeIndexingLimit = uText->chunkLength;
+
+- return TRUE;
++ return true;
+ }
+
+ static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+@@ -337,7 +337,7 @@ static int64_t uTextLatin1ContextAwareNa
+ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+ if (!text->context)
+- return FALSE;
++ return false;
+ int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+ UBool isAccessible;
+ if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -357,7 +357,7 @@ static UBool uTextLatin1ContextAwareAcce
+ ASSERT(newContext == UTextProviderContext::PriorContext);
+ textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+ }
+- return TRUE;
++ return true;
+ }
+
+ static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderUTF16.cpp b/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderUTF16.cpp
new file mode 100644
index 0000000000..9bc5df68c2
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WTF_wtf_text_icu_UTextProviderUTF16.cpp
@@ -0,0 +1,27 @@
+$NetBSD: patch-Source_WTF_wtf_text_icu_UTextProviderUTF16.cpp,v 1.1 2020/11/06 22:21:35 leot Exp $
+
+Backport upstream changeset 269325.
+
+[WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and TRUE
+macros by default https://bugs.webkit.org/show_bug.cgi?id=218522
+
+--- Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp.orig 2020-08-12 09:17:54.000000000 +0000
++++ Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp
+@@ -126,7 +126,7 @@ static inline int64_t uTextUTF16ContextA
+ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+ if (!text->context)
+- return FALSE;
++ return false;
+ int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+ UBool isAccessible;
+ if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -146,7 +146,7 @@ static UBool uTextUTF16ContextAwareAcces
+ ASSERT(newContext == UTextProviderContext::PriorContext);
+ textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+ }
+- return TRUE;
++ return true;
+ }
+
+ static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_Scripts_check-xcfilelists.sh b/webkit-gtk4/patches/patch-Source_WebCore_Scripts_check-xcfilelists.sh
new file mode 100644
index 0000000000..1f242aa123
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_Scripts_check-xcfilelists.sh
@@ -0,0 +1,18 @@
+$NetBSD: patch-Source_WebCore_Scripts_check-xcfilelists.sh,v 1.2 2019/09/10 22:10:04 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Source/WebCore/Scripts/check-xcfilelists.sh.orig 2019-08-28 11:46:30.000000000 +0000
++++ Source/WebCore/Scripts/check-xcfilelists.sh
+@@ -1,8 +1,8 @@
+ #!/bin/sh
+
+-[ "${WK_DISABLE_CHECK_XCFILELISTS}" == "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
+-[ "${DEPLOYMENT_LOCATION}" == "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
+-[ "${USE_INTERNAL_SDK}" == "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
++[ "${WK_DISABLE_CHECK_XCFILELISTS}" = "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
++[ "${DEPLOYMENT_LOCATION}" = "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
++[ "${USE_INTERNAL_SDK}" = "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
+
+ SCRIPT="${BUILD_SCRIPTS_DIR}/generate-xcfilelists"
+ [ -f "${SCRIPT}" ] || SCRIPT="${PROJECT_DIR}/../../../${WK_ADDITIONAL_SCRIPTS_DIR}/generate-xcfilelists"
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_Scripts_generate-unified-sources.sh b/webkit-gtk4/patches/patch-Source_WebCore_Scripts_generate-unified-sources.sh
new file mode 100644
index 0000000000..a13ff830e4
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_Scripts_generate-unified-sources.sh
@@ -0,0 +1,24 @@
+$NetBSD: patch-Source_WebCore_Scripts_generate-unified-sources.sh,v 1.2 2020/09/11 14:47:35 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Source/WebCore/Scripts/generate-unified-sources.sh.orig 2020-08-12 09:17:55.000000000 +0000
++++ Source/WebCore/Scripts/generate-unified-sources.sh
+@@ -7,7 +7,7 @@ ARGS=("$@")
+ cd $SRCROOT
+
+ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
+- if [ "${DEPLOYMENT_LOCATION}" == "YES" ]; then
++ if [ "${DEPLOYMENT_LOCATION}" = "YES" ]; then
+ BUILD_SCRIPTS_DIR="${SDKROOT}${WK_ALTERNATE_WEBKIT_SDK_PATH}/usr/local/include/wtf/Scripts"
+ else
+ BUILD_SCRIPTS_DIR="${BUILT_PRODUCTS_DIR}/usr/local/include/wtf/Scripts"
+@@ -22,7 +22,7 @@ if [ $# -eq 0 ]; then
+ fi
+
+ SOURCES="Sources.txt SourcesCocoa.txt"
+-if [ "${USE_INTERNAL_SDK}" == "YES" ]; then
++if [ "${USE_INTERNAL_SDK}" = "YES" ]; then
+ SOURCES="${SOURCES} SourcesCocoaInternalSDK.txt"
+ fi
+
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_crypto_algorithms_CryptoAlgorithmAES__GCM.cpp b/webkit-gtk4/patches/patch-Source_WebCore_crypto_algorithms_CryptoAlgorithmAES__GCM.cpp
new file mode 100644
index 0000000000..fc20a3f8c3
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_crypto_algorithms_CryptoAlgorithmAES__GCM.cpp
@@ -0,0 +1,17 @@
+$NetBSD: patch-Source_WebCore_crypto_algorithms_CryptoAlgorithmAES__GCM.cpp,v 1.1 2020/07/28 14:24:03 leot Exp $
+
+Define non-stardard __WORDSIZE.
+
+--- Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp.orig 2020-02-04 10:24:07.000000000 +0000
++++ Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
+@@ -26,6 +26,10 @@
+ #include "config.h"
+ #include "CryptoAlgorithmAES_GCM.h"
+
++#ifndef __WORDSIZE
++#define __WORDSIZE (__SIZEOF_LONG__ * 8)
++#endif
++
+ #if ENABLE(WEB_CRYPTO)
+
+ #include "CryptoAlgorithmAesGcmParams.h"
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_inspector_InspectorFrontendHost.cpp b/webkit-gtk4/patches/patch-Source_WebCore_inspector_InspectorFrontendHost.cpp
new file mode 100644
index 0000000000..4d6971e9c5
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_inspector_InspectorFrontendHost.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_WebCore_inspector_InspectorFrontendHost.cpp,v 1.1 2018/10/24 18:31:07 leot Exp $
+
+Add support for NetBSD.
+
+--- Source/WebCore/inspector/InspectorFrontendHost.cpp.orig 2018-08-06 14:07:41.000000000 +0000
++++ Source/WebCore/inspector/InspectorFrontendHost.cpp
+@@ -279,6 +279,8 @@ String InspectorFrontendHost::platform()
+ return "freebsd"_s;
+ #elif OS(OPENBSD)
+ return "openbsd"_s;
++#elif OS(NETBSD)
++ return "netbsd"_s;
+ #else
+ return "unknown"_s;
+ #endif
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_platform_graphics_filters_FEMorphology.cpp b/webkit-gtk4/patches/patch-Source_WebCore_platform_graphics_filters_FEMorphology.cpp
new file mode 100644
index 0000000000..dfe5bbb353
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_platform_graphics_filters_FEMorphology.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_WebCore_platform_graphics_filters_FEMorphology.cpp,v 1.1 2018/06/15 09:17:02 jperkin Exp $
+
+Avoid ambiguous function call.
+
+--- Source/WebCore/platform/graphics/filters/FEMorphology.cpp.orig 2018-02-19 11:04:38.000000000 +0000
++++ Source/WebCore/platform/graphics/filters/FEMorphology.cpp
+@@ -32,6 +32,8 @@
+ #include <wtf/Vector.h>
+ #include <wtf/text/TextStream.h>
+
++using std::sqrt;
++
+ namespace WebCore {
+
+ FEMorphology::FEMorphology(Filter& filter, MorphologyOperatorType type, float radiusX, float radiusY)
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_platform_gtk_PlatformScreenGtk.cpp b/webkit-gtk4/patches/patch-Source_WebCore_platform_gtk_PlatformScreenGtk.cpp
new file mode 100644
index 0000000000..2cd6ad36c2
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_platform_gtk_PlatformScreenGtk.cpp
@@ -0,0 +1,32 @@
+$NetBSD$
+
+--- Source/WebCore/platform/gtk/PlatformScreenGtk.cpp.orig 2020-08-12 09:17:55.000000000 +0000
++++ Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
+@@ -38,6 +38,11 @@
+ #include "Widget.h"
+
+ #include <cmath>
++#ifdef GDK_WINDOWING_MACOS
++#define __GDKMACOS_H_INSIDE__
++#include <gdk/macos/gdkmacos.h>
++#undef __GDKMACOS_H_INSIDE__
++#endif
+ #include <gtk/gtk.h>
+ #include <wtf/HashMap.h>
+ #include <wtf/HashSet.h>
+@@ -206,7 +211,15 @@ FloatRect screenAvailableRect(Widget*)
+ return { };
+
+ GdkRectangle workArea;
++#if USE(GTK4)
++# if ENABLE_QUARTZ_TARGET
++ gdk_macos_monitor_get_workarea(monitor.get(), &workArea);
++# elif ENABLE_X11_TARGET
++ gdk_x11_monitor_get_workarea(monitor.get(), &workArea);
++# endif
++#else
+ gdk_monitor_get_workarea(monitor.get(), &workArea);
++#endif
+
+ return FloatRect(workArea.x, workArea.y, workArea.width, workArea.height);
+ }
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_platform_text_TextCodecICU.cpp b/webkit-gtk4/patches/patch-Source_WebCore_platform_text_TextCodecICU.cpp
new file mode 100644
index 0000000000..0571dbb355
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_platform_text_TextCodecICU.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-Source_WebCore_platform_text_TextCodecICU.cpp,v 1.1 2020/11/06 22:21:35 leot Exp $
+
+Backport upstream changeset 269325.
+
+[WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and TRUE
+macros by default https://bugs.webkit.org/show_bug.cgi?id=218522
+
+--- Source/WebCore/platform/text/TextCodecICU.cpp.orig 2020-08-12 09:17:55.000000000 +0000
++++ Source/WebCore/platform/text/TextCodecICU.cpp
+@@ -240,7 +240,7 @@ void TextCodecICU::createICUConverter()
+ UErrorCode error = U_ZERO_ERROR;
+ m_converter = ICUConverterPtr { ucnv_open(m_canonicalConverterName, &error), ucnv_close };
+ if (m_converter)
+- ucnv_setFallback(m_converter.get(), TRUE);
++ ucnv_setFallback(m_converter.get(), true);
+ }
+
+ int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& error)
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_rendering_RenderLayerBacking.h b/webkit-gtk4/patches/patch-Source_WebCore_rendering_RenderLayerBacking.h
new file mode 100644
index 0000000000..a5bc9bd4af
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_rendering_RenderLayerBacking.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-Source_WebCore_rendering_RenderLayerBacking.h,v 1.1 2020/07/28 14:24:03 leot Exp $
+
+Define non-stardard __WORDSIZE.
+
+--- Source/WebCore/rendering/RenderLayerBacking.h.orig 2020-02-04 10:24:08.000000000 +0000
++++ Source/WebCore/rendering/RenderLayerBacking.h
+@@ -33,6 +33,10 @@
+ #include "RenderLayerCompositor.h"
+ #include "ScrollingCoordinator.h"
+
++#ifndef __WORDSIZE
++#define __WORDSIZE (__SIZEOF_LONG__ * 8)
++#endif
++
+ namespace WebCore {
+
+ class EventRegionContext;
diff --git a/webkit-gtk4/patches/patch-Source_WebCore_rendering_shapes_RasterShape.cpp b/webkit-gtk4/patches/patch-Source_WebCore_rendering_shapes_RasterShape.cpp
new file mode 100644
index 0000000000..23109a78ef
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebCore_rendering_shapes_RasterShape.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_WebCore_rendering_shapes_RasterShape.cpp,v 1.1 2017/04/13 16:58:14 jperkin Exp $
+
+Avoid ambiguous function call.
+
+--- Source/WebCore/rendering/shapes/RasterShape.cpp.orig 2016-04-11 06:18:44.000000000 +0000
++++ Source/WebCore/rendering/shapes/RasterShape.cpp
+@@ -142,7 +142,7 @@ const RasterShapeIntervals& RasterShape:
+ return *m_intervals;
+
+ int shapeMarginInt = clampToPositiveInteger(ceil(shapeMargin()));
+- int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize.height()) * sqrt(2);
++ int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize.height()) * sqrt((double)2);
+ if (!m_marginIntervals)
+ m_marginIntervals = m_intervals->computeShapeMarginIntervals(std::min(shapeMarginInt, maxShapeMarginInt));
+
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_CMakeLists.txt b/webkit-gtk4/patches/patch-Source_WebKit_CMakeLists.txt
new file mode 100644
index 0000000000..28c10a9fca
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_CMakeLists.txt
@@ -0,0 +1,17 @@
+$NetBSD: patch-Source_WebKit_CMakeLists.txt,v 1.1 2018/05/16 18:55:45 jperkin Exp $
+
+SunOS requires libsocket.
+
+--- Source/WebKit/CMakeLists.txt.orig 2018-03-05 08:47:55.000000000 +0000
++++ Source/WebKit/CMakeLists.txt
+@@ -808,6 +808,10 @@ if (UNIX)
+ endif ()
+ endif ()
+
++if (CMAKE_SYSTEM_NAME MATCHES "SunOS")
++ list(APPEND WebKit_LIBRARIES socket)
++endif ()
++
+ macro(ADD_WEBKIT_PREFIX_HEADER _target)
+ if (WebKit_USE_PREFIX_HEADER)
+ get_target_property(OLD_COMPILE_FLAGS ${_target} COMPILE_FLAGS)
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_NetworkProcess_cache_NetworkCacheFileSystem.cpp b/webkit-gtk4/patches/patch-Source_WebKit_NetworkProcess_cache_NetworkCacheFileSystem.cpp
new file mode 100644
index 0000000000..109f6e0dcc
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_NetworkProcess_cache_NetworkCacheFileSystem.cpp
@@ -0,0 +1,19 @@
+$NetBSD: patch-Source_WebKit_NetworkProcess_cache_NetworkCacheFileSystem.cpp,v 1.4 2020/09/11 14:47:35 leot Exp $
+
+SunOS does not support DT_{DIR,REG}
+
+--- Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp
+@@ -36,6 +36,12 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
++#ifndef DT_DIR
++#define DT_DIR S_IFDIR
++#endif
++#ifndef DT_REG
++#define DT_REG S_IFREG
++#endif
+ #else
+ #include <windows.h>
+ #endif
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_PlatformGTK.cmake b/webkit-gtk4/patches/patch-Source_WebKit_PlatformGTK.cmake
new file mode 100644
index 0000000000..01e8b61796
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_PlatformGTK.cmake
@@ -0,0 +1,27 @@
+$NetBSD: patch-Source_WebKit_PlatformGTK.cmake,v 1.3 2019/03/13 20:49:41 leot Exp $
+
+SunOS ld does not support --version-script.
+
+--- Source/WebKit/PlatformGTK.cmake.orig 2020-09-11 08:11:29.000000000 +0000
++++ Source/WebKit/PlatformGTK.cmake
+@@ -24,7 +24,7 @@ add_definitions(-DLOCALEDIR="${CMAKE_INS
+ add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
+ add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}")
+
+-if (NOT DEVELOPER_MODE AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
++if (NOT DEVELOPER_MODE AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" AND NOT CMAKE_SYSTEM_NAME MATCHES "SunOS")
+ WEBKIT_ADD_TARGET_PROPERTIES(WebKit LINK_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/webkitglib-symbols.map")
+ endif ()
+
+@@ -492,6 +492,11 @@ if (GTK_UNIX_PRINT_FOUND)
+ list(APPEND WebKit_LIBRARIES GTK::UnixPrint)
+ endif ()
+
++if (USE_ATK)
++ list(APPEND WebKit_LIBRARIES ${ATK_LIBRARIES})
++ list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES ${ATK_INCLUDE_DIRS})
++endif ()
++
+ if (LIBNOTIFY_FOUND)
+ list(APPEND WebKit_PRIVATE_LIBRARIES
+ ${LIBNOTIFY_LIBRARIES}
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_ArgumentCoders.h b/webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_ArgumentCoders.h
new file mode 100644
index 0000000000..81bcebaa4f
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_ArgumentCoders.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- Source/WebKit/Platform/IPC/ArgumentCoders.h.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/Platform/IPC/ArgumentCoders.h
+@@ -38,6 +38,10 @@
+ #include <wtf/Variant.h>
+ #include <wtf/WallTime.h>
+
++#ifdef __APPLE__
++#include <mach/mach.h> /* audit_token_t */
++#endif
++
+ namespace IPC {
+
+ // An argument coder works on POD types
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_unix_ConnectionUnix.cpp b/webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_unix_ConnectionUnix.cpp
new file mode 100644
index 0000000000..e344e314b1
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_Platform_IPC_unix_ConnectionUnix.cpp
@@ -0,0 +1,24 @@
+$NetBSD: patch-Source_WebKit_Platform_IPC_unix_ConnectionUnix.cpp,v 1.2 2019/09/10 22:10:04 leot Exp $
+
+On NetBSD we see "Error sending IPC message: Message too long" due to
+the use of sendmsg with a large message body (EMSGSIZE).
+
+WebKit already uses shared memory to communicate the message body when
+the message is too large, so force it to always use this method to avoid
+encountering EMSGSIZE.
+
+--- Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp.orig 2017-08-09 09:13:52.000000000 +0000
++++ Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
+@@ -380,8 +380,12 @@ bool Connection::sendOutgoingMessage(std
+ return false;
+ }
+
++#if 0
+ size_t messageSizeWithBodyInline = sizeof(MessageInfo) + (outputMessage.attachments().size() * sizeof(AttachmentInfo)) + outputMessage.bodySize();
+ if (messageSizeWithBodyInline > messageMaxSize && outputMessage.bodySize()) {
++#else
++ {
++#endif
+ RefPtr<WebKit::SharedMemory> oolMessageBody = WebKit::SharedMemory::allocate(encoder->bufferSize());
+ if (!oolMessageBody)
+ return false;
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_Platform_SharedMemory.h b/webkit-gtk4/patches/patch-Source_WebKit_Platform_SharedMemory.h
new file mode 100644
index 0000000000..e94f3af939
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_Platform_SharedMemory.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- Source/WebKit/Platform/SharedMemory.h.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/Platform/SharedMemory.h
+@@ -96,11 +96,10 @@ public:
+ mutable IPC::Attachment m_attachment;
+ #elif OS(DARWIN)
+ mutable mach_port_t m_port { MACH_PORT_NULL };
+- size_t m_size;
+ #elif OS(WINDOWS)
+ mutable HANDLE m_handle;
+- size_t m_size;
+ #endif
++ size_t m_size;
+ };
+
+ static RefPtr<SharedMemory> allocate(size_t);
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_Platform_classifier_ResourceLoadStatisticsClassifier.cpp b/webkit-gtk4/patches/patch-Source_WebKit_Platform_classifier_ResourceLoadStatisticsClassifier.cpp
new file mode 100644
index 0000000000..7da485db18
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_Platform_classifier_ResourceLoadStatisticsClassifier.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_WebKit_Platform_classifier_ResourceLoadStatisticsClassifier.cpp,v 1.1 2018/05/16 18:55:45 jperkin Exp $
+
+Avoid ambiguous function call.
+
+--- Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.cpp.orig 2018-02-20 07:38:30.000000000 +0000
++++ Source/WebKit/Platform/classifier/ResourceLoadStatisticsClassifier.cpp
+@@ -29,6 +29,8 @@
+ #include "Logging.h"
+ #include <WebCore/ResourceLoadStatistics.h>
+
++using std::sqrt;
++
+ namespace WebKit {
+ using namespace WebCore;
+
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_Scripts_check-xcfilelists.sh b/webkit-gtk4/patches/patch-Source_WebKit_Scripts_check-xcfilelists.sh
new file mode 100644
index 0000000000..083291faba
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_Scripts_check-xcfilelists.sh
@@ -0,0 +1,18 @@
+$NetBSD: patch-Source_WebKit_Scripts_check-xcfilelists.sh,v 1.2 2019/09/10 22:10:04 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Source/WebKit/Scripts/check-xcfilelists.sh.orig 2019-08-28 11:46:32.000000000 +0000
++++ Source/WebKit/Scripts/check-xcfilelists.sh
+@@ -1,8 +1,8 @@
+ #!/bin/sh
+
+-[ "${WK_DISABLE_CHECK_XCFILELISTS}" == "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
+-[ "${DEPLOYMENT_LOCATION}" == "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
+-[ "${USE_INTERNAL_SDK}" == "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
++[ "${WK_DISABLE_CHECK_XCFILELISTS}" = "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
++[ "${DEPLOYMENT_LOCATION}" = "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
++[ "${USE_INTERNAL_SDK}" = "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
+
+ SCRIPT="${BUILD_SCRIPTS_DIR}/generate-xcfilelists"
+ [ -f "${SCRIPT}" ] || SCRIPT="${PROJECT_DIR}/../../../${WK_ADDITIONAL_SCRIPTS_DIR}/generate-xcfilelists"
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_Scripts_generate-unified-sources.sh b/webkit-gtk4/patches/patch-Source_WebKit_Scripts_generate-unified-sources.sh
new file mode 100644
index 0000000000..26851b80d3
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_Scripts_generate-unified-sources.sh
@@ -0,0 +1,15 @@
+$NetBSD: patch-Source_WebKit_Scripts_generate-unified-sources.sh,v 1.1 2019/03/13 20:49:41 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Source/WebKit/Scripts/generate-unified-sources.sh.orig 2019-02-12 11:21:18.000000000 +0000
++++ Source/WebKit/Scripts/generate-unified-sources.sh
+@@ -7,7 +7,7 @@ ARGS=("$@")
+ cd $SRCROOT
+
+ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
+- if [ "${DEPLOYMENT_LOCATION}" == "YES" ]; then
++ if [ "${DEPLOYMENT_LOCATION}" = "YES" ]; then
+ BUILD_SCRIPTS_DIR="${SDKROOT}${WK_ALTERNATE_WEBKIT_SDK_PATH}/usr/local/include/wtf/Scripts"
+ else
+ BUILD_SCRIPTS_DIR="${BUILT_PRODUCTS_DIR}/usr/local/include/wtf/Scripts"
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_Shared_SandboxExtension.h b/webkit-gtk4/patches/patch-Source_WebKit_Shared_SandboxExtension.h
new file mode 100644
index 0000000000..e64ee60feb
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_Shared_SandboxExtension.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- Source/WebKit/Shared/SandboxExtension.h.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/Shared/SandboxExtension.h
+@@ -34,6 +34,10 @@
+ #include <wtf/Vector.h>
+ #include <wtf/text/WTFString.h>
+
++#ifdef __APPLE__
++#include <mach/mach.h> /* audit_token_t */
++#endif
++
+ namespace IPC {
+ class Encoder;
+ class Decoder;
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitAuthenticationDialog.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitAuthenticationDialog.cpp
new file mode 100644
index 0000000000..75a3d93d9c
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitAuthenticationDialog.cpp
@@ -0,0 +1,37 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp
+@@ -98,12 +98,12 @@ static void webkitAuthenticationDialogIn
+ GtkWidget* vBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 20);
+
+ GtkWidget* box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+- gtk_widget_add_css_class(box, GTK_STYLE_CLASS_TITLEBAR);
++ gtk_widget_add_css_class(box, "titlebar");
+ gtk_widget_set_size_request(box, -1, 16);
+ GtkWidget* title = gtk_label_new(_("Authentication Required"));
+ gtk_widget_set_margin_top(title, 6);
+ gtk_widget_set_margin_bottom(title, 6);
+- gtk_widget_add_css_class(title, GTK_STYLE_CLASS_TITLE);
++ gtk_widget_add_css_class(title, "title");
+ #if USE(GTK4)
+ gtk_widget_set_hexpand(title, TRUE);
+ gtk_widget_set_halign(title, GTK_ALIGN_CENTER);
+@@ -193,7 +193,7 @@ static void webkitAuthenticationDialogIn
+ GtkWidget* loginLabel = gtk_label_new_with_mnemonic(_("_Username"));
+ gtk_label_set_mnemonic_widget(GTK_LABEL(loginLabel), priv->loginEntry);
+ gtk_widget_set_halign(loginLabel, GTK_ALIGN_END);
+- gtk_widget_add_css_class(loginLabel, GTK_STYLE_CLASS_DIM_LABEL);
++ gtk_widget_add_css_class(loginLabel, "dim-label");
+ gtk_widget_show(loginLabel);
+
+ priv->passwordEntry = gtk_entry_new();
+@@ -205,7 +205,7 @@ static void webkitAuthenticationDialogIn
+ GtkWidget* passwordLabel = gtk_label_new_with_mnemonic(_("_Password"));
+ gtk_label_set_mnemonic_widget(GTK_LABEL(passwordLabel), priv->passwordEntry);
+ gtk_widget_set_halign(passwordLabel, GTK_ALIGN_END);
+- gtk_widget_add_css_class(passwordLabel, GTK_STYLE_CLASS_DIM_LABEL);
++ gtk_widget_add_css_class(passwordLabel, "dim-label");
+ gtk_widget_show(passwordLabel);
+
+ GtkWidget* grid = gtk_grid_new();
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitScriptDialogImpl.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitScriptDialogImpl.cpp
new file mode 100644
index 0000000000..cdba4076a0
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitScriptDialogImpl.cpp
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/API/gtk/WebKitScriptDialogImpl.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/API/gtk/WebKitScriptDialogImpl.cpp
+@@ -113,13 +113,13 @@ static void webkitScriptDialogImplConstr
+ #endif
+
+ GtkWidget* box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+- gtk_widget_add_css_class(box, GTK_STYLE_CLASS_TITLEBAR);
++ gtk_widget_add_css_class(box, "titlebar");
+ gtk_widget_set_size_request(box, -1, 16);
+ priv->title = gtk_label_new(nullptr);
+ gtk_label_set_ellipsize(GTK_LABEL(priv->title), PANGO_ELLIPSIZE_END);
+ gtk_widget_set_margin_top(priv->title, 6);
+ gtk_widget_set_margin_bottom(priv->title, 6);
+- gtk_widget_add_css_class(priv->title, GTK_STYLE_CLASS_TITLE);
++ gtk_widget_add_css_class(priv->title, "title");
+ #if USE(GTK4)
+ gtk_widget_set_hexpand(priv->title, TRUE);
+ gtk_widget_set_halign(priv->title, GTK_ALIGN_CENTER);
+@@ -235,7 +235,7 @@ static void webkit_script_dialog_impl_cl
+ widgetClass->key_press_event = webkitScriptDialogImplKeyPressEvent;
+ #endif
+ widgetClass->map = webkitScriptDialogImplMap;
+- gtk_widget_class_set_accessible_role(widgetClass, ATK_ROLE_ALERT);
++ gtk_widget_class_set_accessible_role(widgetClass, GTK_ACCESSIBLE_ROLE_ALERT);
+ }
+
+ static void webkitScriptDialogImplSetText(WebKitScriptDialogImpl* dialog, const char* text, GtkRequisition* maxSize)
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewBase.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewBase.cpp
new file mode 100644
index 0000000000..ddb4aa55a0
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewBase.cpp
@@ -0,0 +1,34 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
+@@ -1746,8 +1746,9 @@ static AtkObject* webkitWebViewBaseGetAc
+
+ // Set the parent to not break bottom-up navigation.
+ if (auto* parentWidget = gtk_widget_get_parent(widget)) {
+- if (auto* axParent = gtk_widget_get_accessible(parentWidget))
+- atk_object_set_parent(priv->accessible.get(), axParent);
++// TODO don't know how to fix this
++// if (auto* axParent = gtk_widget_get_accessible(parentWidget))
++// atk_object_set_parent(priv->accessible.get(), axParent);
+ }
+ }
+
+@@ -1778,7 +1779,7 @@ static void toplevelWindowIsActiveChange
+ static void toplevelWindowStateChanged(GdkSurface* surface, GParamSpec*, WebKitWebViewBase* webViewBase)
+ {
+ auto state = gdk_toplevel_get_state(GDK_TOPLEVEL(surface));
+- bool visible = !(state & GDK_SURFACE_STATE_MINIMIZED);
++ bool visible = !(state & GDK_TOPLEVEL_STATE_MINIMIZED);
+ WebKitWebViewBasePrivate* priv = webViewBase->priv;
+ if (visible) {
+ if (priv->activityState & ActivityState::IsVisible)
+@@ -2004,7 +2005,7 @@ static void webkit_web_view_base_class_i
+ #if !USE(GTK4)
+ widgetClass->event = webkitWebViewBaseEvent;
+ #endif
+- widgetClass->get_accessible = webkitWebViewBaseGetAccessible;
++// widgetClass->get_accessible = webkitWebViewBaseGetAccessible;
+ #if USE(GTK4)
+ widgetClass->root = webkitWebViewBaseRoot;
+ widgetClass->unroot = webkitWebViewBaseUnroot;
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewDialog.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewDialog.cpp
new file mode 100644
index 0000000000..093595597e
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewDialog.cpp
@@ -0,0 +1,35 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/API/gtk/WebKitWebViewDialog.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/API/gtk/WebKitWebViewDialog.cpp
+@@ -113,8 +113,8 @@ static void webkitWebViewDialogConstruct
+ #if USE(GTK4)
+ gtk_widget_add_css_class(GTK_WIDGET(object), "dialog");
+ gtk_widget_add_css_class(GTK_WIDGET(object), "message");
+- gtk_widget_add_css_class(GTK_WIDGET(object), GTK_STYLE_CLASS_CSD);
+- gtk_widget_remove_css_class(GTK_WIDGET(object), GTK_STYLE_CLASS_BACKGROUND);
++ gtk_widget_add_css_class(GTK_WIDGET(object), "csd");
++ gtk_widget_remove_css_class(GTK_WIDGET(object), "background");
+
+ WebKitWebViewDialogPrivate* priv = WEBKIT_WEB_VIEW_DIALOG(object)->priv;
+ priv->cssProvider = adoptGRef(gtk_css_provider_new());
+@@ -122,8 +122,8 @@ static void webkitWebViewDialogConstruct
+ #else
+ gtk_widget_set_app_paintable(GTK_WIDGET(object), TRUE);
+
+- gtk_style_context_add_class(gtk_widget_get_style_context(GTK_WIDGET(object)), GTK_STYLE_CLASS_CSD);
+- gtk_style_context_add_class(gtk_widget_get_style_context(GTK_WIDGET(object)), GTK_STYLE_CLASS_BACKGROUND);
++ gtk_style_context_add_class(gtk_widget_get_style_context(GTK_WIDGET(object)), "csd");
++ gtk_style_context_add_class(gtk_widget_get_style_context(GTK_WIDGET(object)), "background");
+ #endif
+ }
+
+@@ -154,7 +154,7 @@ void webkitWebViewDialogSetChild(WebKitW
+ g_clear_pointer(&priv->child, gtk_widget_unparent);
+ if (child) {
+ gtk_widget_set_parent(child, GTK_WIDGET(dialog));
+- gtk_widget_add_css_class(child, GTK_STYLE_CLASS_BACKGROUND);
++ gtk_widget_add_css_class(child, "background");
+ gtk_style_context_add_provider(gtk_widget_get_style_context(child), GTK_STYLE_PROVIDER(priv->cssProvider.get()), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ priv->child = child;
+ }
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewGtk.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewGtk.cpp
new file mode 100644
index 0000000000..708fc7d1ae
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_API_gtk_WebKitWebViewGtk.cpp
@@ -0,0 +1,23 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp
+@@ -154,15 +154,15 @@ static void surfaceStateChangedCallback(
+ bool eventCompleted = false;
+ switch (state->type) {
+ case WindowStateEvent::Type::Maximize:
+- if (surfaceState & GDK_SURFACE_STATE_MAXIMIZED)
++ if (surfaceState & GDK_TOPLEVEL_STATE_MAXIMIZED)
+ eventCompleted = true;
+ break;
+ case WindowStateEvent::Type::Minimize:
+- if ((surfaceState & GDK_SURFACE_STATE_MINIMIZED) || !gdk_surface_get_mapped(surface))
++ if ((surfaceState & GDK_TOPLEVEL_STATE_MINIMIZED) || !gdk_surface_get_mapped(surface))
+ eventCompleted = true;
+ break;
+ case WindowStateEvent::Type::Restore:
+- if (!(surfaceState & GDK_SURFACE_STATE_MAXIMIZED) && !(surfaceState & GDK_SURFACE_STATE_MINIMIZED))
++ if (!(surfaceState & GDK_TOPLEVEL_STATE_MAXIMIZED) && !(surfaceState & GDK_TOPLEVEL_STATE_MINIMIZED))
+ eventCompleted = true;
+ break;
+ }
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_CoordinatedGraphics_DrawingAreaProxyCoordinatedGraphics.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_CoordinatedGraphics_DrawingAreaProxyCoordinatedGraphics.cpp
new file mode 100644
index 0000000000..e91ed30c84
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_CoordinatedGraphics_DrawingAreaProxyCoordinatedGraphics.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-Source_WebKit_UIProcess_CoordinatedGraphics_DrawingAreaProxyCoordinatedGraphics.cpp,v 1.1 2020/11/06 22:21:35 leot Exp $
+
+Backport upstream changeset 269325.
+
+[WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and TRUE
+macros by default https://bugs.webkit.org/show_bug.cgi?id=218522
+
+--- Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
+@@ -402,7 +402,7 @@ DrawingAreaProxyCoordinatedGraphics::Dra
+ int DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback(DrawingAreaProxyCoordinatedGraphics::DrawingMonitor* monitor)
+ {
+ monitor->didDraw();
+- return FALSE;
++ return false;
+ }
+
+ void DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start(WTF::Function<void(CallbackBase::Error)>&& callback)
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_Inspector_gtk_WebKitInspectorWindow.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_Inspector_gtk_WebKitInspectorWindow.cpp
new file mode 100644
index 0000000000..89717ee3a0
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_Inspector_gtk_WebKitInspectorWindow.cpp
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp
+@@ -64,14 +64,14 @@ static void webkit_inspector_window_init
+ gtk_widget_set_halign(titleLabel, GTK_ALIGN_CENTER);
+ gtk_label_set_single_line_mode(GTK_LABEL(titleLabel), TRUE);
+ gtk_label_set_ellipsize(GTK_LABEL(titleLabel), PANGO_ELLIPSIZE_END);
+- gtk_widget_add_css_class(titleLabel, GTK_STYLE_CLASS_TITLE);
++ gtk_widget_add_css_class(titleLabel, "title");
+ gtk_widget_set_parent(titleLabel, box);
+
+ window->subtitleLabel = gtk_label_new(nullptr);
+ gtk_widget_set_halign(window->subtitleLabel, GTK_ALIGN_CENTER);
+ gtk_label_set_single_line_mode(GTK_LABEL(window->subtitleLabel), TRUE);
+ gtk_label_set_ellipsize(GTK_LABEL(window->subtitleLabel), PANGO_ELLIPSIZE_END);
+- gtk_widget_add_css_class(window->subtitleLabel, GTK_STYLE_CLASS_SUBTITLE);
++ gtk_widget_add_css_class(window->subtitleLabel, "subtitle");
+ gtk_widget_set_parent(window->subtitleLabel, box);
+ gtk_widget_hide(window->subtitleLabel);
+
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebDataListSuggestionsDropdownGtk.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebDataListSuggestionsDropdownGtk.cpp
new file mode 100644
index 0000000000..ae246353d7
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebDataListSuggestionsDropdownGtk.cpp
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp
+@@ -35,6 +35,10 @@
+ #include <WebCore/IntPoint.h>
+ #include <wtf/glib/GRefPtr.h>
+ #include <wtf/glib/GUniquePtr.h>
++#if USE(GTK4) && PLATFORM(QUARTZ)
++#define __GDKMACOS_H_INSIDE__
++#include <gdk/macos/gdkmacos.h>
++#endif
+
+ namespace WebKit {
+
+@@ -165,7 +169,13 @@ void WebDataListSuggestionsDropdownGtk::
+ auto* monitor = gdk_display_get_monitor_at_window(display, gtk_widget_get_window(m_webView));
+ #endif
+ GdkRectangle area;
++#if USE(GTK4) && PLATFORM(QUARTZ)
++ gdk_macos_monitor_get_workarea(monitor, &area);
++#elif USE(GTK4) && PLATFORM(X11)
++ gdk_x11_monitor_get_workarea(monitor, &area);
++#else
+ gdk_monitor_get_workarea(monitor, &area);
++#endif
+ int width = std::min(information.elementRect.width(), area.width);
+ size_t itemCount = std::min<size_t>(information.suggestions.size(), (area.height / 3) / itemHeight);
+
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPageProxyGtk.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPageProxyGtk.cpp
new file mode 100644
index 0000000000..426de6d651
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPageProxyGtk.cpp
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/gtk/WebPageProxyGtk.cpp.orig 2020-09-04 06:25:12.000000000 +0000
++++ Source/WebKit/UIProcess/gtk/WebPageProxyGtk.cpp
+@@ -72,9 +72,9 @@ String WebPageProxy::standardUserAgent(c
+
+ void WebPageProxy::bindAccessibilityTree(const String& plugID)
+ {
+- auto* accessible = gtk_widget_get_accessible(viewWidget());
+- atk_socket_embed(ATK_SOCKET(accessible), const_cast<char*>(plugID.utf8().data()));
+- atk_object_notify_state_change(accessible, ATK_STATE_TRANSIENT, FALSE);
++// auto* accessible = gtk_widget_get_accessible(viewWidget());
++// atk_socket_embed(ATK_SOCKET(accessible), const_cast<char*>(plugID.utf8().data()));
++// atk_object_notify_state_change(accessible, ATK_STATE_TRANSIENT, FALSE);
+ }
+
+ void WebPageProxy::saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&)
diff --git a/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPopupMenuProxyGtk.cpp b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPopupMenuProxyGtk.cpp
new file mode 100644
index 0000000000..36570b2da4
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_WebKit_UIProcess_gtk_WebPopupMenuProxyGtk.cpp
@@ -0,0 +1,36 @@
+$NetBSD$
+
+--- Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp.orig 2020-08-12 09:17:56.000000000 +0000
++++ Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp
+@@ -34,6 +34,10 @@
+ #include <gtk/gtk.h>
+ #include <wtf/glib/GUniquePtr.h>
+ #include <wtf/text/CString.h>
++#if USE(GTK4) && PLATFORM(QUARTZ)
++#define __GDKMACOS_H_INSIDE__
++#include <gdk/macos/gdkmacos.h>
++#endif
+
+ namespace WebKit {
+ using namespace WebCore;
+@@ -259,7 +263,7 @@ void WebPopupMenuProxyGtk::createPopupMe
+ auto* event = gtk_event_controller_get_current_event(controller);
+ if (popupMenu->typeAheadFind(keyval, gdk_event_get_time(event)))
+ return GDK_EVENT_STOP;
+- return gtk_event_controller_key_forward(GTK_EVENT_CONTROLLER_KEY(controller), popupMenu->m_treeView);
++ return (bool)gtk_event_controller_key_forward(GTK_EVENT_CONTROLLER_KEY(controller), popupMenu->m_treeView);
+ }), this);
+ gtk_widget_add_controller(m_popup, controller);
+ #else
+@@ -320,7 +324,11 @@ void WebPopupMenuProxyGtk::showPopupMenu
+ auto* monitor = gdk_display_get_monitor_at_window(display, gtk_widget_get_window(m_webView));
+ #endif
+ GdkRectangle area;
++#if USE(GTK4) && PLATFORM(QUARTZ)
++ gdk_macos_monitor_get_workarea(monitor, &area);
++#else
+ gdk_monitor_get_workarea(monitor, &area);
++#endif
+ int width = std::min(rect.width(), area.width);
+ size_t itemCount = std::min<size_t>(items.size(), (area.height / 3) / itemHeight);
+
diff --git a/webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_BPlatform.h b/webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_BPlatform.h
new file mode 100644
index 0000000000..ded0539f8f
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_BPlatform.h
@@ -0,0 +1,25 @@
+$NetBSD: patch-Source_bmalloc_bmalloc_BPlatform.h,v 1.2 2019/09/10 22:10:04 leot Exp $
+
+Add BOS(SOLARIS) and BOS(NETBSD) definitions.
+
+--- Source/bmalloc/bmalloc/BPlatform.h.orig 2019-08-28 11:46:33.000000000 +0000
++++ Source/bmalloc/bmalloc/BPlatform.h
+@@ -48,10 +48,18 @@
+ #define BOS_LINUX 1
+ #endif
+
++#ifdef __sun
++#define BOS_SOLARIS 1
++#endif
++
+ #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
+ #define BOS_FREEBSD 1
+ #endif
+
++#if defined(__NetBSD__)
++#define BOS_NETBSD 1
++#endif
++
+ #if defined(WIN32) || defined(_WIN32)
+ #define BOS_WINDOWS 1
+ #endif
diff --git a/webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_VMAllocate.h b/webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_VMAllocate.h
new file mode 100644
index 0000000000..13514d1053
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_bmalloc_bmalloc_VMAllocate.h
@@ -0,0 +1,28 @@
+$NetBSD: patch-Source_bmalloc_bmalloc_VMAllocate.h,v 1.3 2019/09/10 22:10:04 leot Exp $
+
+NetBSD has MADV_FREE too.
+Use posix_madvise on SunOS.
+
+--- Source/bmalloc/bmalloc/VMAllocate.h.orig 2019-08-28 11:46:33.000000000 +0000
++++ Source/bmalloc/bmalloc/VMAllocate.h
+@@ -201,8 +201,10 @@ inline void vmDeallocatePhysicalPages(vo
+ vmValidatePhysical(p, vmSize);
+ #if BOS(DARWIN)
+ SYSCALL(madvise(p, vmSize, MADV_FREE_REUSABLE));
+-#elif BOS(FREEBSD)
++#elif BOS(FREEBSD) || BOS(NETBSD)
+ SYSCALL(madvise(p, vmSize, MADV_FREE));
++#elif BOS(SOLARIS)
++ SYSCALL(posix_madvise(p, vmSize, MADV_DONTNEED));
+ #else
+ SYSCALL(madvise(p, vmSize, MADV_DONTNEED));
+ #if BOS(LINUX)
+@@ -216,6 +218,8 @@ inline void vmAllocatePhysicalPages(void
+ vmValidatePhysical(p, vmSize);
+ #if BOS(DARWIN)
+ SYSCALL(madvise(p, vmSize, MADV_FREE_REUSE));
++#elif BOS(SOLARIS)
++ SYSCALL(posix_madvise(p, vmSize, MADV_NORMAL));
+ #else
+ SYSCALL(madvise(p, vmSize, MADV_NORMAL));
+ #if BOS(LINUX)
diff --git a/webkit-gtk4/patches/patch-Source_cmake_FindGTK.cmake b/webkit-gtk4/patches/patch-Source_cmake_FindGTK.cmake
new file mode 100644
index 0000000000..f79dbbbe1b
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_cmake_FindGTK.cmake
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- Source/cmake/FindGTK.cmake.orig 2020-08-12 09:17:57.000000000 +0000
++++ Source/cmake/FindGTK.cmake
+@@ -85,7 +85,11 @@ if (GTK_FIND_VERSION VERSION_LESS 3.90)
+ set(GTK_4 FALSE)
+ set(GTK_3 TRUE)
+ else ()
+- set(GTK_PC_MODULE "gtk4")
++ if (ENABLE_QUARTZ_TARGET)
++ set(GTK_PC_MODULE "gtk4-macos")
++ else ()
++ set(GTK_PC_MODULE "gtk4")
++ endif ()
+ set(GTK_PC_UNIX_PRINT_MODULE "gtk4-unix-print")
+ set(GTK_4 TRUE)
+ set(GTK_3 FALSE)
+@@ -123,6 +127,10 @@ if (GTK_VERSION AND GTK_VERSION_OK)
+ endforeach ()
+ endif ()
+
++if (DEFINED GTK_SUPPORTS_MACOS)
++ set(GTK_SUPPORTS_QUARTZ ${GTK_SUPPORTS_MACOS})
++endif ()
++
+ if (TARGET PkgConfig::GTK AND NOT TARGET GTK::GTK)
+ add_library(GTK::GTK INTERFACE IMPORTED GLOBAL)
+ set_property(TARGET GTK::GTK PROPERTY
diff --git a/webkit-gtk4/patches/patch-Source_cmake_OptionsCommon.cmake b/webkit-gtk4/patches/patch-Source_cmake_OptionsCommon.cmake
new file mode 100644
index 0000000000..73f47f0099
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_cmake_OptionsCommon.cmake
@@ -0,0 +1,21 @@
+$NetBSD: patch-Source_cmake_OptionsCommon.cmake,v 1.4 2018/04/09 08:33:48 wiz Exp $
+
+Using the T option of GNU ar lead to malformed .a archive on NetBSD. Disable it.
+
+--- Source/cmake/OptionsCommon.cmake.orig 2017-02-27 07:11:15.000000000 +0000
++++ Source/cmake/OptionsCommon.cmake
+@@ -27,10 +27,10 @@ option(USE_THIN_ARCHIVES "Produce all st
+ if (USE_THIN_ARCHIVES)
+ execute_process(COMMAND ${CMAKE_AR} -V OUTPUT_VARIABLE AR_VERSION)
+ if ("${AR_VERSION}" MATCHES "^GNU ar")
+- set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> crT <TARGET> <LINK_FLAGS> <OBJECTS>")
+- set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> crT <TARGET> <LINK_FLAGS> <OBJECTS>")
+- set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> rT <TARGET> <LINK_FLAGS> <OBJECTS>")
+- set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> rT <TARGET> <LINK_FLAGS> <OBJECTS>")
++ set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
++ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
++ set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
++ set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
+ endif ()
+ endif ()
+
diff --git a/webkit-gtk4/patches/patch-Source_cmake_WebKitFindPackage.cmake b/webkit-gtk4/patches/patch-Source_cmake_WebKitFindPackage.cmake
new file mode 100644
index 0000000000..b35b205db2
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Source_cmake_WebKitFindPackage.cmake
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- Source/cmake/WebKitFindPackage.cmake.orig 2020-08-12 09:17:57.000000000 +0000
++++ Source/cmake/WebKitFindPackage.cmake
+@@ -85,21 +85,6 @@ macro(find_package package)
+ endif ()
+ endif ()
+
+- # Apple builds have a unique location for ICU
+- if (APPLE AND "${package}" STREQUAL "ICU")
+- set(_found_package ON)
+-
+- set(ICU_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/ICU/Headers)
+-
+- # Apple just has a single dylib for ICU
+- set(ICU_I18N_LIBRARY /usr/lib/libicucore.dylib)
+- set(ICU_UC_LIBRARY /usr/lib/libicucore.dylib)
+- set(ICU_DATA_LIBRARY /usr/lib/libicucore.dylib)
+-
+- set(ICU_LIBRARIES ${ICU_UC_LIBRARY})
+- set(ICU_FOUND ON)
+- endif ()
+-
+ if (NOT _found_package)
+ _find_package(${ARGV})
+ endif ()
diff --git a/webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserSearchBox.c b/webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserSearchBox.c
new file mode 100644
index 0000000000..b1d58b1334
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserSearchBox.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- Tools/MiniBrowser/gtk/BrowserSearchBox.c.orig 2020-08-12 09:17:57.000000000 +0000
++++ Tools/MiniBrowser/gtk/BrowserSearchBox.c
+@@ -187,8 +187,8 @@ static void browser_search_box_init(Brow
+
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(searchBox), GTK_ORIENTATION_HORIZONTAL);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(GTK_WIDGET(searchBox), GTK_STYLE_CLASS_LINKED);
+- gtk_widget_add_css_class(GTK_WIDGET(searchBox), GTK_STYLE_CLASS_RAISED);
++ gtk_widget_add_css_class(GTK_WIDGET(searchBox), "linked");
++ gtk_widget_add_css_class(GTK_WIDGET(searchBox), "raised");
+ #else
+ GtkStyleContext *styleContext = gtk_widget_get_style_context(GTK_WIDGET(searchBox));
+ gtk_style_context_add_class(styleContext, GTK_STYLE_CLASS_LINKED);
diff --git a/webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserWindow.c b/webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserWindow.c
new file mode 100644
index 0000000000..35c1ab6f3f
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Tools_MiniBrowser_gtk_BrowserWindow.c
@@ -0,0 +1,88 @@
+$NetBSD$
+
+--- Tools/MiniBrowser/gtk/BrowserWindow.c.orig 2020-08-12 09:17:57.000000000 +0000
++++ Tools/MiniBrowser/gtk/BrowserWindow.c
+@@ -989,9 +989,9 @@ static void browserWindowSetupEditorTool
+
+ GtkWidget *groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(groupBox, GTK_STYLE_CLASS_LINKED);
++ gtk_widget_add_css_class(groupBox, "linked");
+ #else
+- gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
++ gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), "linked");
+ #endif
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_TOGGLE, "format-text-bold-symbolic", "edit.Bold");
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_TOGGLE, "format-text-italic-symbolic", "edit.Italic");
+@@ -1006,9 +1006,9 @@ static void browserWindowSetupEditorTool
+
+ groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(groupBox, GTK_STYLE_CLASS_LINKED);
++ gtk_widget_add_css_class(groupBox, "linked");
+ #else
+- gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
++ gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), "linked");
+ #endif
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-cut-symbolic", "edit.Cut");
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-copy-symbolic", "edit.Copy");
+@@ -1022,9 +1022,9 @@ static void browserWindowSetupEditorTool
+
+ groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(groupBox, GTK_STYLE_CLASS_LINKED);
++ gtk_widget_add_css_class(groupBox, "linked");
+ #else
+- gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
++ gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), "linked");
+ #endif
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-undo-symbolic", "edit.Undo");
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-redo-symbolic", "edit.Redo");
+@@ -1037,9 +1037,9 @@ static void browserWindowSetupEditorTool
+
+ groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(groupBox, GTK_STYLE_CLASS_LINKED);
++ gtk_widget_add_css_class(groupBox, "linked");
+ #else
+- gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
++ gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), "linked");
+ #endif
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-justify-left-symbolic", "edit.JustifyLeft");
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-justify-center-symbolic", "edit.JustifyCenter");
+@@ -1053,9 +1053,9 @@ static void browserWindowSetupEditorTool
+
+ groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(groupBox, GTK_STYLE_CLASS_LINKED);
++ gtk_widget_add_css_class(groupBox, "linked");
+ #else
+- gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
++ gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), "linked");
+ #endif
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-indent-more-symbolic", "edit.Indent");
+ addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-indent-less-symbolic", "edit.Outdent");
+@@ -1068,9 +1068,9 @@ static void browserWindowSetupEditorTool
+
+ groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(groupBox, GTK_STYLE_CLASS_LINKED);
++ gtk_widget_add_css_class(groupBox, "linked");
+ #else
+- gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
++ gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), "linked");
+ #endif
+ GtkWidget *button = addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "insert-image-symbolic", NULL);
+ g_signal_connect(button, "clicked", G_CALLBACK(insertImageCommandCallback), window);
+@@ -1239,9 +1239,9 @@ static void browser_window_init(BrowserW
+
+ GtkWidget *navigationBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ #if GTK_CHECK_VERSION(3, 98, 5)
+- gtk_widget_add_css_class(navigationBox, GTK_STYLE_CLASS_LINKED);
++ gtk_widget_add_css_class(navigationBox, "linked");
+ #else
+- gtk_style_context_add_class(gtk_widget_get_style_context(navigationBox), GTK_STYLE_CLASS_LINKED);
++ gtk_style_context_add_class(gtk_widget_get_style_context(navigationBox), "linked");
+ #endif
+
+ window->backItem = addToolbarButton(navigationBox, TOOLBAR_BUTTON_NORMAL, "go-previous-symbolic", "win.go-back");
diff --git a/webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_check-xcfilelists.sh b/webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_check-xcfilelists.sh
new file mode 100644
index 0000000000..fd052a0c10
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_check-xcfilelists.sh
@@ -0,0 +1,18 @@
+$NetBSD: patch-Tools_TestWebKitAPI_Scripts_check-xcfilelists.sh,v 1.1 2019/09/10 22:10:04 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Tools/TestWebKitAPI/Scripts/check-xcfilelists.sh.orig 2019-08-28 11:46:33.000000000 +0000
++++ Tools/TestWebKitAPI/Scripts/check-xcfilelists.sh
+@@ -1,8 +1,8 @@
+ #!/bin/sh
+
+-[ "${WK_DISABLE_CHECK_XCFILELISTS}" == "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
+-[ "${DEPLOYMENT_LOCATION}" == "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
+-[ "${USE_INTERNAL_SDK}" == "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
++[ "${WK_DISABLE_CHECK_XCFILELISTS}" = "1" ] && { echo "### Not running because WK_DISABLE_CHECK_XCFILELISTS is set"; exit 0; }
++[ "${DEPLOYMENT_LOCATION}" = "YES" ] && { echo "### Not running because DEPLOYMENT_LOCATION is YES"; exit 0; }
++[ "${USE_INTERNAL_SDK}" = "YES" ] || { echo "### Not running because USE_INTERNAL_SDK is not YES"; exit 0; }
+
+ SCRIPT="${BUILD_SCRIPTS_DIR}/generate-xcfilelists"
+ [ -f "${SCRIPT}" ] || SCRIPT="${PROJECT_DIR}/../../../${WK_ADDITIONAL_SCRIPTS_DIR}/generate-xcfilelists"
diff --git a/webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_generate-unified-sources.sh b/webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_generate-unified-sources.sh
new file mode 100644
index 0000000000..2e68384ca3
--- /dev/null
+++ b/webkit-gtk4/patches/patch-Tools_TestWebKitAPI_Scripts_generate-unified-sources.sh
@@ -0,0 +1,15 @@
+$NetBSD: patch-Tools_TestWebKitAPI_Scripts_generate-unified-sources.sh,v 1.1 2019/09/10 22:10:04 leot Exp $
+
+Avoid unportable `==' test(1) operator.
+
+--- Tools/TestWebKitAPI/Scripts/generate-unified-sources.sh.orig 2019-08-28 11:46:33.000000000 +0000
++++ Tools/TestWebKitAPI/Scripts/generate-unified-sources.sh
+@@ -7,7 +7,7 @@ ARGS=("$@")
+ cd $SRCROOT
+
+ if [ -z "${BUILD_SCRIPTS_DIR}" ]; then
+- if [ "${DEPLOYMENT_LOCATION}" == "YES" ]; then
++ if [ "${DEPLOYMENT_LOCATION}" = "YES" ]; then
+ BUILD_SCRIPTS_DIR="${SDKROOT}${WK_ALTERNATE_WEBKIT_SDK_PATH}/usr/local/include/wtf/Scripts"
+ else
+ BUILD_SCRIPTS_DIR="${BUILT_PRODUCTS_DIR}/usr/local/include/wtf/Scripts"
diff --git a/webkit-gtk4/patches/patch-aj b/webkit-gtk4/patches/patch-aj
new file mode 100644
index 0000000000..127e1897ca
--- /dev/null
+++ b/webkit-gtk4/patches/patch-aj
@@ -0,0 +1,15 @@
+$NetBSD: patch-aj,v 1.7 2018/10/24 18:31:08 leot Exp $
+
+Add support for NetBSD, OpenBSD and Solaris.
+
+--- Source/WTF/wtf/InlineASM.h.orig 2017-02-20 16:20:15.000000000 +0000
++++ Source/WTF/wtf/InlineASM.h
+@@ -40,7 +40,7 @@
+ #define THUMB_FUNC_PARAM(name)
+ #endif
+
+-#if (OS(LINUX) || OS(FREEBSD)) && CPU(X86_64)
++#if ((OS(LINUX) || OS(FREEBSD) || OS(NETBSD) || OS(OPENBSD) || OS(SOLARIS)) && CPU(X86_64)) || (OS(SOLARIS) && CPU(X86))
+ #define GLOBAL_REFERENCE(name) #name "@plt"
+ #elif CPU(X86) && COMPILER(MINGW)
+ #define GLOBAL_REFERENCE(name) "@" #name "@4"
Home |
Main Index |
Thread Index |
Old Index