From ac985d7d355a0c99e5566e27a675360951073582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Bertin?= Date: Sun, 25 Feb 2024 21:21:32 +0100 Subject: [PATCH] make the port build on 10.9.5 . provide a choice (subport) to install a build of the 4.1 API . It looks like this should install in parallel to the 4.0 build but that remains to be confirmed. Currently it builds, links and installs, but currently with WEB_GL disabled. That could be related to my custom Mesa port providing OpenEGL and GLESv1,2 . The MiniBrowser seems to work but hangs on opening about:gpu and Epiphany seems to be unable to render pages at all (but without the UI lockup). Both times I tried the new build I ended up getting a KP; once while in the MiniBrowser, once after running Epiphany and (quite soon after) a suspend/wake cycle. --- www/webkit2-gtk-devel/Portfile | 274 ++++-- www/webkit2-gtk-devel/files/MacTypes.h | 799 ++++++++++++++++++ .../files/file-linux-madv_free.diff | 15 + .../patch-DateInstance-nullptr-deref.diff | 26 + .../files/patch-IPC-failure-message.diff | 13 + .../files/patch-WTF-wtf-Randomdevice.diff | 22 +- .../files/patch-WTF-wtf-getVTablePointer.diff | 37 - .../files/patch-cmake-no-colours.diff | 19 + .../files/patch-cmake-summary.diff | 17 + .../files/patch-currenttime.diff | 17 + .../files/patch-fix-jsc_jsch-include.diff | 76 ++ .../files/patch-gigacage.diff | 16 + .../files/patch-less-gcrypt-oops-msg.diff | 23 + .../files/patch-mach_vm.diff | 39 + .../files/patch-mactypes.diff | 16 + .../files/patch-minibrowser-jsc.diff | 23 + .../files/patch-no-cocoa-headers.diff | 37 + .../files/patch-no-machsendright.diff | 74 ++ .../patch-reduce-mem-overheads-linux.diff | 21 + ...putimeunix-cpp-darwin-version-restore.diff | 26 +- ...h-webkit2gtk-2282-os-log-availability.diff | 112 +++ ...bkit2gtk-2282-unprotected-egl-changes.diff | 12 + .../files/patch-webkit2gtk-macports.diff | 17 +- .../files/prefer-pthread.patch | 28 + 24 files changed, 1642 insertions(+), 117 deletions(-) create mode 100644 www/webkit2-gtk-devel/files/MacTypes.h create mode 100644 www/webkit2-gtk-devel/files/file-linux-madv_free.diff create mode 100644 www/webkit2-gtk-devel/files/patch-DateInstance-nullptr-deref.diff create mode 100644 www/webkit2-gtk-devel/files/patch-IPC-failure-message.diff delete mode 100644 www/webkit2-gtk-devel/files/patch-WTF-wtf-getVTablePointer.diff create mode 100644 www/webkit2-gtk-devel/files/patch-cmake-no-colours.diff create mode 100644 www/webkit2-gtk-devel/files/patch-cmake-summary.diff create mode 100644 www/webkit2-gtk-devel/files/patch-currenttime.diff create mode 100644 www/webkit2-gtk-devel/files/patch-fix-jsc_jsch-include.diff create mode 100644 www/webkit2-gtk-devel/files/patch-gigacage.diff create mode 100644 www/webkit2-gtk-devel/files/patch-less-gcrypt-oops-msg.diff create mode 100644 www/webkit2-gtk-devel/files/patch-mach_vm.diff create mode 100644 www/webkit2-gtk-devel/files/patch-mactypes.diff create mode 100644 www/webkit2-gtk-devel/files/patch-minibrowser-jsc.diff create mode 100644 www/webkit2-gtk-devel/files/patch-no-cocoa-headers.diff create mode 100644 www/webkit2-gtk-devel/files/patch-no-machsendright.diff create mode 100644 www/webkit2-gtk-devel/files/patch-reduce-mem-overheads-linux.diff create mode 100644 www/webkit2-gtk-devel/files/prefer-pthread.patch diff --git a/www/webkit2-gtk-devel/Portfile b/www/webkit2-gtk-devel/Portfile index 0d4caa5258c6..1ff6024a3827 100644 --- a/www/webkit2-gtk-devel/Portfile +++ b/www/webkit2-gtk-devel/Portfile @@ -1,37 +1,58 @@ # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 -# We have an umbrella radar tracking webkit-gtk issues on OS X. Please relate +# We have an umbrella radar tracking webkit-gtk issues on OS X. Please relate # any future issues with this tracker. # http://bugs.webkit.org/show_bug.cgi?id=126492 PortSystem 1.0 PortGroup active_variants 1.1 PortGroup cmake 1.1 -PortGroup legacysupport 1.1 +platform darwin { + PortGroup legacysupport 1.1 + PortGroup compiler_blacklist_versions 1.0 -compiler.cxx_standard 2017 + # clang-12 is the 1st version I have installed that compiles FileSystem.cpp (using std::filesystem) correctly + compiler.blacklist {clang < 602} {macports-clang-3.[0-9]} {macports-clang-[4-9].0} {macports-clang-1[0-1]} +} + +compiler.cxx_standard 2020 + +platform darwin { + # Fix compilation for Angle subproject: platform.h: error: 'TARGET_OS_OSX' is not defined + legacysupport.newest_darwin_requires_legacy 15 +} cmake.generator Ninja -# Fix compilation for Angle subproject: platform.h: error: 'TARGET_OS_OSX' is not defined -legacysupport.newest_darwin_requires_legacy 15 +build.pre_args-prepend -k 0 + +# ensure pre-compiled headers and the possible use of ccache can co-exist +configure.env-append \ + "CCACHE_SLOPPINESS=pch_defines,time_macros" +build.env-append "CCACHE_SLOPPINESS=pch_defines,time_macros" -name webkit2-gtk-devel conflicts webkit2-gtk -set my_name webkitgtk +name webkit2-gtk-devel +set upstream_name webkitgtk version 2.40.1 -revision 0 +description Apple's WebKit2 HTML rendering library for GTK+3, +if {${subport} eq "${name}"} { + description-append \ + API=webkit2gtk-4.0 +} else { + description-append \ + API=webkit2gtk-4.1 +} +long_description ${description} +maintainers {devans @dbevans} {kencu @kencu} categories www gnome -platforms darwin freebsd +platforms darwin freebsd linux license LGPL-2+ BSD -maintainers {devans @dbevans} {mascguy @mascguy} - -description Apple's WebKit2 HTML rendering library for GTK+3 -long_description ${description} homepage http://webkitgtk.org/ - master_sites http://webkitgtk.org/releases/ + use_xz yes -distname ${my_name}-${version} +distname ${upstream_name}-${version} + dist_subdir webkit-gtk checksums rmd160 953121c65430f89785664d3b9a193ff74943a2f2 \ @@ -39,44 +60,50 @@ checksums rmd160 953121c65430f89785664d3b9a193ff74943a2f2 \ size 39599544 depends_build-append \ - port:gi-docgen \ port:gperf \ - port:gtk-doc \ - port:perl5.34 \ + port:perl5 \ port:pkgconfig \ port:python27 \ - port:py27-simplejson + port:unifdef depends_lib-append port:atk \ - port:at-spi2-atk \ port:bison \ path:lib/pkgconfig/cairo.pc:cairo \ port:flex \ - port:fontconfig \ port:freetype \ - port:enchant2 \ - port:geoclue2 \ path:lib/pkgconfig/glib-2.0.pc:glib2 \ path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \ port:gstreamer1 \ - port:gstreamer1-gst-plugins-bad \ port:gstreamer1-gst-plugins-base \ port:gstreamer1-gst-plugins-good \ path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \ path:lib/pkgconfig/harfbuzz-icu.pc:harfbuzz-icu \ - port:hyphen \ path:lib/pkgconfig/icu-uc.pc:icu \ path:include/turbojpeg.h:libjpeg-turbo \ port:libnotify \ port:libpng \ port:libsecret \ - path:lib/pkgconfig/libsoup-2.4.pc:libsoup \ + port:libsoup-2.4 \ port:libxml2 \ port:libxslt \ port:sqlite3 \ port:webp \ port:woff2 \ port:zlib +platform darwin { + # doc generation should frankly be a variant because how Joe Users consult the stuff? + depends_build-append \ + port:gtk-doc \ + port:py27-simplejson + +# port:gstreamer1-gst-plugins-bad + depends_lib-append \ + port:at-spi2-atk \ + port:fontconfig \ + port:geoclue2 \ + port:enchant2 \ + port:hyphen +} # 1. add missing JavaScriptCore include directory used only on Apple webkit builds @@ -86,11 +113,13 @@ depends_lib-append port:atk \ # 5. change some int64_t to gint64 to stop typedef errors in gstreamer patchfiles-append patch-webkit2gtk-macports.diff -# and a few more for webkit2-gtk-2.27.2 -patchfiles-append patch-webkit2gtk-272-macports.diff +platform darwin { + # and a few more for webkit2-gtk-2.27.2 + patchfiles-append patch-webkit2gtk-272-macports.diff -# and a few more for 282 -patchfiles-append patch-webkit2gtk-2282-unprotected-egl-changes.diff + # and a few more for 282 + patchfiles-append patch-webkit2gtk-2282-unprotected-egl-changes.diff +} # os log is only available on newer systems. patchfiles-append patch-webkit2gtk-2282-os-log-availability.diff @@ -100,17 +129,22 @@ patchfiles-append patch-webkit2gtk-2282-os-log-availability.diff # configure.args-append -DENABLE_NETSCAPE_PLUGIN_API=OFF patchfiles-append patch-enable-plugin-architecture-unix.diff -# add a link library to WebCore. I am not sure this is still needed; builds and -# runs without this patch. -patchfiles-append patch-bundle-link-webcore.diff +platform darwin { + # add a link library to WebCore. I am not sure this is still needed; builds and + # runs without this patch. + patchfiles-append patch-bundle-link-webcore.diff + +} # Fix build errors due to -WWc++11-narrowing # https://bugs.webkit.org/show_bug.cgi?id=211193 #patchfiles-append patch-bool_narrowed.diff -# Explicitly specify installed dylib paths to g-ir-compile -# Fixes dlopen errors in apps using webkit2gtk introspection -#patchfiles-append patch-webkit2gtk-specify-installed-dylibs.diff +platform darwin { + # Explicitly specify installed dylib paths to g-ir-compile + # Fixes dlopen errors in apps using webkit2gtk introspection +# patchfiles-append patch-webkit2gtk-specify-installed-dylibs.diff +} # Backport https://github.com/WebKit/WebKit/commit/b83958928838b8a997c12a8de06f89377df0a903 #patchfiles-append patch-icu-68-true-false.diff @@ -122,7 +156,9 @@ configure.cppflags-append \ # it is preferred to use the WebKit built in bmalloc if it builds on a given os. # it has improved security features, but not all systems can build it at present. configure.args-append \ + -DUSE_APPLE_ICU=OFF \ -DPORT=GTK \ + -DENABLE_WEBDRIVER=OFF \ -DENABLE_GAMEPAD=OFF \ -DENABLE_INTROSPECTION=ON \ -DENABLE_JOURNALD_LOG=OFF \ @@ -130,7 +166,22 @@ configure.args-append \ -DENABLE_VIDEO=ON \ -DUSE_GSTREAMER_TRANSCODER=OFF \ -DUSE_SYSTEM_MALLOC=OFF \ - -DPERL_EXECUTABLE=${prefix}/bin/perl5.34 + -DPERL_EXECUTABLE=${prefix}/bin/perl5 \ + -DENABLE_ACCELERATED_2D_CANVAS=ON \ + -DENABLE_ASYNC_SCROLLING=ON \ + -DENABLE_WEBGL=OFF \ + -DENABLE_DOCUMENTATION=OFF \ + -DUSE_AVIF=OFF \ + -DUSE_SOUP2=ON +platform linux { + configure.args-replace \ + -DENABLE_WEBGL=OFF \ + -DENABLE_WEBGL=ON + configure.args-append \ + -DUSE_WPE_RENDERER=OFF \ + -DENABLE_BUBBLEWRAP_SANDBOX=OFF \ + -DUSE_LD_LLD=OFF -DUSE_LD_GOLD=OFF +} pre-configure { if {![variant_isset quartz] && ![variant_isset x11]} { @@ -138,13 +189,22 @@ pre-configure { } } -if {![variant_isset quartz]} { +if {${os.platform} ne "darwin" || ![variant_isset quartz]} { default_variants-append +x11 } # this is nice to have, and should be the default default_variants-append +minibrowser +subport ${name}-4.1 { + depends_lib-replace \ + port:libsoup-2.4 \ + port:libsoup + configure.args-replace \ + -DUSE_SOUP2=ON \ + -DUSE_SOUP2=OFF +} + variant quartz conflicts x11 { require_active_variants path:lib/pkgconfig/gtk+-3.0.pc:gtk3 quartz @@ -168,16 +228,52 @@ variant x11 conflicts quartz { -DENABLE_QUARTZ_TARGET=OFF \ -DENABLE_X11_TARGET=ON \ -DENABLE_OPENGL=ON + platform darwin { + configure.args-append \ + -DUSE_GBM=OFF + } depends_lib-append \ - port:mesa \ - port:xorg-libXt + port:mesa + platform darwin { + depends_lib-append \ + port:xorg-libXt + } +} + + +variant av1 description {build in AV1 image file support} { + depends_lib-append \ + port:libavif + configure.args-replace \ + -DUSE_AVIF=OFF \ + -DUSE_AVIF=ON } variant minibrowser description {Build and install MiniBrowser (for testing)} { configure.args-delete -DENABLE_MINIBROWSER=OFF configure.args-append -DENABLE_MINIBROWSER=ON - depends_run-append port:adwaita-icon-theme + platform darwin { + depends_build-append port:cctools + depends_run-append port:adwaita-icon-theme + } +} + +platform linux { + variant wayland description {Enable Wayland support} {} + if {[variant_isset wayland]} { + ui_warn "The Wayland variant has not yet been implemented" + pre-fetch { + return -code error "Invalid variant requested" + } + depends_lib-append \ + port:libwpe + configure.args-append \ + -DENABLE_WAYLAND_TARGET=ON + } else { + configure.args-append \ + -DENABLE_WAYLAND_TARGET=OFF + } } # see https://trac.macports.org/ticket/56792 @@ -188,7 +284,7 @@ variant minibrowser description {Build and install MiniBrowser (for testing)} { universal_variant no # Fix builds if ccache happens to be installed when configure.ccache=no -if {![option configure.ccache]} { +if {![option configure.ccache] && ${configureccache} eq ""} { build.env-append CCACHE_DIR=${workpath}/.ccache } @@ -203,12 +299,15 @@ if {${os.platform} eq "darwin" && ${os.major} <= 16} { patchfiles-append patch-source-wtf-wtf-unix-cputimeunix-cpp-darwin-version-restore.diff # some Darwin versions don't have MAP_JIT; only use it if available - patchfiles-append patch-source-wtf-wtf-osallocatorposix-cpp-map-jit.diff + # NEEDS REFACTORING + # patchfiles-append patch-source-wtf-wtf-osallocatorposix-cpp-map-jit.diff # gl cocoa build continues to fail due to use of API not available on darwin 12 or earlier # so gstreamergl is not available at present for darwin 12 or earlier # todo clarify further where this is exactly needed - configure.args-append -DUSE_GSTREAMER_GL=OFF + if {${os.major} <= 12} { + configure.args-append -DUSE_GSTREAMER_GL=OFF + } # for the webcore/page/crypt code to flow correctly, # ENABLE_WEB_CRYPTO has to be ON for 10.10+ and OFF for 10.9 and less @@ -234,12 +333,35 @@ if {${os.platform} eq "darwin" && ${os.major} <= 16} { } # there is a missing header that manifests on 10.7 and less - patchfiles-append patch-webkit2gtk-source-javascriptcore-jit-executableallocator-missingfcntl-h-older-systems.diff + # NEEDS REFACTORING + # patchfiles-append patch-webkit2gtk-source-javascriptcore-jit-executableallocator-missingfcntl-h-older-systems.diff + + # include the proper Mach VM header: + patchfiles-append patch-mach_vm.diff + patchfiles-append patch-gigacage.diff \ + patch-currenttime.diff \ + patch-no-machsendright.diff \ + patch-no-cocoa-headers.diff \ + patch-mactypes.diff + # This is a tricky one and seems related to how CMake's "make" generator + # can (sometimes?) forget to generate the Javascript targets. + # Add an apparently missing path to a derived headerdir and make explicit copies + # therein of headers that shouldn't be necessary... + patchfiles-append patch-fix-jsc_jsch-include.diff # add dep for newer ruby and spec this for build # https://trac.macports.org/ticket/52016 - depends_build-append port:ruby25 - configure.args-append -DRUBY_EXECUTABLE=${prefix}/bin/ruby2.5 + set rubydepend port:ruby25 + set rubyexec ${prefix}/bin/ruby2.5 + foreach r {2.7 2.6 2.5 2.4 2.3} { + if {[file exists ${prefix}/bin/ruby${r}]} { + set rubydepend port:ruby[string map {. {}} ${r}] + set rubyexec ${prefix}/bin/ruby${r} + break + } + } + depends_build-append ${rubydepend} + configure.args-append -DRUBY_EXECUTABLE=${rubyexec} # fix missing PRId64 definitions on systems # that don't define __STDC_FORMAT_MACROS by default @@ -255,14 +377,60 @@ if {${os.platform} eq "darwin" && ${os.major} <= 16} { configure.cxxflags-append -D_GLIBCXX_USE_C99_MATH_TR1=1 configure.cxxflags-append -include ${filespath}/snowmath.h } + + # companion code to patch-mactypes.diff : + post-configure { +# TODO: check if the path exists directly after the configure step or else what other potentially appropriate paths do exist. + xinstall -m 644 ${filespath}/MacTypes.h ${build.dir}/JavaScriptCore/Headers/JavaScriptCore/ + } + post-destroot { + xinstall -m 644 ${filespath}/MacTypes.h ${destroot}${prefix}/include/webkitgtk-4.0/JavaScriptCore/ + } } -notes-append " -If you are porting new software to use webkit2gtk on Apple systems,\ -you will likely need to define BUILDING_GTK__ to get the correct\ -behaviour from WebKitAvailability.h. -" +# RJVB +patchfiles-append patch-DateInstance-nullptr-deref.diff \ + patch-IPC-failure-message.diff \ + patch-cmake-summary.diff \ + patch-cmake-no-colours.diff \ + patch-less-gcrypt-oops-msg.diff + +# for some reason the JavaScriptCore libspec isn't defined when building the MiniBrowser +# catch and rectify: +patchfiles-append patch-minibrowser-jsc.diff +if {${subport} eq "${name}"} { + set wkAPIVersion 4.0 +} else { + set wkAPIVersion 4.1 +} +if {${os.platform} eq "darwin"} { + post-patch { + reinplace "s|@API@|${wkAPIVersion}|g" ${worksrcpath}/Tools/MiniBrowser/gtk/CMakeLists.txt + reinplace "s|@SHEXT@|dylib|g" ${worksrcpath}/Tools/MiniBrowser/gtk/CMakeLists.txt + } + post-destroot { + if {[variant_isset minibrowser]} { + system "install_name_tool -change @rpath/libjavascriptcoregtk-4.0.18.dylib \ + ${prefix}/lib/libjavascriptcoregtk-4.0.18.dylib ${destroot}${prefix}/libexec/webkit2gtk-4.0/MiniBrowser" + } + } + + notes-append " + If you are porting new software to use webkit2gtk on Apple systems,\ + you will likely need to define BUILDING_GTK__ to get the correct\ + behaviour from WebKitAvailability.h. + " +} else { + patchfiles-append \ + prefer-pthread.patch \ + patch-reduce-mem-overheads-linux.diff \ + file-linux-madv_free.diff + post-patch { + reinplace "s|@API@|${wkAPIVersion}|g" ${worksrcpath}/Tools/MiniBrowser/gtk/CMakeLists.txt + reinplace "s|@SHEXT@|so|g" ${worksrcpath}/Tools/MiniBrowser/gtk/CMakeLists.txt + } +} livecheck.type regex livecheck.url http://webkitgtk.org/releases/ -livecheck.regex "${my_name}-(\\d+\\.\\d*\[02468\](?:\\.\\d+)*)" +livecheck.regex "${upstream_name}-(\\d+\\.\\d*\[02468\](?:\\.\\d+)*)" diff --git a/www/webkit2-gtk-devel/files/MacTypes.h b/www/webkit2-gtk-devel/files/MacTypes.h new file mode 100644 index 000000000000..e122256e96e4 --- /dev/null +++ b/www/webkit2-gtk-devel/files/MacTypes.h @@ -0,0 +1,799 @@ +/* + * Copyright (c) 1985-2011 by Apple Inc.. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + File: MacTypes.h + + Contains: Basic Macintosh data types. + + Version: CarbonCore-769~1 + + Bugs?: For bug reports, consult the following page on + the World Wide Web: + + http://developer.apple.com/bugreporter/ + +*/ +#ifndef __MACTYPES__ +#define __MACTYPES__ + +#ifndef __CONDITIONALMACROS__ +#include +#endif + +#include + +#include + +#include + +#if PRAGMA_ONCE +#pragma once +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#pragma pack(push, 2) + + +/* + CarbonCore Deprecation flags. + + Certain Carbon API functions are deprecated in 10.3 and later + systems. These will produce a warning when compiling on 10.3. + + Other functions and constants do not produce meaningful + results when building Carbon for Mac OS X. For these + functions, no-op macros are provided, but only when the + ALLOW_OBSOLETE_CARBON flag is defined to be 0: eg + -DALLOW_OBSOLETE_CARBON=0. +*/ + +#if ! defined(ALLOW_OBSOLETE_CARBON) || ! ALLOW_OBSOLETE_CARBON + +#define ALLOW_OBSOLETE_CARBON_MACMEMORY 0 +#define ALLOW_OBSOLETE_CARBON_OSUTILS 0 + +#else + +#define ALLOW_OBSOLETE_CARBON_MACMEMORY 1 /* Removes obsolete constants; turns HLock/HUnlock into no-op macros */ +#define ALLOW_OBSOLETE_CARBON_OSUTILS 1 /* Removes obsolete structures */ + +#endif + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ +#ifndef nil + #define nil NULL +#endif /* ! nil */ +/******************************************************************************** + + Base integer types for all target OS's and CPU's + + UInt8 8-bit unsigned integer + SInt8 8-bit signed integer + UInt16 16-bit unsigned integer + SInt16 16-bit signed integer + UInt32 32-bit unsigned integer + SInt32 32-bit signed integer + UInt64 64-bit unsigned integer + SInt64 64-bit signed integer + +*********************************************************************************/ +typedef unsigned char UInt8; +typedef signed char SInt8; +typedef unsigned short UInt16; +typedef signed short SInt16; + +#if __LP64__ +typedef unsigned int UInt32; +typedef signed int SInt32; +#else +typedef unsigned long UInt32; +typedef signed long SInt32; +#endif + +/* avoid redeclaration if libkern/OSTypes.h */ +#ifndef _OS_OSTYPES_H +#if TARGET_RT_BIG_ENDIAN +struct wide { + SInt32 hi; + UInt32 lo; +}; +typedef struct wide wide; +struct UnsignedWide { + UInt32 hi; + UInt32 lo; +}; +typedef struct UnsignedWide UnsignedWide; +#else +struct wide { + UInt32 lo; + SInt32 hi; +}; +typedef struct wide wide; +struct UnsignedWide { + UInt32 lo; + UInt32 hi; +}; +typedef struct UnsignedWide UnsignedWide; +#endif /* TARGET_RT_BIG_ENDIAN */ + +#endif + +#if TYPE_LONGLONG +/* + Note: wide and UnsignedWide must always be structs for source code + compatibility. On the other hand UInt64 and SInt64 can be + either a struct or a long long, depending on the compiler. + + If you use UInt64 and SInt64 you should do all operations on + those data types through the functions/macros in Math64.h. + This will assure that your code compiles with compilers that + support long long and those that don't. + + The MS Visual C/C++ compiler uses __int64 instead of long long. +*/ + #if defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86) + typedef signed __int64 SInt64; + typedef unsigned __int64 UInt64; + #else + typedef signed long long SInt64; + typedef unsigned long long UInt64; + #endif +#else + + +typedef wide SInt64; +typedef UnsignedWide UInt64; +#endif /* TYPE_LONGLONG */ + +/******************************************************************************** + + Base fixed point types + + Fixed 16-bit signed integer plus 16-bit fraction + UnsignedFixed 16-bit unsigned integer plus 16-bit fraction + Fract 2-bit signed integer plus 30-bit fraction + ShortFixed 8-bit signed integer plus 8-bit fraction + +*********************************************************************************/ +typedef SInt32 Fixed; +typedef Fixed * FixedPtr; +typedef SInt32 Fract; +typedef Fract * FractPtr; +typedef UInt32 UnsignedFixed; +typedef UnsignedFixed * UnsignedFixedPtr; +typedef short ShortFixed; +typedef ShortFixed * ShortFixedPtr; + + +/******************************************************************************** + + Base floating point types + + Float32 32 bit IEEE float: 1 sign bit, 8 exponent bits, 23 fraction bits + Float64 64 bit IEEE float: 1 sign bit, 11 exponent bits, 52 fraction bits + Float80 80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits + Float96 96 bit 68881 float: 1 sign bit, 15 exponent bits, 16 pad bits, 1 integer bit, 63 fraction bits + + Note: These are fixed size floating point types, useful when writing a floating + point value to disk. If your compiler does not support a particular size + float, a struct is used instead. + Use of of the NCEG types (e.g. double_t) or an ANSI C type (e.g. double) if + you want a floating point representation that is natural for any given + compiler, but might be a different size on different compilers. + +*********************************************************************************/ +typedef float Float32; +typedef double Float64; +struct Float80 { + SInt16 exp; + UInt16 man[4]; +}; +typedef struct Float80 Float80; + +struct Float96 { + SInt16 exp[2]; /* the second 16-bits are undefined */ + UInt16 man[4]; +}; +typedef struct Float96 Float96; +struct Float32Point { + Float32 x; + Float32 y; +}; +typedef struct Float32Point Float32Point; + +/******************************************************************************** + + MacOS Memory Manager types + + Ptr Pointer to a non-relocatable block + Handle Pointer to a master pointer to a relocatable block + Size The number of bytes in a block (signed for historical reasons) + +*********************************************************************************/ +typedef char * Ptr; +typedef Ptr * Handle; +typedef long Size; + +/******************************************************************************** + + Higher level basic types + + OSErr 16-bit result error code + OSStatus 32-bit result error code + LogicalAddress Address in the clients virtual address space + ConstLogicalAddress Address in the clients virtual address space that will only be read + PhysicalAddress Real address as used on the hardware bus + BytePtr Pointer to an array of bytes + ByteCount The size of an array of bytes + ByteOffset An offset into an array of bytes + ItemCount 32-bit iteration count + OptionBits Standard 32-bit set of bit flags + PBVersion ? + Duration 32-bit millisecond timer for drivers + AbsoluteTime 64-bit clock + ScriptCode A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding + LangCode A particular language (e.g. English), as represented using a particular ScriptCode + RegionCode Designates a language as used in a particular region (e.g. British vs American + English) together with other region-dependent characteristics (e.g. date format) + FourCharCode A 32-bit value made by packing four 1 byte characters together + OSType A FourCharCode used in the OS and file system (e.g. creator) + ResType A FourCharCode used to tag resources (e.g. 'DLOG') + +*********************************************************************************/ +typedef SInt16 OSErr; +typedef SInt32 OSStatus; +typedef void * LogicalAddress; +typedef const void * ConstLogicalAddress; +typedef void * PhysicalAddress; +typedef UInt8 * BytePtr; +typedef unsigned long ByteCount; +typedef unsigned long ByteOffset; +typedef SInt32 Duration; +typedef UnsignedWide AbsoluteTime; +typedef UInt32 OptionBits; +typedef unsigned long ItemCount; +typedef UInt32 PBVersion; +typedef SInt16 ScriptCode; +typedef SInt16 LangCode; +typedef SInt16 RegionCode; +typedef UInt32 FourCharCode; +typedef FourCharCode OSType; +typedef FourCharCode ResType; +typedef OSType * OSTypePtr; +typedef ResType * ResTypePtr; +/******************************************************************************** + + Boolean types and values + + Boolean Mac OS historic type, sizeof(Boolean)==1 + bool Defined in stdbool.h, ISO C/C++ standard type + false Now defined in stdbool.h + true Now defined in stdbool.h + +*********************************************************************************/ +typedef unsigned char Boolean; +/******************************************************************************** + + Function Pointer Types + + ProcPtr Generic pointer to a function + Register68kProcPtr Pointer to a 68K function that expects parameters in registers + UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor + + ProcHandle Pointer to a ProcPtr + UniversalProcHandle Pointer to a UniversalProcPtr + +*********************************************************************************/ +typedef CALLBACK_API_C( long , ProcPtr )(); +typedef CALLBACK_API( void , Register68kProcPtr )(); +#if TARGET_RT_MAC_CFM +/* The RoutineDescriptor structure is defined in MixedMode.h */ +typedef struct RoutineDescriptor *UniversalProcPtr; +#else +typedef ProcPtr UniversalProcPtr; +#endif /* TARGET_RT_MAC_CFM */ + +typedef ProcPtr * ProcHandle; +typedef UniversalProcPtr * UniversalProcHandle; +/******************************************************************************** + + RefCon Types + + For access to private data in callbacks, etc.; refcons are generally + used as a pointer to something, but in the 32-bit world refcons in + different APIs have had various types: pointer, unsigned scalar, and + signed scalar. The RefCon types defined here support the current 32-bit + usage but provide normalization to pointer types for 64-bit. + + PRefCon is preferred for new APIs; URefCon and SRefCon are primarily + for compatibility with existing APIs. + +*********************************************************************************/ +typedef void * PRefCon; +#if __LP64__ +typedef void * URefCon; +typedef void * SRefCon; +#else +typedef UInt32 URefCon; +typedef SInt32 SRefCon; +#endif /* __LP64__ */ + +/******************************************************************************** + + Common Constants + + noErr OSErr: function performed properly - no error + kNilOptions OptionBits: all flags false + kInvalidID KernelID: NULL is for pointers as kInvalidID is for ID's + kVariableLengthArray array bounds: variable length array + + Note: kVariableLengthArray was used in array bounds to specify a variable length array, + usually the last field in a struct. Now that the C language supports + the concept of flexible array members, you can instead use: + + struct BarList + { + short listLength; + Bar elements[]; + }; + + However, this changes the semantics somewhat, as sizeof( BarList ) contains + no space for any of the elements, so to allocate a list with space for + the count elements + + struct BarList* l = (struct BarList*) malloc( sizeof(BarList) + count * sizeof(Bar) ); + +*********************************************************************************/ +enum { + noErr = 0 +}; + +enum { + kNilOptions = 0 +}; + +#define kInvalidID 0 +enum { + kVariableLengthArray +#ifdef __has_extension + #if __has_extension(enumerator_attributes) + __attribute__((deprecated)) + #endif +#endif + = 1 +}; + +enum { + kUnknownType = 0x3F3F3F3F /* "????" QuickTime 3.0: default unknown ResType or OSType */ +}; + + + +/******************************************************************************** + + String Types and Unicode Types + + UnicodeScalarValue, A complete Unicode character in UTF-32 format, with + UTF32Char values from 0 through 0x10FFFF (excluding the surrogate + range 0xD800-0xDFFF and certain disallowed values). + + UniChar, A 16-bit Unicode code value in the default UTF-16 format. + UTF16Char UnicodeScalarValues 0-0xFFFF are expressed in UTF-16 + format using a single UTF16Char with the same value. + UnicodeScalarValues 0x10000-0x10FFFF are expressed in + UTF-16 format using a pair of UTF16Chars - one in the + high surrogate range (0xD800-0xDBFF) followed by one in + the low surrogate range (0xDC00-0xDFFF). All of the + characters defined in Unicode versions through 3.0 are + in the range 0-0xFFFF and can be expressed using a single + UTF16Char, thus the term "Unicode character" generally + refers to a UniChar = UTF16Char. + + UTF8Char An 8-bit code value in UTF-8 format. UnicodeScalarValues + 0-0x7F are expressed in UTF-8 format using one UTF8Char + with the same value. UnicodeScalarValues above 0x7F are + expressed in UTF-8 format using 2-4 UTF8Chars, all with + values in the range 0x80-0xF4 (UnicodeScalarValues + 0x100-0xFFFF use two or three UTF8Chars, + UnicodeScalarValues 0x10000-0x10FFFF use four UTF8Chars). + + UniCharCount A count of UTF-16 code values in an array or buffer. + + StrNNN Pascal string holding up to NNN bytes + StringPtr Pointer to a pascal string + StringHandle Pointer to a StringPtr + ConstStringPtr Pointer to a read-only pascal string + ConstStrNNNParam For function parameters only - means string is const + + CStringPtr Pointer to a C string (in C: char*) + ConstCStringPtr Pointer to a read-only C string (in C: const char*) + + Note: The length of a pascal string is stored as the first byte. + A pascal string does not have a termination byte. + A pascal string can hold at most 255 bytes of data. + The first character in a pascal string is offset one byte from the start of the string. + + A C string is terminated with a byte of value zero. + A C string has no length limitation. + The first character in a C string is the zeroth byte of the string. + + +*********************************************************************************/ +typedef UInt32 UnicodeScalarValue; +typedef UInt32 UTF32Char; +typedef UInt16 UniChar; +typedef UInt16 UTF16Char; +typedef UInt8 UTF8Char; +typedef UniChar * UniCharPtr; +typedef unsigned long UniCharCount; +typedef UniCharCount * UniCharCountPtr; +typedef unsigned char Str255[256]; +typedef unsigned char Str63[64]; +typedef unsigned char Str32[33]; +typedef unsigned char Str31[32]; +typedef unsigned char Str27[28]; +typedef unsigned char Str15[16]; +/* + The type Str32 is used in many AppleTalk based data structures. + It holds up to 32 one byte chars. The problem is that with the + length byte it is 33 bytes long. This can cause weird alignment + problems in structures. To fix this the type "Str32Field" has + been created. It should only be used to hold 32 chars, but + it is 34 bytes long so that there are no alignment problems. +*/ +typedef unsigned char Str32Field[34]; +/* + QuickTime 3.0: + The type StrFileName is used to make MacOS structs work + cross-platform. For example FSSpec or SFReply previously + contained a Str63 field. They now contain a StrFileName + field which is the same when targeting the MacOS but is + a 256 char buffer for Win32 and unix, allowing them to + contain long file names. +*/ +typedef Str63 StrFileName; +typedef unsigned char * StringPtr; +typedef StringPtr * StringHandle; +typedef const unsigned char * ConstStringPtr; +typedef const unsigned char * ConstStr255Param; +typedef const unsigned char * ConstStr63Param; +typedef const unsigned char * ConstStr32Param; +typedef const unsigned char * ConstStr31Param; +typedef const unsigned char * ConstStr27Param; +typedef const unsigned char * ConstStr15Param; +typedef ConstStr63Param ConstStrFileNameParam; +#ifdef __cplusplus +inline unsigned char StrLength(ConstStr255Param string) { return (*string); } +#else +#define StrLength(string) (*(unsigned char *)(string)) +#endif /* defined(__cplusplus) */ + +#if OLDROUTINENAMES +#define Length(string) StrLength(string) +#endif /* OLDROUTINENAMES */ + +/******************************************************************************** + + Process Manager type ProcessSerialNumber (previously in Processes.h) + +*********************************************************************************/ +/* type for unique process identifier */ +struct ProcessSerialNumber { + UInt32 highLongOfPSN; + UInt32 lowLongOfPSN; +}; +typedef struct ProcessSerialNumber ProcessSerialNumber; +typedef ProcessSerialNumber * ProcessSerialNumberPtr; +/******************************************************************************** + + Quickdraw Types + + Point 2D Quickdraw coordinate, range: -32K to +32K + Rect Rectangular Quickdraw area + Style Quickdraw font rendering styles + StyleParameter Style when used as a parameter (historical 68K convention) + StyleField Style when used as a field (historical 68K convention) + CharParameter Char when used as a parameter (historical 68K convention) + + Note: The original Macintosh toolbox in 68K Pascal defined Style as a SET. + Both Style and CHAR occupy 8-bits in packed records or 16-bits when + used as fields in non-packed records or as parameters. + +*********************************************************************************/ +struct Point { + short v; + short h; +}; +typedef struct Point Point; +typedef Point * PointPtr; +// struct Rect { +// short top; +// short left; +// short bottom; +// short right; +// }; +// typedef struct Rect Rect; +// typedef Rect * RectPtr; +struct FixedPoint { + Fixed x; + Fixed y; +}; +typedef struct FixedPoint FixedPoint; +struct FixedRect { + Fixed left; + Fixed top; + Fixed right; + Fixed bottom; +}; +typedef struct FixedRect FixedRect; + +typedef short CharParameter; +enum { + normal = 0, + bold = 1, + italic = 2, + underline = 4, + outline = 8, + shadow = 0x10, + condense = 0x20, + extend = 0x40 +}; + +// typedef unsigned char Style; +// typedef short StyleParameter; +// typedef Style StyleField; + + +/******************************************************************************** + + QuickTime TimeBase types (previously in Movies.h) + + TimeValue Count of units + TimeScale Units per second + CompTimeValue 64-bit count of units (always a struct) + TimeValue64 64-bit count of units (long long or struct) + TimeBase An opaque reference to a time base + TimeRecord Package of TimeBase, duration, and scale + +*********************************************************************************/ +typedef SInt32 TimeValue; +typedef SInt32 TimeScale; +typedef wide CompTimeValue; +typedef SInt64 TimeValue64; +typedef struct TimeBaseRecord* TimeBase; +struct TimeRecord { + CompTimeValue value; /* units (duration or absolute) */ + TimeScale scale; /* units per second */ + TimeBase base; /* refernce to the time base */ +}; +typedef struct TimeRecord TimeRecord; + +/******************************************************************************** + + THINK C base objects + + HandleObject Root class for handle based THINK C++ objects + PascalObject Root class for pascal style objects in THINK C++ + +*********************************************************************************/ +#if defined(__SC__) && !defined(__STDC__) && defined(__cplusplus) + class __machdl HandleObject {}; + #if TARGET_CPU_68K + class __pasobj PascalObject {}; + #endif +#endif + + +/******************************************************************************** + + MacOS versioning structures + + VersRec Contents of a 'vers' resource + VersRecPtr Pointer to a VersRecPtr + VersRecHndl Resource Handle containing a VersRec + NumVersion Packed BCD version representation (e.g. "4.2.1a3" is 0x04214003) + UniversalProcPtr Pointer to classic 68K code or a RoutineDescriptor + + ProcHandle Pointer to a ProcPtr + UniversalProcHandle Pointer to a UniversalProcPtr + +*********************************************************************************/ +#if TARGET_RT_BIG_ENDIAN +struct NumVersion { + /* Numeric version part of 'vers' resource */ + UInt8 majorRev; /*1st part of version number in BCD*/ + UInt8 minorAndBugRev; /*2nd & 3rd part of version number share a byte*/ + UInt8 stage; /*stage code: dev, alpha, beta, final*/ + UInt8 nonRelRev; /*revision level of non-released version*/ +}; +typedef struct NumVersion NumVersion; +#else +struct NumVersion { + /* Numeric version part of 'vers' resource accessable in little endian format */ + UInt8 nonRelRev; /*revision level of non-released version*/ + UInt8 stage; /*stage code: dev, alpha, beta, final*/ + UInt8 minorAndBugRev; /*2nd & 3rd part of version number share a byte*/ + UInt8 majorRev; /*1st part of version number in BCD*/ +}; +typedef struct NumVersion NumVersion; +#endif /* TARGET_RT_BIG_ENDIAN */ + +enum { + /* Version Release Stage Codes */ + developStage = 0x20, + alphaStage = 0x40, + betaStage = 0x60, + finalStage = 0x80 +}; + +union NumVersionVariant { + /* NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value */ + NumVersion parts; + UInt32 whole; +}; +typedef union NumVersionVariant NumVersionVariant; +typedef NumVersionVariant * NumVersionVariantPtr; +typedef NumVersionVariantPtr * NumVersionVariantHandle; +struct VersRec { + /* 'vers' resource format */ + NumVersion numericVersion; /*encoded version number*/ + short countryCode; /*country code from intl utilities*/ + Str255 shortVersion; /*version number string - worst case*/ + Str255 reserved; /*longMessage string packed after shortVersion*/ +}; +typedef struct VersRec VersRec; +typedef VersRec * VersRecPtr; +typedef VersRecPtr * VersRecHndl; +/********************************************************************************* + + Old names for types + +*********************************************************************************/ +typedef UInt8 Byte; +typedef SInt8 SignedByte; +typedef wide * WidePtr; +typedef UnsignedWide * UnsignedWidePtr; +typedef Float80 extended80; +typedef Float96 extended96; +typedef SInt8 VHSelect; +/********************************************************************************* + + Debugger functions + +*********************************************************************************/ +/* + * Debugger() + * + * Availability: + * Mac OS X: in version 10.0 and later in CoreServices.framework + * CarbonLib: in CarbonLib 1.0 and later + * Non-Carbon CFM: in InterfaceLib 7.1 and later + */ +extern void +Debugger(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); + + +/* + * DebugStr() + * + * Availability: + * Mac OS X: in version 10.0 and later in CoreServices.framework + * CarbonLib: in CarbonLib 1.0 and later + * Non-Carbon CFM: in InterfaceLib 7.1 and later + */ +extern void +DebugStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); + + +/* + * debugstr() + * + * Availability: + * Mac OS X: not available + * CarbonLib: not available + * Non-Carbon CFM: in InterfaceLib 7.1 and later + */ + + +#if TARGET_CPU_PPC +/* Only for Mac OS native drivers */ +/* + * SysDebug() + * + * Availability: + * Mac OS X: not available + * CarbonLib: not available + * Non-Carbon CFM: in DriverServicesLib 1.0 and later + */ + + +/* + * SysDebugStr() + * + * Availability: + * Mac OS X: not available + * CarbonLib: not available + * Non-Carbon CFM: in DriverServicesLib 1.0 and later + */ + + +#endif /* TARGET_CPU_PPC */ + +/* SADE break points */ +/* + * SysBreak() + * + * Availability: + * Mac OS X: in version 10.0 and later in CoreServices.framework + * CarbonLib: in CarbonLib 1.0 and later + * Non-Carbon CFM: in InterfaceLib 7.1 and later + */ +extern void +SysBreak(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); + + +/* + * SysBreakStr() + * + * Availability: + * Mac OS X: in version 10.0 and later in CoreServices.framework + * CarbonLib: in CarbonLib 1.0 and later + * Non-Carbon CFM: in InterfaceLib 7.1 and later + */ +extern void +SysBreakStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); + + +/* + * SysBreakFunc() + * + * Availability: + * Mac OS X: in version 10.0 and later in CoreServices.framework + * CarbonLib: in CarbonLib 1.0 and later + * Non-Carbon CFM: in InterfaceLib 7.1 and later + */ +extern void +SysBreakFunc(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA); + + +/* old names for Debugger and DebugStr */ +#if OLDROUTINENAMES && TARGET_CPU_68K + #define Debugger68k() Debugger() + #define DebugStr68k(s) DebugStr(s) +#endif + + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* __MACTYPES__ */ + diff --git a/www/webkit2-gtk-devel/files/file-linux-madv_free.diff b/www/webkit2-gtk-devel/files/file-linux-madv_free.diff new file mode 100644 index 000000000000..8de224d139e5 --- /dev/null +++ b/www/webkit2-gtk-devel/files/file-linux-madv_free.diff @@ -0,0 +1,15 @@ +diff --git Source/bmalloc/libpas/src/libpas/orig.pas_probabilistic_guard_malloc_allocator.c Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c +index d4e79ba..f70c3be 100644 +--- Source/bmalloc/libpas/src/libpas/orig.pas_probabilistic_guard_malloc_allocator.c ++++ Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c +@@ -114,6 +114,10 @@ pas_allocation_result pas_probabilistic_guard_malloc_allocate(pas_large_heap* la + * ensure physical addresses are released + * TODO: investigate using MADV_FREE_REUSABLE instead + */ ++#if defined(linux) && !defined(MADV_FREE) ++#warning "Defining MADV_FREE (8)" ++#define MADV_FREE 8 ++#endif + int madvise_res = madvise((void *) upper_guard_page, page_size, MADV_FREE); + PAS_ASSERT(!madvise_res); + diff --git a/www/webkit2-gtk-devel/files/patch-DateInstance-nullptr-deref.diff b/www/webkit2-gtk-devel/files/patch-DateInstance-nullptr-deref.diff new file mode 100644 index 000000000000..036c7a04e0df --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-DateInstance-nullptr-deref.diff @@ -0,0 +1,26 @@ +diff --git Source/JavaScriptCore/runtime/orig.DateInstance.cpp Source/JavaScriptCore/runtime/DateInstance.cpp +index 915854b..1b00c91 100644 +--- Source/JavaScriptCore/runtime/orig.DateInstance.cpp ++++ Source/JavaScriptCore/runtime/DateInstance.cpp +@@ -59,6 +59,10 @@ const GregorianDateTime* DateInstance::calculateGregorianDateTime(VM& vm) const + if (!m_data) + m_data = vm.dateInstanceCache.add(milli); + ++ if (!m_data) { ++ // this can happen when finishCreation() was called with time <= 0 ++ return nullptr; ++ } + if (m_data->m_gregorianDateTimeCachedForMS != milli) { + msToGregorianDateTime(vm, milli, WTF::LocalTime, m_data->m_cachedGregorianDateTime); + m_data->m_gregorianDateTimeCachedForMS = milli; +@@ -75,6 +79,10 @@ const GregorianDateTime* DateInstance::calculateGregorianDateTimeUTC(VM& vm) con + if (!m_data) + m_data = vm.dateInstanceCache.add(milli); + ++ if (!m_data) { ++ // this can happen when finishCreation() was called with time <= 0 ++ return nullptr; ++ } + if (m_data->m_gregorianDateTimeUTCCachedForMS != milli) { + msToGregorianDateTime(vm, milli, WTF::UTCTime, m_data->m_cachedGregorianDateTimeUTC); + m_data->m_gregorianDateTimeUTCCachedForMS = milli; diff --git a/www/webkit2-gtk-devel/files/patch-IPC-failure-message.diff b/www/webkit2-gtk-devel/files/patch-IPC-failure-message.diff new file mode 100644 index 000000000000..d3c2a9443c4e --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-IPC-failure-message.diff @@ -0,0 +1,13 @@ +diff --git Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp.orig Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp +index e01364f..6489537 100644 +--- Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp.orig ++++ Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp +@@ -535,7 +535,7 @@ bool Connection::sendOutputMessage(UnixMessage& outputMessage) + } + + if (m_isConnected) +- WTFLogAlways("Error sending IPC message: %s", safeStrerror(errno).data()); ++ WTFLogAlways("Error sending IPC message of length %d: %s", message.msg_iovlen, safeStrerror(errno).data()); + return false; + } + diff --git a/www/webkit2-gtk-devel/files/patch-WTF-wtf-Randomdevice.diff b/www/webkit2-gtk-devel/files/patch-WTF-wtf-Randomdevice.diff index bfd2ee910350..1d562510bd6e 100644 --- a/www/webkit2-gtk-devel/files/patch-WTF-wtf-Randomdevice.diff +++ b/www/webkit2-gtk-devel/files/patch-WTF-wtf-Randomdevice.diff @@ -1,9 +1,9 @@ -diff --git Source/WTF/wtf/RandomDevice.cpp Source/WTF/wtf/RandomDevice.cpp -index 89165f03..99251674 100644 ---- Source/WTF/wtf/RandomDevice.cpp +diff --git Source/WTF/wtf/RandomDevice.cpp.orig Source/WTF/wtf/RandomDevice.cpp +index 1e35bcd..4cac605 100644 +--- Source/WTF/wtf/RandomDevice.cpp.orig +++ Source/WTF/wtf/RandomDevice.cpp -@@ -30,7 +30,7 @@ - #include +@@ -29,7 +29,7 @@ + #include -#if !OS(DARWIN) && !OS(FUCHSIA) && OS(UNIX) @@ -11,16 +11,16 @@ index 89165f03..99251674 100644 #include #include #include -@@ -41,7 +41,7 @@ +@@ -40,7 +40,7 @@ #include // windows.h must be included before wincrypt.h. #endif -#if OS(DARWIN) +#if (0) - #include + #include #include #endif -@@ -52,7 +52,7 @@ +@@ -51,7 +51,7 @@ namespace WTF { @@ -29,7 +29,7 @@ index 89165f03..99251674 100644 NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToOpenURandom() { CRASH(); -@@ -64,7 +64,7 @@ NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToReadFromURandom() +@@ -63,7 +63,7 @@ NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToReadFromURandom() } #endif @@ -38,7 +38,7 @@ index 89165f03..99251674 100644 RandomDevice::RandomDevice() { int ret = 0; -@@ -77,7 +77,7 @@ RandomDevice::RandomDevice() +@@ -76,7 +76,7 @@ RandomDevice::RandomDevice() } #endif @@ -47,7 +47,7 @@ index 89165f03..99251674 100644 RandomDevice::~RandomDevice() { close(m_fd); -@@ -88,11 +88,11 @@ RandomDevice::~RandomDevice() +@@ -87,11 +87,11 @@ RandomDevice::~RandomDevice() // https://bugs.webkit.org/show_bug.cgi?id=170190 void RandomDevice::cryptographicallyRandomValues(unsigned char* buffer, size_t length) { diff --git a/www/webkit2-gtk-devel/files/patch-WTF-wtf-getVTablePointer.diff b/www/webkit2-gtk-devel/files/patch-WTF-wtf-getVTablePointer.diff deleted file mode 100644 index 1aae3e8c9644..000000000000 --- a/www/webkit2-gtk-devel/files/patch-WTF-wtf-getVTablePointer.diff +++ /dev/null @@ -1,37 +0,0 @@ -diff --git Source/WTF/wtf/PointerPreparations.h Source/WTF/wtf/PointerPreparations.h -index ef20a5e48512..ef9495169ff4 100644 ---- Source/WTF/wtf/PointerPreparations.h -+++ Source/WTF/wtf/PointerPreparations.h -@@ -34,16 +34,16 @@ namespace WTF { - #if COMPILER_HAS_CLANG_BUILTIN(__builtin_get_vtable_pointer) - - template --ALWAYS_INLINE void* getVTablePointer(T* o) { return __builtin_get_vtable_pointer(o); } -+ALWAYS_INLINE const void* getVTablePointer(T* o) { return __builtin_get_vtable_pointer(o); } - - #else // not COMPILER_HAS_CLANG_BUILTIN(__builtin_get_vtable_pointer) - - #if CPU(ARM64E) - template --ALWAYS_INLINE void* getVTablePointer(T* o) { return __builtin_ptrauth_auth(*(reinterpret_cast(o)), ptrauth_key_cxx_vtable_pointer, 0); } -+ALWAYS_INLINE const void* getVTablePointer(T* o) { return __builtin_ptrauth_auth(*(reinterpret_cast(o)), ptrauth_key_cxx_vtable_pointer, 0); } - #else // not CPU(ARM64E) - template --ALWAYS_INLINE void* getVTablePointer(T* o) { return (*(reinterpret_cast(o))); } -+ALWAYS_INLINE const void* getVTablePointer(T* o) { return (*(reinterpret_cast(o))); } - #endif // not CPU(ARM64E) - - #endif // not COMPILER_HAS_CLANG_BUILTIN(__builtin_get_vtable_pointer) -diff --git Source/WebCore/bindings/scripts/CodeGeneratorJS.pm Source/WebCore/bindings/scripts/CodeGeneratorJS.pm -index 35db4d28ccd6..03dd9c161a83 100644 ---- Source/WebCore/bindings/scripts/CodeGeneratorJS.pm -+++ Source/WebCore/bindings/scripts/CodeGeneratorJS.pm -@@ -4881,7 +4881,7 @@ END - push(@implContent, < 101000 + return fromMachApproximateTime(mach_approximate_time()); ++#else ++ // anything better we can do?? ++ return fromMachApproximateTime(mach_absolute_time()); ++#endif + #elif OS(LINUX) + struct timespec ts { }; + clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); diff --git a/www/webkit2-gtk-devel/files/patch-fix-jsc_jsch-include.diff b/www/webkit2-gtk-devel/files/patch-fix-jsc_jsch-include.diff new file mode 100644 index 000000000000..d83f7f441046 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-fix-jsc_jsch-include.diff @@ -0,0 +1,76 @@ +diff --git Source/WebKit/orig.PlatformGTK.cmake Source/WebKit/PlatformGTK.cmake +index e229687..c566384 100644 +--- Source/WebKit/orig.PlatformGTK.cmake ++++ Source/WebKit/PlatformGTK.cmake +@@ -241,6 +241,7 @@ list(INSERT WebKit_INCLUDE_DIRECTORIES 0 + "${WebKitGTK_FRAMEWORK_HEADERS_DIR}/webkitgtk-web-process-extension" + "${WebKitGTK_DERIVED_SOURCES_DIR}/webkit" + "${WebKitGTK_DERIVED_SOURCES_DIR}" ++ "${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}" + ) + + list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES +diff --git Tools/TestWebKitAPI/orig.PlatformGTK.cmake Tools/TestWebKitAPI/PlatformGTK.cmake +index 87c714b..72bd474 100644 +--- Tools/TestWebKitAPI/orig.PlatformGTK.cmake ++++ Tools/TestWebKitAPI/PlatformGTK.cmake +@@ -98,6 +98,7 @@ set(TestJSC_SYSTEM_INCLUDE_DIRECTORIES + set(TestJSC_PRIVATE_INCLUDE_DIRECTORIES + ${CMAKE_BINARY_DIR} + ${TESTWEBKITAPI_DIR} ++ "${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}" + "${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc" + ) + +diff --git Source/JavaScriptCore/orig.GLib.cmake Source/JavaScriptCore/GLib.cmake +index 4945542..af269c1 100644 +--- Source/JavaScriptCore/orig.GLib.cmake ++++ Source/JavaScriptCore/GLib.cmake +@@ -63,12 +63,45 @@ configure_file(API/glib/JSCVersion.h.in ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR + # These symbolic link allows includes like #include which simulates installed headers. + add_custom_command( + OUTPUT ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc +- DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib +- COMMAND ln -n -s -f ${JAVASCRIPTCORE_DIR}/API/glib ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc ++ DEPENDS ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc ++ COMMAND ln -n -s -f ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc ++ COMMENT "Installing jsc symlink" ++ VERBATIM ++) ++add_custom_command( ++ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCOptions.h ++ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCOptions.h ++ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCOptions.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCOptions.h ++ COMMENT "Installing symlink to JSCOptions.h" ++ VERBATIM ++) ++add_custom_command( ++ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCAutocleanups.h ++ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCAutocleanups.h ++ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCAutocleanups.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCAutocleanups.h ++ COMMENT "Installing symlink to JSCAutocleanups.h" ++ VERBATIM ++) ++add_custom_command( ++ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCContextPrivate.h ++ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCContextPrivate.h ++ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCContextPrivate.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCContextPrivate.h ++ COMMENT "Installing symlink to JSCContextPrivate.h" ++ VERBATIM ++) ++add_custom_command( ++ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCValuePrivate.h ++ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCValuePrivate.h ++ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCValuePrivate.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCValuePrivate.h ++ COMMENT "Installing symlink to JSCValuePrivate.h" + VERBATIM + ) + add_custom_target(JSC-fake-api-headers + DEPENDS ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc ++ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCOptions.h ++ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCAutocleanups.h ++ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCContextPrivate.h ++ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCValuePrivate.h + ) + set(JavaScriptCore_EXTRA_DEPENDENCIES + JSC-fake-api-headers diff --git a/www/webkit2-gtk-devel/files/patch-gigacage.diff b/www/webkit2-gtk-devel/files/patch-gigacage.diff new file mode 100644 index 000000000000..ccd0a88a5a23 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-gigacage.diff @@ -0,0 +1,16 @@ +diff --git Source/WTF/wtf/orig.Gigacage.h Source/WTF/wtf/Gigacage.h +index 1d4f068..2bc9d2b 100644 +--- Source/WTF/wtf/orig.Gigacage.h ++++ Source/WTF/wtf/Gigacage.h +@@ -31,6 +31,11 @@ + #if USE(SYSTEM_MALLOC) + #define GIGACAGE_ENABLED 0 + ++#if OS(DARWIN) ++#include ++#include ++#endif ++ + namespace Gigacage { + + constexpr bool hasCapacityToUseLargeGigacage = OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) > 36; diff --git a/www/webkit2-gtk-devel/files/patch-less-gcrypt-oops-msg.diff b/www/webkit2-gtk-devel/files/patch-less-gcrypt-oops-msg.diff new file mode 100644 index 000000000000..d2a08a83b431 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-less-gcrypt-oops-msg.diff @@ -0,0 +1,23 @@ +diff --git Source/WebCore/PAL/pal/crypto/gcrypt/orig.Initialization.h Source/WebCore/PAL/pal/crypto/gcrypt/Initialization.h +index ef9a09d..fab6577 100644 +--- Source/WebCore/PAL/pal/crypto/gcrypt/orig.Initialization.h ++++ Source/WebCore/PAL/pal/crypto/gcrypt/Initialization.h +@@ -37,9 +37,16 @@ static inline void initialize() + // returned version string. + gcry_check_version(nullptr); + ++ static char done = 0; ++ if (done) { ++ return; ++ } ++ + // Pre-allocate 16kB of secure memory and finish the initialization. +- gcry_control(GCRYCTL_INIT_SECMEM, 16384, nullptr); +- gcry_control(GCRYCTL_INITIALIZATION_FINISHED, nullptr); ++ if (gcry_control(GCRYCTL_INIT_SECMEM, 16384, nullptr) == 0 && ++ gcry_control(GCRYCTL_INITIALIZATION_FINISHED, nullptr) == 0) { ++ done = 1; ++ } + } + + } // namespace PAL diff --git a/www/webkit2-gtk-devel/files/patch-mach_vm.diff b/www/webkit2-gtk-devel/files/patch-mach_vm.diff new file mode 100644 index 000000000000..4be30e947cf8 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-mach_vm.diff @@ -0,0 +1,39 @@ +diff --git Source/WTF/wtf/orig.CompactPointerTuple.h Source/WTF/wtf/CompactPointerTuple.h +index 0659138..f18beb4 100644 +--- Source/WTF/wtf/orig.CompactPointerTuple.h ++++ Source/WTF/wtf/CompactPointerTuple.h +@@ -33,7 +33,7 @@ + #include + + #if OS(DARWIN) +-#include ++#include + #endif + + namespace WTF { +diff --git Source/WTF/wtf/orig.Packed.h Source/WTF/wtf/Packed.h +index 274b963..3c769bd 100644 +--- Source/WTF/wtf/orig.Packed.h ++++ Source/WTF/wtf/Packed.h +@@ -34,7 +34,7 @@ + #include + + #if OS(DARWIN) +-#include ++#include + #endif + + namespace WTF { +diff --git Source/JavaScriptCore/bytecode/orig.CodeOrigin.h Source/JavaScriptCore/bytecode/CodeOrigin.h +index 3497138..128cf9e 100644 +--- Source/JavaScriptCore/bytecode/orig.CodeOrigin.h ++++ Source/JavaScriptCore/bytecode/CodeOrigin.h +@@ -35,7 +35,7 @@ + #include + + #if OS(DARWIN) +-#include ++#include + #endif + + namespace JSC { diff --git a/www/webkit2-gtk-devel/files/patch-mactypes.diff b/www/webkit2-gtk-devel/files/patch-mactypes.diff new file mode 100644 index 000000000000..79e89cbcaca3 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-mactypes.diff @@ -0,0 +1,16 @@ +diff --git Source/JavaScriptCore/API/orig.WebKitAvailability.h Source/JavaScriptCore/API/WebKitAvailability.h +index 11e4087..4ef0b7c 100644 +--- Source/JavaScriptCore/API/orig.WebKitAvailability.h ++++ Source/JavaScriptCore/API/WebKitAvailability.h +@@ -28,6 +28,11 @@ + + #if defined(__APPLE__) + ++#if defined(BUILDING_GTK__) ++// prevent clash with old QuickDraw symbols in /usr/include/MacTypes.h ++#include ++#endif ++ + #include + #include + diff --git a/www/webkit2-gtk-devel/files/patch-minibrowser-jsc.diff b/www/webkit2-gtk-devel/files/patch-minibrowser-jsc.diff new file mode 100644 index 000000000000..b64c0fb5a87a --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-minibrowser-jsc.diff @@ -0,0 +1,23 @@ +diff --git Tools/MiniBrowser/gtk/orig.CMakeLists.txt Tools/MiniBrowser/gtk/CMakeLists.txt +index 2f4f61f..9498326 100644 +--- Tools/MiniBrowser/gtk/orig.CMakeLists.txt ++++ Tools/MiniBrowser/gtk/CMakeLists.txt +@@ -26,6 +26,7 @@ set(MiniBrowser_PRIVATE_INCLUDE_DIRECTORIES + ${WebKitGtk_FRAMEWORK_HEADERS_DIR} + ${WebKitGtk_FRAMEWORK_HEADERS_DIR}/webkitgtk-${WEBKITGTK_API_VERSION} + ${CMAKE_SOURCE_DIR}/Source ++ ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR} + ) + + set(MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES +@@ -33,6 +34,10 @@ set(MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES + ${LIBSOUP_INCLUDE_DIRS} + ) + ++if ((NOT JavaScriptCore_LIBRARY_NAME) OR (JavaScriptCore_LIBRARY_NAME STREQUAL "")) ++ set(JavaScriptCore_LIBRARY_NAME "${CMAKE_BINARY_DIR}/lib/libjavascriptcoregtk-@API@.@SHEXT@") ++ message(WARNING "JavaScriptCore_LIBRARY_NAME not set") ++endif() + set(MiniBrowser_PRIVATE_LIBRARIES + ${GLIB_LIBRARIES} + ${JavaScriptCore_LIBRARY_NAME} diff --git a/www/webkit2-gtk-devel/files/patch-no-cocoa-headers.diff b/www/webkit2-gtk-devel/files/patch-no-cocoa-headers.diff new file mode 100644 index 000000000000..bdd87190bb96 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-no-cocoa-headers.diff @@ -0,0 +1,37 @@ +diff --git Source/WebKit/Platform/IPC/orig.ArgumentCoders.h Source/WebKit/Platform/IPC/ArgumentCoders.h +index b861420..465d9c0 100644 +--- Source/WebKit/Platform/IPC/orig.ArgumentCoders.h ++++ Source/WebKit/Platform/IPC/ArgumentCoders.h +@@ -43,7 +43,7 @@ + #include + #include + +-#if OS(DARWIN) ++#if PLATFORM(COCOA) + #include "ArgumentCodersDarwin.h" + #endif + #if OS(WINDOWS) +diff --git Source/WebKit/Platform/IPC/orig.Connection.h Source/WebKit/Platform/IPC/Connection.h +index 80ec279..8368202 100644 +--- Source/WebKit/Platform/IPC/orig.Connection.h ++++ Source/WebKit/Platform/IPC/Connection.h +@@ -57,8 +57,10 @@ + #include + #include + #include ++#if PLATFORM(COCOA) + #include + #endif ++#endif + + #if OS(WINDOWS) + #include +@@ -199,7 +201,7 @@ public: + #endif + }; + +-#if OS(DARWIN) ++#if PLATFORM(COCOA) + xpc_connection_t xpcConnection() const { return m_xpcConnection.get(); } + std::optional getAuditToken(); + pid_t remoteProcessID() const; diff --git a/www/webkit2-gtk-devel/files/patch-no-machsendright.diff b/www/webkit2-gtk-devel/files/patch-no-machsendright.diff new file mode 100644 index 000000000000..b0cf7a06a7e0 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-no-machsendright.diff @@ -0,0 +1,74 @@ +diff --git Source/WebKit/Platform/IPC/orig.Attachment.h Source/WebKit/Platform/IPC/Attachment.h +index 95689ca..a5e85f2 100644 +--- Source/WebKit/Platform/IPC/orig.Attachment.h ++++ Source/WebKit/Platform/IPC/Attachment.h +@@ -26,24 +26,22 @@ + + #pragma once + +-#if OS(DARWIN) +-#include +-#endif +- + #if USE(UNIX_DOMAIN_SOCKETS) + #include ++#elif OS(DARWIN) ++#include + #endif + + namespace IPC { + + // IPC::Attachment is a type representing objects that cannot be transferred as data, + // rather they are transferred via operating system cross-process communication primitives. +-#if OS(DARWIN) ++#if USE(UNIX_DOMAIN_SOCKETS) ++using Attachment = UnixFileDescriptor; ++#elif OS(DARWIN) + using Attachment = MachSendRight; + #elif OS(WINDOWS) + using Attachment = int; // Windows does not need attachments at the moment. +-#elif USE(UNIX_DOMAIN_SOCKETS) +-using Attachment = UnixFileDescriptor; + #else + #error Unsupported platform + #endif +diff --git Source/WebKit/Platform/orig.SharedMemory.h Source/WebKit/Platform/SharedMemory.h +index bddc0d2..3cbfbc5 100644 +--- Source/WebKit/Platform/orig.SharedMemory.h ++++ Source/WebKit/Platform/SharedMemory.h +@@ -37,7 +37,7 @@ + #include + #endif + +-#if OS(DARWIN) ++#if PLATFORM(COCOA) + #include + #endif + +@@ -85,7 +85,7 @@ public: + private: + #if USE(UNIX_DOMAIN_SOCKETS) + mutable UnixFileDescriptor m_handle; +-#elif OS(DARWIN) ++#elif PLATFORM(COCOA) + mutable MachSendRight m_handle; + #elif OS(WINDOWS) + mutable Win32Handle m_handle; +@@ -132,7 +132,7 @@ public: + Ref createSharedBuffer(size_t) const; + + private: +-#if OS(DARWIN) ++#if PLATFORM(COCOA) + WTF::MachSendRight createSendRight(Protection) const; + #endif + +@@ -145,7 +145,7 @@ private: + #if USE(UNIX_DOMAIN_SOCKETS) + UnixFileDescriptor m_fileDescriptor; + bool m_isWrappingMap { false }; +-#elif OS(DARWIN) ++#elif PLATFORM(COCOA) + MachSendRight m_sendRight; + #elif OS(WINDOWS) + Win32Handle m_handle; diff --git a/www/webkit2-gtk-devel/files/patch-reduce-mem-overheads-linux.diff b/www/webkit2-gtk-devel/files/patch-reduce-mem-overheads-linux.diff new file mode 100644 index 000000000000..65ff0406ac58 --- /dev/null +++ b/www/webkit2-gtk-devel/files/patch-reduce-mem-overheads-linux.diff @@ -0,0 +1,21 @@ +From: Alberto Garcia +Subject: Reduce memory usage when not using the Gold linker +Bug-Debian: https://bugs.debian.org/949621 +Forwarded: no +Index: webkitgtk/Source/cmake/OptionsCommon.cmake +=================================================================== +--- Source/cmake/OptionsCommon.cmake ++++ Source/cmake/OptionsCommon.cmake +@@ -112,6 +112,12 @@ if (DEBUG_FISSION) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index") + endif () + ++# Pass --reduce-memory-overheads to the bfd linker in order to save memory ++if (NOT USE_LD_GOLD) ++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads") ++ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads") ++endif () ++ + # Enable the usage of OpenMP. + # - At this moment, OpenMP is only used as an alternative implementation + # to native threads for the parallelization of the SVG filters. diff --git a/www/webkit2-gtk-devel/files/patch-source-wtf-wtf-unix-cputimeunix-cpp-darwin-version-restore.diff b/www/webkit2-gtk-devel/files/patch-source-wtf-wtf-unix-cputimeunix-cpp-darwin-version-restore.diff index 47be9329e9b9..0ea6f77ffb1f 100644 --- a/www/webkit2-gtk-devel/files/patch-source-wtf-wtf-unix-cputimeunix-cpp-darwin-version-restore.diff +++ b/www/webkit2-gtk-devel/files/patch-source-wtf-wtf-unix-cputimeunix-cpp-darwin-version-restore.diff @@ -1,10 +1,10 @@ -diff --git Source/WTF/wtf/unix/CPUTimeUnix.cpp Source/WTF/wtf/unix/CPUTimeUnix.cpp -index 27990893..fe279865 100644 ---- Source/WTF/wtf/unix/CPUTimeUnix.cpp -+++ Source/WTF/wtf/unix/CPUTimeUnix.cpp -@@ -26,6 +26,68 @@ +diff --git Source/WTF/wtf/posix/orig.CPUTimePOSIX.cpp Source/WTF/wtf/posix/CPUTimePOSIX.cpp +index beeb3e8..fd16889 100644 +--- Source/WTF/wtf/posix/orig.CPUTimePOSIX.cpp ++++ Source/WTF/wtf/posix/CPUTimePOSIX.cpp +@@ -26,6 +26,67 @@ #include "config.h" - #include "CPUTime.h" + #include +#if OS(DARWIN) +#import @@ -14,8 +14,6 @@ index 27990893..fe279865 100644 +#import +#import + -+#include -+ +namespace WTF { + +static const int64_t microsecondsPerSecond = 1000000; @@ -28,14 +26,14 @@ index 27990893..fe279865 100644 + return result; +} + -+Optional CPUTime::get() ++std::optional CPUTime::get() +{ + // Account for current threads. + task_thread_times_info threadInfoData; + mach_msg_type_number_t threadInfoCount = TASK_THREAD_TIMES_INFO_COUNT; + kern_return_t result = task_info(mach_task_self(), TASK_THREAD_TIMES_INFO, reinterpret_cast(&threadInfoData), &threadInfoCount); + if (result != KERN_SUCCESS) -+ return nullopt; ++ return std::nullopt; + + int64_t userTime = timeValueToMicroseconds(threadInfoData.user_time); + int64_t systemTime = timeValueToMicroseconds(threadInfoData.system_time); @@ -45,7 +43,7 @@ index 27990893..fe279865 100644 + mach_msg_type_number_t taskInfoCount = TASK_BASIC_INFO_COUNT; + result = task_info(mach_task_self(), TASK_BASIC_INFO, reinterpret_cast(&taskInfoData), &taskInfoCount); + if (result != KERN_SUCCESS) -+ return nullopt; ++ return std::nullopt; + + userTime += timeValueToMicroseconds(taskInfoData.user_time); + systemTime += timeValueToMicroseconds(taskInfoData.system_time); @@ -66,14 +64,14 @@ index 27990893..fe279865 100644 +} + +} ++ +#else //OS(DARWIN) + #include #include #include -@@ -54,3 +114,4 @@ Seconds CPUTime::forCurrentThread() +@@ -54,3 +115,4 @@ Seconds CPUTime::forCurrentThread() } } -+#endif //OS(DARWIN) -\ No newline at end of file ++#endif //DARWIN diff --git a/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-os-log-availability.diff b/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-os-log-availability.diff index 9c12d69184d4..15be848cee14 100644 --- a/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-os-log-availability.diff +++ b/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-os-log-availability.diff @@ -20,3 +20,115 @@ index c26815d3..b07914be 100644 if (__builtin_available(macOS 10.12, iOS 10.0, *)) { os_log_type_t apple_log_type = OS_LOG_TYPE_DEFAULT; +diff --git Source/WTF/wtf/orig.OSLogPrintStream.h Source/WTF/wtf/OSLogPrintStream.h +index d08d57a..ee0e1c1 100644 +--- Source/WTF/wtf/orig.OSLogPrintStream.h ++++ Source/WTF/wtf/OSLogPrintStream.h +@@ -25,7 +25,7 @@ + + #pragma once + +-#if OS(DARWIN) ++#if OS(DARWIN) + + #include + #include +@@ -33,7 +33,24 @@ + #include + #include + ++#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200 + #include ++#else ++ ++// Make this a dummy class ++ ++struct os_log_s { ++ int dum; ++}; ++typedef struct os_log_s* os_log_t; ++typedef enum { ++ OS_LOG_TYPE_DEFAULT = (uint8_t) 0x00, ++ OS_LOG_TYPE_INFO = (uint8_t) 0x01, ++ OS_LOG_TYPE_DEBUG = (uint8_t) 0x02, ++ OS_LOG_TYPE_ERROR = (uint8_t) 0x10, ++ OS_LOG_TYPE_FAULT = (uint8_t) 0x11 ++} os_log_type_t; ++#endif + + namespace WTF { + +@@ -49,10 +66,14 @@ public: + private: + os_log_t m_log; + os_log_type_t m_logType; ++#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200 + Lock m_stringLock; + // We need a buffer because os_log doesn't wait for a new line to print the characters. + CString m_string WTF_GUARDED_BY_LOCK(m_stringLock); + size_t m_offset { 0 }; ++#else ++ CString m_string; ++#endif + }; + + } // namespace WTF +diff --git Source/WTF/wtf/orig.OSLogPrintStream.cpp Source/WTF/wtf/OSLogPrintStream.cpp +index f1f1544..3a02387 100644 +--- Source/WTF/wtf/orig.OSLogPrintStream.cpp ++++ Source/WTF/wtf/OSLogPrintStream.cpp +@@ -28,7 +28,11 @@ + + namespace WTF { + +-#if OS(DARWIN) ++#if OS(DARWIN) ++ ++#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101200 ++#include ++#endif + + OSLogPrintStream::OSLogPrintStream(os_log_t log, os_log_type_t logType) + : m_log(log) +@@ -42,14 +46,22 @@ OSLogPrintStream::~OSLogPrintStream() + + std::unique_ptr OSLogPrintStream::open(const char* subsystem, const char* category, os_log_type_t logType) + { ++#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200 + os_log_t log = os_log_create(subsystem, category); ++#else ++ os_log_t log = nullptr; ++#endif + return makeUnique(log, logType); + } + + void OSLogPrintStream::vprintf(const char* format, va_list argList) + { ++#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200 + Locker lock { m_stringLock }; + size_t offset = m_offset; ++#else ++ size_t offset = 0; ++#endif + size_t freeBytes = m_string.length() - offset; + va_list backup; + va_copy(backup, argList); +@@ -62,6 +74,7 @@ void OSLogPrintStream::vprintf(const char* format, va_list argList) + ASSERT(bytesWritten < freeBytes); + } + ++#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200 + size_t newOffset = offset + bytesWritten; + char* buffer = m_string.mutableData(); + bool loggedText = false; +@@ -81,6 +94,10 @@ void OSLogPrintStream::vprintf(const char* format, va_list argList) + if (loggedText) + memmove(m_string.mutableData(), buffer, newOffset); + m_offset = newOffset; ++#else ++ fprintf(stderr, "%s", m_string.mutableData()); ++ fflush(stderr); ++#endif + } + + #endif diff --git a/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-unprotected-egl-changes.diff b/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-unprotected-egl-changes.diff index 9fa21bde3ff1..9a8c7d23d4cd 100644 --- a/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-unprotected-egl-changes.diff +++ b/www/webkit2-gtk-devel/files/patch-webkit2gtk-2282-unprotected-egl-changes.diff @@ -59,3 +59,15 @@ index ad632205..29a9eace 100644 template<> GRefPtr adoptGRef(GstMiniObject* ptr); template<> GstMiniObject* refGPtr(GstMiniObject* ptr); +@@ -162,9 +162,11 @@ template<> GRefPtr adoptGRef(GstGLContext* ptr); + template<> GstGLContext* refGPtr(GstGLContext* ptr); + template<> void derefGPtr(GstGLContext* ptr); + ++#if USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF) + template<> GRefPtr adoptGRef(GstEGLImage* ptr); + template<> GstEGLImage* refGPtr(GstEGLImage* ptr); + template<> void derefGPtr(GstEGLImage* ptr); ++#endif + + template<> GRefPtr adoptGRef(GstGLColorConvert* ptr); + template<> GstGLColorConvert* refGPtr(GstGLColorConvert* ptr); diff --git a/www/webkit2-gtk-devel/files/patch-webkit2gtk-macports.diff b/www/webkit2-gtk-devel/files/patch-webkit2gtk-macports.diff index b9b80fe5596b..1a583e5db84d 100644 --- a/www/webkit2-gtk-devel/files/patch-webkit2gtk-macports.diff +++ b/www/webkit2-gtk-devel/files/patch-webkit2gtk-macports.diff @@ -181,8 +181,21 @@ index 00000000..cf113819 - uint64_t totalVideoFrames = 0; - uint64_t droppedVideoFrames = 0; -+ guint64_t totalVideoFrames = 0; -+ guint64_t droppedVideoFrames = 0; ++ guint64 totalVideoFrames = 0; ++ guint64 droppedVideoFrames = 0; if (webkitGstCheckVersion(1, 18, 0)) { GUniqueOutPtr stats; g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr); +diff --git Source/WebCore/platform/graphics/gstreamer/mse/orig.WebKitMediaSourceGStreamer.cpp Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp +index 9596674..0ac9983 100644 +--- Source/WebCore/platform/graphics/gstreamer/mse/orig.WebKitMediaSourceGStreamer.cpp ++++ Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp +@@ -737,7 +737,7 @@ static gboolean webKitMediaSrcSendEvent(GstElement* element, GstEvent* event) + double rate; + GstFormat format; + GstSeekType startType; +- int64_t start; ++ gint64 start; + gst_event_parse_seek(event, &rate, &format, nullptr, &startType, &start, nullptr, nullptr); + if (format != GST_FORMAT_TIME || startType != GST_SEEK_TYPE_SET) { + GST_ERROR_OBJECT(element, "Rejecting unsupported seek event: %" GST_PTR_FORMAT, event); diff --git a/www/webkit2-gtk-devel/files/prefer-pthread.patch b/www/webkit2-gtk-devel/files/prefer-pthread.patch new file mode 100644 index 000000000000..8214a86bd8a6 --- /dev/null +++ b/www/webkit2-gtk-devel/files/prefer-pthread.patch @@ -0,0 +1,28 @@ +From: Alberto Garcia +Description: Enable THREADS_PREFER_PTHREAD_FLAG + This fixes a FTBFS in riscv64 +Bug: https://bugs.webkit.org/show_bug.cgi?id=182622 +Bug-Debian: https://bugs.debian.org/895969 +Origin: https://trac.webkit.org/changeset/231843 +Index: webkitgtk/Source/cmake/OptionsGTK.cmake +=================================================================== +--- Source/cmake/OptionsGTK.cmake ++++ Source/cmake/OptionsGTK.cmake +@@ -17,6 +17,8 @@ set(WEBKITGTK_HEADER_INSTALL_DIR "${CMAK + set(INTROSPECTION_INSTALL_GIRDIR "${CMAKE_INSTALL_FULL_DATADIR}/gir-1.0") + set(INTROSPECTION_INSTALL_TYPELIBDIR "${LIB_INSTALL_DIR}/girepository-1.0") + ++set(THREADS_PREFER_PTHREAD_FLAG ON) ++ + find_package(Cairo 1.14.0 REQUIRED) + find_package(Fontconfig 2.8.0 REQUIRED) + find_package(Freetype 2.4.2 REQUIRED) +Index: webkitgtk/Source/cmake/OptionsJSCOnly.cmake +=================================================================== +--- Source/cmake/OptionsJSCOnly.cmake ++++ Source/cmake/OptionsJSCOnly.cmake +@@ -1,3 +1,4 @@ ++set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + + if (MSVC)