WebKit Bugzilla
Attachment 342652 Details for
Bug 186547
: [WPE] Build getUserMedia support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186547-20180613095649.patch (text/plain), 81.73 KB, created by
Thibault Saunier
on 2018-06-13 06:56:51 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Thibault Saunier
Created:
2018-06-13 06:56:51 PDT
Size:
81.73 KB
patch
obsolete
>Subversion Revision: 232730 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d8ff6a3d010b9bbf291d9f6785a4c6d9ad60eb6e..896803e14d82d2f5394f578397ffdd4c96f85127 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2018-06-13 Thibault Saunier <tsaunier@igalia.com> >+ >+ [WPE] Build getUserMedia support >+ https://bugs.webkit.org/show_bug.cgi?id=186547 >+ >+ Reviewed by Alejandro G. Castro. >+ >+ Enable mediastream tests. >+ >+ * PlatformWPE.cmake: Build MediaStream support. >+ * SourcesGTK.txt: Moved GStreamer related files to GStreamer.cmake. >+ * SourcesWPE.txt: Removed `platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp` >+ which is now in GStreamer.cmake. >+ * platform/GStreamer.cmake: Build more MediaStream/webrtc related files. >+ * platform/graphics/ImageBuffer.cpp: Handle the fact that toBGRAData is >+ now built directly into the Cairo backend and not GTK anymore. >+ * platform/graphics/cairo/ImageBufferCairo.cpp: Implement `toBGRAData` >+ * platform/graphics/gtk/ImageBufferGtk.cpp: Removed `toBGRAData` as it is >+ now implemented in the Cairo backend itself. >+ * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Switch an >+ ASSERT to RELEASE_ASSERT when adding the GhostPad to itself. This was making >+ test fail when built in RELEASE mode. >+ (WebCore::webkitMediaStreamSrcChain): Minor variable name change to make it >+ more accurate. >+ (WebCore::webkitMediaStreamSrcAddPad): Now add the ghost pad to the element >+ before setting its chain function, making things clearer. >+ (WebCore::webkitMediaStreamSrcSetupSrc): Remove extra new line. >+ > 2018-06-11 Chris Dumez <cdumez@apple.com> > > http/tests/security/cors-post-redirect-307.html fails with PSON enabled >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9409aebcd213dc08bae5cd0937dba63768d7215d..2b87ce6ccc244dda6f8a6f15aa96933bd3bb344a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,12 @@ >+2018-06-13 Thibault Saunier <tsaunier@igalia.com> >+ >+ [WPE] Build getUserMedia support >+ https://bugs.webkit.org/show_bug.cgi?id=186547 >+ >+ Reviewed by Alejandro G. Castro. >+ >+ * SourcesWPE.txt: Compile files necessary for MediaStream/webrtc. >+ > 2018-06-11 Chris Dumez <cdumez@apple.com> > > http/tests/security/cors-post-redirect-307.html fails with PSON enabled >diff --git a/Source/WebCore/PlatformWPE.cmake b/Source/WebCore/PlatformWPE.cmake >index b18b79449161ebd59695db29743c7502a5f896e9..eaa89124fedab571cc5f78f86efabbcaa8694778 100644 >--- a/Source/WebCore/PlatformWPE.cmake >+++ b/Source/WebCore/PlatformWPE.cmake >@@ -27,6 +27,7 @@ list(APPEND WebCore_INCLUDE_DIRECTORIES > "${WEBCORE_DIR}/platform/graphics/wpe" > "${WEBCORE_DIR}/platform/graphics/wayland" > "${WEBCORE_DIR}/platform/mock/mediasource" >+ "${WEBCORE_DIR}/platform/mediastream/gstreamer" > "${WEBCORE_DIR}/platform/network/soup" > "${WEBCORE_DIR}/platform/text/icu" > ) >diff --git a/Source/WebCore/SourcesGTK.txt b/Source/WebCore/SourcesGTK.txt >index 92acd0bcafd6e0abd65ef4f65eb94564199cf85a..4626b6fcbe54a495ed10c6bb82449a0497622773 100644 >--- a/Source/WebCore/SourcesGTK.txt >+++ b/Source/WebCore/SourcesGTK.txt >@@ -92,14 +92,6 @@ platform/gtk/PasteboardGtk.cpp > platform/gtk/ScrollAnimatorGtk.cpp > platform/gtk/SelectionData.cpp > >-platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp >-platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp >-platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp >-platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp >- >-platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp >-platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp >- > platform/text/Hyphenation.cpp > platform/text/LocaleICU.cpp > >diff --git a/Source/WebCore/SourcesWPE.txt b/Source/WebCore/SourcesWPE.txt >index fc0019b53ba585ef0923718d7d74b70991b6a516..5e8502f86ede559b936a7774bfe7b564d1746987 100644 >--- a/Source/WebCore/SourcesWPE.txt >+++ b/Source/WebCore/SourcesWPE.txt >@@ -64,8 +64,6 @@ platform/graphics/wpe/IconWPE.cpp > platform/graphics/wpe/ImageWPE.cpp > platform/graphics/wpe/PlatformDisplayWPE.cpp > >-platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp >- > platform/text/Hyphenation.cpp > platform/text/LocaleICU.cpp > >diff --git a/Source/WebCore/platform/GStreamer.cmake b/Source/WebCore/platform/GStreamer.cmake >index 50b2d207c6cea4659143a0c4d89d8d4901b6803f..f911d3b71d4558eb22bcba227df36ec827fb689d 100644 >--- a/Source/WebCore/platform/GStreamer.cmake >+++ b/Source/WebCore/platform/GStreamer.cmake >@@ -34,6 +34,9 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO) > platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp > platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp > >+ platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp >+ platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp >+ > platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp > platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp > platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp >@@ -43,7 +46,11 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO) > platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp > platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp > platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp >+ platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp >+ platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp > platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp >+ platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp >+ platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp > ) > > list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES >diff --git a/Source/WebCore/platform/graphics/ImageBuffer.cpp b/Source/WebCore/platform/graphics/ImageBuffer.cpp >index ef4c1bd18bd598c63d0b8e4dcca261dbe87a04f9..97ba1ea1b9460e95c437f9a66922b74fe0ef1e8d 100644 >--- a/Source/WebCore/platform/graphics/ImageBuffer.cpp >+++ b/Source/WebCore/platform/graphics/ImageBuffer.cpp >@@ -102,7 +102,7 @@ FloatRect ImageBuffer::clampedRect(const FloatRect& rect) > return FloatRect(rect.location(), clampedSize(rect.size())); > } > >-#if !USE(CG) && !PLATFORM(GTK) >+#if !USE(CG) && !USE(CAIRO) > Vector<uint8_t> ImageBuffer::toBGRAData() const > { > // FIXME: Implement this for other backends. >diff --git a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp >index 856707f0bfa1dfc394df2ca23cffaddf1869d41c..89a41f1f578aff6b72b69de24647fb5e74ef207e 100644 >--- a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp >@@ -204,6 +204,41 @@ void ImageBufferData::createCairoGLSurface() > } > #endif > >+static RefPtr<cairo_surface_t> >+cairoSurfaceCoerceToImage(cairo_surface_t* surface) >+{ >+ if (cairo_surface_get_type(surface) == CAIRO_SURFACE_TYPE_IMAGE >+ && cairo_surface_get_content(surface) == CAIRO_CONTENT_COLOR_ALPHA) >+ return surface; >+ >+ auto copy = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, >+ cairo_image_surface_get_width(surface), >+ cairo_image_surface_get_height(surface))); >+ >+ auto cr = adoptRef(cairo_create(copy.get())); >+ cairo_set_operator(cr.get(), CAIRO_OPERATOR_SOURCE); >+ cairo_set_source_surface(cr.get(), surface, 0, 0); >+ cairo_paint(cr.get()); >+ >+ return copy; >+} >+ >+Vector<uint8_t> ImageBuffer::toBGRAData() const >+{ >+ auto surface = cairoSurfaceCoerceToImage(m_data.m_surface.get()); >+ cairo_surface_flush(surface.get()); >+ >+ Vector<uint8_t> imageData; >+ if (cairo_surface_status(surface.get())) >+ return imageData; >+ >+ auto pixels = cairo_image_surface_get_data(surface.get()); >+ imageData.append(pixels, cairo_image_surface_get_stride(surface.get()) * >+ cairo_image_surface_get_height(surface.get())); >+ >+ return imageData; >+} >+ > ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace, RenderingMode renderingMode, const HostWindow*, bool& success) > : m_data(IntSize(size), renderingMode) > , m_logicalSize(size) >diff --git a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >index ed3a11f913badad95b3ba433626e9703b156e87d..8e6095c9ac8023453aa16ed5546878f494fdf441 100644 >--- a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >+++ b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp >@@ -87,16 +87,6 @@ String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> qual > return "data:" + mimeType + ";base64," + base64Data; > } > >-Vector<uint8_t> ImageBuffer::toBGRAData() const >-{ >- auto pixbuf = adoptGRef(cairoSurfaceToGdkPixbuf(m_data.m_surface.get())); >- auto pixels = gdk_pixbuf_get_pixels(pixbuf.get()); >- >- Vector<uint8_t> imageData; >- imageData.append(pixels, gdk_pixbuf_get_byte_length(pixbuf.get())); >- return imageData; >-} >- > Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double> quality) const > { > ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); >diff --git a/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp b/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp >index dba1ae6320f8a954ca3956e2e3cbc727c622a259..711d32fa2fae498ca264514f495ce36fbcf79b40 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp >+++ b/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp >@@ -328,10 +328,10 @@ typedef struct { > GstStaticPadTemplate* pad_template; > } ProbeData; > >-static GstFlowReturn webkitMediaStreamSrcChain(GstPad* pad, GstObject* object, GstBuffer* buffer) >+static GstFlowReturn webkitMediaStreamSrcChain(GstPad* pad, GstObject* parent, GstBuffer* buffer) > { > GstFlowReturn result; >- GRefPtr<WebKitMediaStreamSrc> self = adoptGRef(WEBKIT_MEDIA_STREAM_SRC(gst_object_get_parent(object))); >+ GRefPtr<WebKitMediaStreamSrc> self = adoptGRef(WEBKIT_MEDIA_STREAM_SRC(gst_object_get_parent(parent))); > > result = gst_flow_combiner_update_pad_flow(self.get()->flowCombiner, pad, > gst_proxy_pad_chain_default(pad, GST_OBJECT(self.get()), buffer)); >@@ -350,10 +350,16 @@ static void webkitMediaStreamSrcAddPad(WebKitMediaStreamSrc* self, GstPad* targe > target); > > auto proxypad = adoptGRef(GST_PAD(gst_proxy_pad_get_internal(GST_PROXY_PAD(ghostpad)))); >+ gst_pad_set_active(ghostpad, TRUE); >+ if (!gst_element_add_pad(GST_ELEMENT(self), GST_PAD(ghostpad))) { >+ GST_ERROR_OBJECT(self, "Could not add pad %s:%s", GST_DEBUG_PAD_NAME(ghostpad)); >+ ASSERT_NOT_REACHED(); >+ >+ return; >+ } >+ > gst_pad_set_chain_function(proxypad.get(), > static_cast<GstPadChainFunction>(webkitMediaStreamSrcChain)); >- gst_pad_set_active(ghostpad, TRUE); >- ASSERT(gst_element_add_pad(GST_ELEMENT(self), GST_PAD(ghostpad))); > } > > static GstPadProbeReturn webkitMediaStreamSrcPadProbeCb(GstPad* pad, GstPadProbeInfo* info, ProbeData* data) >@@ -399,7 +405,6 @@ static gboolean webkitMediaStreamSrcSetupSrc(WebKitMediaStreamSrc* self, > > gst_bin_add(GST_BIN(self), element); > >- > ProbeData* data = new ProbeData; > data->self = WEBKIT_MEDIA_STREAM_SRC(self); > data->pad_template = pad_template; >diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt >index d3f886ffdd267b9e9b4dc268338931d1b7369555..47a2dcde138b74597e100638289d4094a55a5139 100644 >--- a/Source/WebKit/SourcesWPE.txt >+++ b/Source/WebKit/SourcesWPE.txt >@@ -37,6 +37,11 @@ NetworkProcess/soup/NetworkProcessSoup.cpp > NetworkProcess/soup/NetworkSessionSoup.cpp > NetworkProcess/soup/RemoteNetworkingContextSoup.cpp > >+NetworkProcess/webrtc/LibWebRTCSocketClient.cpp >+NetworkProcess/webrtc/NetworkRTCMonitor.cpp >+NetworkProcess/webrtc/NetworkRTCProvider.cpp >+NetworkProcess/webrtc/NetworkRTCSocket.cpp >+ > Platform/IPC/glib/GSocketMonitor.cpp > > Platform/IPC/unix/AttachmentUnix.cpp >diff --git a/Source/WebKit/UIProcess/ChildProcessProxy.cpp b/Source/WebKit/UIProcess/ChildProcessProxy.cpp >index bdff583d3b1b92240f272775e14b03ecc017e40e..9e3d39db5ff35760ae3392b21f8bd7c9ffa4675d 100644 >--- a/Source/WebKit/UIProcess/ChildProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/ChildProcessProxy.cpp >@@ -75,6 +75,8 @@ void ChildProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchO > case ProcessLauncher::ProcessType::Storage: > varname = "STORAGE_PROCESS_CMD_PREFIX"; > break; >+ default: >+ ASSERT_NOT_REACHED(); > } > const char* processCmdPrefix = getenv(varname); > if (processCmdPrefix && *processCmdPrefix) >diff --git a/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp b/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp >index 7a39f5b1aea9336d42a5cf215b10ed6c92335e44..326ae2a749e9047f6c0944e2c0640bd73c48f73d 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp >@@ -88,8 +88,8 @@ PluginProcessProxy::~PluginProcessProxy() > > void PluginProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions) > { >- ChildProcessProxy::getLaunchOptions(launchOptions); > platformGetLaunchOptions(launchOptions, m_pluginProcessAttributes); >+ ChildProcessProxy::getLaunchOptions(launchOptions); > } > > void PluginProcessProxy::processWillShutDown(IPC::Connection& connection) >diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake >index 10e156c967fc57efecd66186109e71ca0d12ce19..8c7ad9c5d18de628e8c62313bb85b6cf1a6d8fbb 100644 >--- a/Source/cmake/OptionsWPE.cmake >+++ b/Source/cmake/OptionsWPE.cmake >@@ -40,6 +40,8 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SERVICE_WORKER PRIVATE ${ENABLE_EXPERIME > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SMOOTH_SCROLLING PRIVATE OFF) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PRIVATE ON) > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL2 PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) >+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_STREAM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) >+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) > > # Public options specific to the WPE port. Do not add any options here unless > # there is a strong reason we should support changing the value of the option, >@@ -48,6 +50,9 @@ WEBKIT_OPTION_DEFINE(USE_WOFF2 "Whether to enable support for WOFF2 Web Fonts." > > # Private options specific to the WPE port. > WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) >+WEBKIT_OPTION_DEFINE(USE_LIBWEBRTC "Whether to use libwebrtc for WebRTC support" PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) >+ >+WEBKIT_OPTION_DEPEND(USE_LIBWEBRTC ENABLE_WEB_RTC) > > if (CMAKE_SYSTEM_NAME MATCHES "Linux") > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON) >@@ -110,6 +115,12 @@ if (ENABLE_XSLT) > find_package(LibXslt 1.1.7 REQUIRED) > endif () > >+if (ENABLE_MEDIA_STREAM OR ENABLE_WEB_RTC) >+ set(USE_LIBWEBRTC TRUE) >+ SET_AND_EXPOSE_TO_BUILD(USE_LIBWEBRTC TRUE) >+ SET_AND_EXPOSE_TO_BUILD(WEBRTC_WEBKIT_BUILD TRUE) >+endif () >+ > add_definitions(-DBUILDING_WPE__=1) > add_definitions(-DGETTEXT_PACKAGE="WPE") > add_definitions(-DJSC_GLIB_API_ENABLED) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 9e5de992cc073bd87b55c163e3d575ae9137c555..6f8487c3f21e97a24f8c04e399de98402bb2bb75 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2018-04-11 Thibault Saunier <tsaunier@igalia.com> >+ >+ webkitpy: Implement coredumpctl support on linux >+ https://bugs.webkit.org/show_bug.cgi?id=184039 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ And start using an Executive to run subprocesses >+ in GDBCrashLogGenerator. >+ >+ Unit tests adapted to the new API and still passing. >+ >+ * Scripts/webkitpy/port/linux_get_crash_log.py: >+ (GDBCrashLogGenerator): >+ (GDBCrashLogGenerator._get_trace_from_systemd): >+ (GDBCrashLogGenerator.generate_crash_log): >+ > 2018-06-11 Chris Dumez <cdumez@apple.com> > > Allow enabling PSON in layout tests without window.open support >diff --git a/Tools/Scripts/build-webkit-flatpak b/Tools/Scripts/build-webkit-flatpak >new file mode 100755 >index 0000000000000000000000000000000000000000..480e696ef79970354f23d0d233fd715c80ba1eff >--- /dev/null >+++ b/Tools/Scripts/build-webkit-flatpak >@@ -0,0 +1,731 @@ >+#!/usr/bin/env python3 >+# Copyright (c) 2018, Thibault Saunier <tsaunier@igalia.com> >+# >+# This program is free software; you can redistribute it and/or >+# modify it under the terms of the GNU Lesser General Public >+# License as published by the Free Software Foundation; either >+# version 2.1 of the License, or (at your option) any later version. >+# >+# This program is distributed in the hope that it will be useful, >+# but WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+# Lesser General Public License for more details. >+# >+# You should have received a copy of the GNU Lesser General Public >+# License along with this program; if not, write to the >+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, >+# Boston, MA 02110-1301, USA. >+# pylint: disable=missing-docstring,invalid-name >+ >+import argparse >+import configparser >+import glob >+import json >+import os >+import shlex >+import shutil >+import subprocess >+import sys >+import tempfile >+import venv >+import re >+import fileinput >+import pickle >+ >+try: >+ import yaml >+except ModuleNotFoundError: >+ print("PyYaml not found, please install it before continuing") >+ yaml = None >+ sys.exit(1) >+ >+from urllib.parse import urlparse >+from urllib.request import urlretrieve >+from enum import Enum >+ >+FLATPAK_REQ = [ >+ ("flatpak", "0.10.0"), >+ ("flatpak-builder", "0.10.0"), >+] >+ >+scriptdir = os.path.abspath(os.path.dirname(__file__)) >+ >+ >+class Colors(Enum): >+ HEADER = "\033[95m" >+ OKBLUE = "\033[94m" >+ OKGREEN = "\033[92m" >+ WARNING = "\033[93m" >+ FAIL = "\033[91m" >+ ENDC = "\033[0m" >+ >+ >+class Console: # pylint: disable=too-few-public-methods >+ >+ quiet = False >+ >+ @classmethod >+ def message(cls, str_format, *args): >+ if cls.quiet: >+ return >+ >+ if args: >+ print(str_format % args) >+ else: >+ print(str_format) >+ >+ # Flush so that messages are printed at the right time >+ # as we use many subprocesses. >+ sys.stdout.flush() >+ >+ >+def remove_extension_points(array): >+ result_args = [] >+ for arg in array: >+ if(not arg.startswith('--extension')): >+ result_args.append(arg) >+ return result_args >+ >+ >+def remove_comments(string): >+ pattern = r"(\".*?\"|\'.*?\')|(/\*.*?\*/|//[^\r\n]*$)" >+ # first group captures quoted strings (double or single) >+ # second group captures comments (//single-line or /* multi-line */) >+ regex = re.compile(pattern, re.MULTILINE | re.DOTALL) >+ >+ def _replacer(match): >+ # if the 2nd group (capturing comments) is not None, >+ # it means we have captured a non-quoted (real) comment string. >+ if match.group(2) is not None: >+ return "" # so we will return empty to remove the comment >+ else: # otherwise, we will return the 1st group >+ return match.group(1) # captured quoted-string >+ return regex.sub(_replacer, string) >+ >+ >+def load_manifest(manifest_path, port_name=None, command=None): >+ is_yaml = manifest_path.endswith('.yaml') >+ if is_yaml and not yaml: >+ print("Trying to load a yaml manifest but python 'yaml' is not installed") >+ >+ return False >+ >+ with open(manifest_path, "r") as mr: >+ contents = mr.read() >+ >+ contents = contents % {"COMMAND": command, "PORTNAME": port_name} >+ if is_yaml: >+ manifest = yaml.load(contents) >+ else: >+ contents = remove_comments(contents) >+ manifest = json.loads(contents) >+ >+ return manifest >+ >+ >+def expand_manifest(manifest_path, outfile, port_name, source_root, command): >+ """Creates the manifest file.""" >+ try: >+ os.remove(outfile) >+ except FileNotFoundError: >+ pass >+ >+ manifest = load_manifest(manifest_path, port_name, command) >+ if not manifest: >+ return False >+ >+ if "sdk-hash" in manifest: >+ del manifest["sdk-hash"] >+ if "runtime-hash" in manifest: >+ del manifest["runtime-hash"] >+ i = 0 >+ all_modules = [] >+ >+ overriden_modules = [] >+ if "WEBKIT_EXTRA_MODULESETS" in os.environ: >+ overriden_modules = load_manifest(os.environ["WEBKIT_EXTRA_MODULESETS"]) >+ for modules in manifest["modules"]: >+ submanifest_path = None >+ if type(modules) is str: >+ submanifest_path = os.path.join(os.path.dirname(manifest_path), modules) >+ modules = load_manifest(submanifest_path, port_name, command) >+ >+ if not isinstance(modules, list): >+ modules = [modules] >+ >+ for module in modules: >+ for overriden_module in overriden_modules: >+ if module['name'] == overriden_module['name']: >+ module = overriden_module >+ overriden_modules.remove(module) >+ break >+ >+ all_modules.append(module) >+ >+ # And add overriden modules right before the webkit port build def. >+ for overriden_module in overriden_modules: >+ all_modules.insert(-1, overriden_modules) >+ >+ manifest["modules"] = all_modules >+ for module in manifest["modules"]: >+ submanifest_path = None >+ if module["sources"][0]["type"] == "git": >+ if port_name == module["name"]: >+ repo = "file://" + source_root >+ module["sources"][0]["url"] = repo >+ >+ for source in module["sources"]: >+ if source["type"] == "patch" or source["type"] == "file": >+ if(submanifest_path is not None): >+ source["path"] = os.path.join(os.path.dirname(submanifest_path), source["path"]) >+ else: >+ source["path"] = os.path.join(os.path.dirname(manifest_path), source["path"]) >+ i += 1 >+ >+ with open(outfile, "w") as of: >+ print(json.dumps(manifest, indent=4), file=of) >+ >+ return True >+ >+ >+class FlatpakObject: # pylint: disable=too-few-public-methods >+ >+ def __init__(self, user): >+ self.user = user >+ >+ def flatpak(self, command, *args, show_output=False, comment=None): >+ if comment: >+ Console.message(comment) >+ >+ command = ["flatpak", command] >+ if self.user: >+ res = subprocess.check_output(command + ["--help"]).decode("utf-8") >+ if "--user" in res: >+ command.append("--user") >+ command.extend(args) >+ >+ if not show_output: >+ return subprocess.check_output(command).decode("utf-8") >+ >+ return subprocess.check_call(command) >+ >+ >+class FlatpakPackages(FlatpakObject): # pylint: disable=too-few-public-methods >+ >+ def __init__(self, repos, user=True): >+ FlatpakObject.__init__(self, user=user) >+ >+ self.repos = repos >+ >+ self.runtimes = self.__detect_runtimes() >+ self.apps = self.__detect_apps() >+ self.packages = self.runtimes + self.apps >+ >+ def __detect_packages(self, *args): >+ packs = [] >+ package_defs = [rd >+ for rd in self.flatpak("list", "-d", *args).split("\n") >+ if rd] >+ for package_def in package_defs: >+ splited_packaged_def = package_def.split() >+ name, arch, branch = splited_packaged_def[0].split("/") >+ >+ # If installed from a file, the package is in no repo >+ repo_name = splited_packaged_def[1] >+ repo = self.repos.repos.get(repo_name) >+ >+ packs.append(FlatpakPackage(name, branch, repo, arch)) >+ >+ return packs >+ >+ def __detect_runtimes(self): >+ return self.__detect_packages("--runtime") >+ >+ def __detect_apps(self): >+ return self.__detect_packages() >+ >+ def __iter__(self): >+ for package in self.packages: >+ yield package >+ >+ >+class FlatpakRepos(FlatpakObject): >+ >+ def __init__(self, user=True): >+ FlatpakObject.__init__(self, user=user) >+ self.repos = {} >+ self.update() >+ >+ def update(self): >+ self.repos = {} >+ remotes = [row >+ for row in self.flatpak("remote-list", "-d").split("\n") >+ if row] >+ for repo in remotes: >+ for components in [repo.split(" "), repo.split("\t")]: >+ if len(components) == 1: >+ components = repo.split("\t") >+ name = components[0] >+ desc = "" >+ url = None >+ for elem in components[1:]: >+ if not elem: >+ continue >+ parsed_url = urlparse(elem) >+ if parsed_url.scheme: >+ url = elem >+ break >+ >+ if desc: >+ desc += " " >+ desc += elem >+ >+ if url: >+ break >+ >+ if not url: >+ Console.message("No valid URI found for: %s", repo) >+ continue >+ >+ self.repos[name] = FlatpakRepo(name, url, desc, repos=self) >+ >+ self.packages = FlatpakPackages(self) >+ >+ def add(self, repo, override=True): >+ same_name = None >+ for name, tmprepo in self.repos.items(): >+ if repo.url == tmprepo.url: >+ return tmprepo >+ elif repo.name == name: >+ same_name = tmprepo >+ >+ if same_name: >+ if override: >+ self.flatpak("remote-modify", repo.name, "--url=" + repo.url, >+ comment="Setting repo %s URL from %s to %s" >+ % (repo.name, same_name.url, repo.url)) >+ same_name.url = repo.url >+ >+ return same_name >+ else: >+ return None >+ else: >+ self.flatpak("remote-add", repo.name, "--from", repo.repo_file.name, >+ "--if-not-exists", >+ comment="Adding repo %s" % repo.name) >+ >+ repo.repos = self >+ return repo >+ >+ >+class FlatpakRepo(FlatpakObject): # pylint: disable=too-few-public-methods >+ >+ def __init__(self, name, desc=None, url=None, # pylint: disable=too-many-arguments >+ repo_file=None, user=True, repos=None): >+ FlatpakObject.__init__(self, user=user) >+ >+ self.name = name >+ self.url = url >+ self.desc = desc >+ self.repo_file_name = repo_file >+ self._repo_file = None >+ self.repos = repos >+ assert name >+ if repo_file and not url: >+ repo = configparser.ConfigParser() >+ repo.read(self.repo_file.name) >+ self.url = repo["Flatpak Repo"]["Url"] >+ else: >+ assert url >+ >+ @property >+ def repo_file(self): >+ if self._repo_file: >+ return self._repo_file >+ >+ assert self.repo_file_name >+ self._repo_file = tempfile.NamedTemporaryFile(mode="w") >+ urlretrieve(self.repo_file_name, self._repo_file.name) >+ >+ return self._repo_file >+ >+ >+class FlatpakPackage(FlatpakObject): >+ """A flatpak app.""" >+ >+ def __init__(self, name, branch, repo, arch, user=True, hash=None): # pylint: disable=too-many-arguments >+ FlatpakObject.__init__(self, user=user) >+ >+ self.name = name >+ self.branch = str(branch) >+ self.repo = repo >+ self.arch = arch >+ self.hash = hash >+ >+ def __str__(self): >+ return "%s/%s/%s %s" % (self.name, self.arch, self.branch, self.repo.name) >+ >+ def is_installed(self, branch): >+ if not self.repo: >+ # Bundle installed from file >+ return True >+ >+ self.repo.repos.update() >+ for package in self.repo.repos.packages: >+ if package.name == self.name and \ >+ package.branch == branch and \ >+ package.arch == self.arch: >+ return True >+ >+ return False >+ >+ def install(self): >+ if not self.repo: >+ return False >+ >+ self.flatpak("install", self.repo.name, self.name, "--reinstall", >+ self.branch, show_output=True, >+ comment="Installing from " + self.repo.name + " " + >+ self.name + " " + self.arch + " " + self.branch) >+ >+ def update(self): >+ if not self.is_installed(self.branch): >+ return self.install() >+ >+ extra_args = [] >+ comment = "Updating %s" % self.name >+ if self.hash: >+ extra_args = ["--commit", self.hash] >+ comment += " to %s" % self.hash >+ >+ self.flatpak("update", self.name, self.branch, show_output=True, >+ *extra_args, comment=comment) >+ >+ >+class FlatpakModule(FlatpakObject): >+ >+ def __init__(self, flatpak_app, manifest_path, module_name, >+ debug, cmakeargs, makeargs): >+ self.flatpak_app = flatpak_app >+ >+ manifest = load_manifest(manifest_path) >+ if not manifest: >+ exit(1) >+ >+ for module in manifest["modules"]: >+ if module["name"] == module_name: >+ break >+ self.source_path = module["sources"][0]["url"] >+ assert urlparse(self.source_path).scheme == "file" >+ self.source_path = urlparse(self.source_path).path >+ self.build_system = module.get("buildsystem", "autotools") >+ self.config_options = module.get("config-opts", []) >+ self.make_args = module.get("make-args", []) >+ self.make_install_args = module.get("make-install-args", []) >+ self.use_builddir = module.get("builddir", "false") >+ self.build_commands = module.get("build-commands", []) >+ self.debug = debug >+ self.cmakeargs = cmakeargs >+ self.makeargs = makeargs >+ >+ def install_file(self, **kwargs): >+ return "echo \"install %(src)s %(dest)s\"\ninstall -D %(src)s %(dest)s\npatchelf --remove-rpath %(dest)s 2>&1 |grep -v \"not an ELF\" || true\n" % (kwargs) >+ >+ def run(self, builddir): >+ for command in self.build_commands: >+ command = shlex.split(command) >+ if self.debug: >+ command.append('--debug') >+ else: >+ command.append('--release') >+ if self.cmakeargs: >+ command.append('--cmakeargs=' + self.cmakeargs) >+ if self.makeargs: >+ command.append('--makeargs=' + self.makeargs) >+ self.flatpak_app.run_in_sandbox(*command, exit_on_failure=True, >+ cwd=self.source_path) >+ >+class FlatpakDev: # pylint: disable=too-many-instance-attributes >+ >+ def __init__(self): >+ self.sdk_repo = None >+ self.runtime = None >+ self.locale = None >+ self.sdk = None >+ self.sdk_debug = None >+ self.app = None >+ >+ self.quiet = False >+ self.packs = [] >+ self.update = False >+ self.args = [] >+ self.finish_args = None >+ >+ self.debug = False >+ self.gtk = False >+ self.wpe = True >+ self.clean = False >+ self.run_tests = False >+ self.source_root = os.path.abspath(os.path.join(scriptdir, '../../')) >+ # Where the source folder is mounted inside the sandbox. >+ self.sandbox_source_root = "/app/webkit" >+ >+ self.sdk_branch = None >+ self.port = "WPE" >+ self.manifest_path = None >+ self.name = None >+ self.build_name = None >+ self.flatpak_root_path = None >+ self.cache_path = None >+ self.app_module = None >+ self.flatpak_default_args = [] >+ >+ # Default application to run in the sandbox >+ self.command = None >+ >+ # Extra build options >+ self.cmakeargs = "" >+ self.makeargs = "" >+ >+ def check_flatpak(self): >+ for app, version in FLATPAK_REQ: >+ try: >+ output = subprocess.check_output([app, "--version"]) >+ except FileNotFoundError: >+ Console.message("\n%sYou need to install %s >= %s" >+ " to be able to use the '%s' script.\n\n" >+ "You can find some informations about" >+ " how to install it for your distribution at:\n" >+ " * http://flatpak.org/%s\n", Colors.FAIL, >+ app, version, sys.argv[0], Colors.ENDC) >+ exit(1) >+ >+ def comparable_version(version): >+ return [int(number) for number in version.split(".")] >+ >+ version = output.decode("utf-8").split(" ")[1].strip("\n") >+ if comparable_version(version) < comparable_version(version): >+ Console.message("\n%s%s %s required but %s found." >+ " Please update and try again%s\n", Colors.FAIL, >+ app, version, version, Colors.ENDC) >+ exit(1) >+ >+ def clean_args(self): >+ if self.gtk: >+ self.port = 'GTK' >+ >+ self.command = "%s %s %s" % (os.path.join(self.sandbox_source_root, >+ "Tools/Scripts/run-minibrowser"), >+ "--gtk" if self.gtk else "--wpe", >+ " --debug" if self.debug else " --release") >+ >+ self.name = "org.webkit.%s" % self.port >+ self.manifest_path = os.path.abspath(os.path.join(scriptdir, '../flatpak/org.webkit.WebKit.yaml')) >+ self.build_name = self.name + "-generated" >+ >+ build_root = os.path.join(self.source_root, 'WebKitBuild') >+ self.flatpak_build_path = os.path.join(build_root, self.port, "FlatpakTree") >+ self.cache_path = os.path.join(build_root, "FlatpakCache") >+ self.build_path = os.path.join(build_root, self.port, "Debug" if self.debug else "Release") >+ os.makedirs(self.build_path, exist_ok=True) >+ >+ Console.quiet = self.quiet >+ self.check_flatpak() >+ >+ repos = FlatpakRepos() >+ self.sdk_repo = repos.add( >+ FlatpakRepo("flathub", >+ url="https://dl.flathub.org/repo/", >+ repo_file="https://dl.flathub.org/repo/flathub.flatpakrepo")) >+ >+ manifest = load_manifest(self.manifest_path) >+ if not manifest: >+ exit(1) >+ >+ self.sdk_branch = manifest["runtime-version"] >+ self.finish_args = manifest.get("finish-args", []) >+ self.finish_args = remove_extension_points(self.finish_args) >+ self.runtime = FlatpakPackage("org.gnome.Platform", self.sdk_branch, >+ self.sdk_repo, "x86_64", >+ hash=manifest.get("runtime-hash")) >+ self.locale = FlatpakPackage("org.gnome.Platform.Locale", >+ self.sdk_branch, self.sdk_repo, "x86_64") >+ self.sdk = FlatpakPackage("org.gnome.Sdk", self.sdk_branch, >+ self.sdk_repo, "x86_64", >+ hash=manifest.get("sdk-hash")) >+ self.packs = [self.runtime, self.locale, self.sdk] >+ >+ if self.debug: >+ self.sdk_debug = FlatpakPackage("org.gnome.Sdk.Debug", self.sdk_branch, >+ self.sdk_repo, "x86_64") >+ self.packs.append(self.sdk_debug) >+ self.manifest_generated_path = os.path.join(self.cache_path, >+ self.build_name + ".json") >+ >+ def run_in_sandbox(self, *args, exit_on_failure=False, cwd=None): >+ sandbox_build_path = os.path.join(self.sandbox_source_root, "WebKitBuild", >+ "Debug" if self.debug else "Release") >+ with tempfile.NamedTemporaryFile(mode="w") as tmpscript: >+ flatpak_command = ["flatpak", "build", >+ "--bind-mount=%s=%s" % (tempfile.gettempdir(), tempfile.gettempdir()), >+ "--bind-mount=%s=%s" % (self.sandbox_source_root, self.source_root), >+ # We mount WebKitBuild/PORTNAME/BuildType to /app/webkit/WebKitBuild/BuildType >+ # so we can build WPE and GTK in a same source tree. >+ "--bind-mount=%s=%s" % (sandbox_build_path, self.build_path)] >+ >+ forwarded = { >+ "WEBKIT_TOP_LEVEL": "/app/", >+ "TEST_RUNNER_INJECTED_BUNDLE_FILENAME": "/app/webkit/lib/libTestRunnerInjectedBundle.so", >+ } >+ >+ for envvar, value in os.environ.items(): >+ if envvar.split("_")[0] in ("GST", "GTK", "G") or \ >+ envvar in ["WAYLAND_DISPLAY", "DISPLAY", "LANG"]: >+ forwarded[envvar] = value >+ >+ for envvar, value in forwarded.items(): >+ flatpak_command.append("--env=%s=%s" % (envvar, value)) >+ >+ flatpak_command += self.finish_args + [self.flatpak_build_path] >+ >+ shell_string = "" >+ if args: >+ if cwd: >+ shell_string = 'cd %s && %s' % (cwd, ' '.join(args)) >+ else: >+ shell_string = '%s' % (' '.join(args)) >+ else: >+ shell_string = self.command >+ >+ print(shell_string, file=tmpscript) >+ tmpscript.flush() >+ >+ flatpak_command.extend(['sh', tmpscript.name]) >+ Console.message("Running in sandbox: %s %s" %(' '.join(flatpak_command), shell_string)) >+ >+ try: >+ subprocess.check_call(flatpak_command) >+ except subprocess.CalledProcessError as e: >+ if exit_on_failure: >+ exit(e.returncode) >+ >+ def run(self): >+ if self.clean: >+ if os.path.exists(self.flatpak_build_path): >+ shutil.rmtree(self.flatpak_build_path) >+ if self.update: >+ if not self.no_flatpak_update: >+ self.update_all() >+ >+ self.setup_dev_env() >+ >+ def setup_dev_env(self): >+ if not os.path.exists(self.flatpak_build_path) or self.update: >+ self.install_all() >+ Console.message("Building %s %s and dependencies in %s", >+ self.name, self.branch, self.flatpak_build_path) >+ >+ # Create environment dirs if necessary >+ os.makedirs(os.path.dirname(self.manifest_generated_path), exist_ok=True) >+ if not expand_manifest(self.manifest_path, self.manifest_generated_path, >+ self.name, self.sandbox_source_root, self.command): >+ exit(1) >+ >+ builder_args = ["flatpak-builder", "--disable-rofiles-fuse", "--state-dir", >+ self.cache_path, "--ccache", self.flatpak_build_path, "--force-clean", >+ self.manifest_generated_path] >+ builder_args.append("--build-only") >+ builder_args.append("--stop-at=%s" % self.name) >+ >+ try: >+ subprocess.check_call(["flatpak-builder", "--version"]) >+ except FileNotFoundError: >+ Console.message("\n%sYou need to install flatpak-builder%s\n", >+ Colors.FAIL, Colors.ENDC) >+ exit(1) >+ subprocess.check_call(builder_args) >+ >+ self.build_app = True >+ >+ >+ if self.build_app: >+ if not expand_manifest(self.manifest_path, self.manifest_generated_path, >+ self.name, self.sandbox_source_root, self.command): >+ exit(1) >+ self.app_module = FlatpakModule(self, self.manifest_generated_path, self.name, >+ self.debug, self.cmakeargs, self.makeargs) >+ self.app_module.run(self.cache_path) >+ else: >+ Console.message("Using %s prefix in %s", self.name, self.flatpak_build_path) >+ >+ if self.run_tests: >+ test_launcher = [os.path.join(self.sandbox_source_root, 'Tools/Scripts/run-webkit-tests'), >+ "--debug" if self.debug else "--release", '--' + self.port.lower()] + self.args >+ self.run_in_sandbox(*test_launcher, exit_on_failure=True) >+ elif not self.update and not (self.build_app and not self.args): >+ self.run_in_sandbox(*self.args, exit_on_failure=True) >+ >+ def install_all(self): >+ for package in self.packs: >+ if not package.is_installed(self.sdk_branch): >+ package.install() >+ >+ def update_all(self): >+ for m in [self.runtime, self.sdk, self.sdk_debug]: >+ if m: >+ m.update() >+ >+if __name__ == "__main__": >+ flatpak_dev = FlatpakDev() >+ >+ parser = argparse.ArgumentParser(prog="flatpak-dev") >+ >+ general = parser.add_argument_group("General") >+ general.add_argument("--debug", >+ help="Compile with Debug configuration, also installs Sdk debug symboles.", >+ action="store_true") >+ general.add_argument("--gtk", dest="gtk", >+ action="store_true", >+ help="Build the GTK+ port") >+ general.add_argument("--wpe", dest="wpe", >+ action="store_true", >+ help="Build the WPE port", >+ default=True) >+ general.add_argument("-nf", "--no-flatpak-update", dest="no_flatpak_update", >+ action="store_true", >+ help="Do not update flaptak runtime/sdk") >+ general.add_argument("-u", "--update", dest="update", >+ action="store_true", >+ help="Update the runtime/sdk/app and rebuild the development environment if needed") >+ general.add_argument("-b", "--build-app", dest="build_app", >+ action="store_true", >+ help="Force rebuilding the app.") >+ general.add_argument("-q", "--quiet", dest="quiet", >+ action="store_true", >+ help="Do not print anything") >+ general.add_argument("args", >+ nargs=argparse.REMAINDER, >+ help="Arguments passed when starting %s or, if -d is " >+ "passed, the command to run" % flatpak_dev.name) >+ general.add_argument("--name", dest="name", >+ help="The name of the component to develop", >+ default=flatpak_dev.name) >+ general.add_argument("-t", "--run-tests", dest="run_tests", >+ action="store_true", >+ help="Run LayoutTests") >+ >+ buildoptions = parser.add_argument_group("Extra build arguments") >+ buildoptions.add_argument("--makeargs", help="Optional Makefile flags") >+ buildoptions.add_argument("--cmakeargs", >+ help="One or more optional CMake flags (e.g. --cmakeargs=\"-DFOO=bar -DCMAKE_PREFIX_PATH=/usr/local\")") >+ >+ general.add_argument("--branch", dest="branch", >+ help="The flatpak branch to use (stable, master...)", >+ default="master") >+ general.add_argument("-c", "--clean", dest="clean", >+ action="store_true", >+ help="Clean previous builds and restart from scratch") >+ >+ parser.parse_args(namespace=flatpak_dev) >+ flatpak_dev.clean_args() >+ flatpak_dev.run() >\ No newline at end of file >diff --git a/Tools/Scripts/webkitpy/port/base.py b/Tools/Scripts/webkitpy/port/base.py >index 0a83813a81834e4ea83c590f46ceefbb736bb04b..c8218194de7359461e3090182a44be513ebf96d9 100644 >--- a/Tools/Scripts/webkitpy/port/base.py >+++ b/Tools/Scripts/webkitpy/port/base.py >@@ -1219,7 +1219,7 @@ class Port(object): > This is needed only by ports that use the apache_http_server module.""" > # The Apache binary path can vary depending on OS and distribution > # See http://wiki.apache.org/httpd/DistrosDefaultLayout >- for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]: >+ for path in ["/usr/sbin/httpd", "/usr/sbin/apache2", "/app/bin/httpd"]: > if self._filesystem.exists(path): > return path > _log.error("Could not find apache. Not installed or unknown path.") >@@ -1282,6 +1282,8 @@ class Port(object): > return 'debian-httpd-' + self._apache_version() + self._debian_php_version() + '.conf' > if self._is_arch_based(): > return 'archlinux-httpd.conf' >+ if sys_platform == 'linux2': >+ return 'flatpak-httpd.conf' > # All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and prior, which we no longer support). > return 'apache' + self._apache_version() + '-httpd.conf' > >diff --git a/Tools/Scripts/webkitpy/port/gtk.py b/Tools/Scripts/webkitpy/port/gtk.py >index dc7b0fe84f1fd9adda2215d2659bf758ee049d07..4e55cd80d665721bad32049cb065adaa5744d7e2 100644 >--- a/Tools/Scripts/webkitpy/port/gtk.py >+++ b/Tools/Scripts/webkitpy/port/gtk.py >@@ -122,6 +122,7 @@ class GtkPort(Port): > environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so') > environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('lib', 'plugins') > self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR') >+ self._copy_value_from_environ_if_set(environment, 'WEBKIT_TOP_LEVEL') > self._copy_value_from_environ_if_set(environment, 'USE_PLAYBIN3') > self._copy_value_from_environ_if_set(environment, 'GST_DEBUG') > self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_DUMP_DOT_DIR') >@@ -227,7 +228,8 @@ class GtkPort(Port): > return super(GtkPort, self).check_sys_deps(needs_http) and self._driver_class().check_driver(self) > > def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None): >- return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr) >+ return GDBCrashLogGenerator(self._executive, name, pid, newer_than, >+ self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr) > > def test_expectations_file_position(self): > # GTK port baseline search path is gtk -> wk2 -> generic (as gtk-wk2 and gtk baselines are merged), so port test expectations file is at third to last position. >diff --git a/Tools/Scripts/webkitpy/port/linux_get_crash_log.py b/Tools/Scripts/webkitpy/port/linux_get_crash_log.py >index d597024b723372738162af2f4db44f4a5d44d122..2e4594e0321fd273bf27e94db10e09c55d5f8c2e 100644 >--- a/Tools/Scripts/webkitpy/port/linux_get_crash_log.py >+++ b/Tools/Scripts/webkitpy/port/linux_get_crash_log.py >@@ -27,28 +27,68 @@ > # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > >-import subprocess >+import datetime > import os >+import re >+import shutil >+import subprocess >+import tempfile >+import time >+ >+from webkitpy.common.system.executive import ScriptError > > > class GDBCrashLogGenerator(object): >- def __init__(self, name, pid, newer_than, filesystem, path_to_driver): >+ >+ def __init__(self, executive, name, pid, newer_than, filesystem, path_to_driver): > self.name = name > self.pid = pid > self.newer_than = newer_than > self._filesystem = filesystem > self._path_to_driver = path_to_driver >+ self._executive = executive > > def _get_gdb_output(self, coredump_path): > process_name = self._filesystem.join(os.path.dirname(str(self._path_to_driver())), self.name) > cmd = ['gdb', '-ex', 'thread apply all bt 1024', '--batch', process_name, coredump_path] >- proc = subprocess.Popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) >+ proc = self._executive.popen(cmd, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) > stdout, stderr = proc.communicate() > errors = [stderr_line.strip().decode('utf8', 'ignore') for stderr_line in stderr.splitlines()] > if proc.returncode != 0: > stdout = ('ERROR: The gdb process exited with non-zero return code %s\n\n' % proc.returncode) + stdout > return (stdout.decode('utf8', 'ignore'), errors) > >+ def _get_trace_from_systemd(self, coredumpctl, pid): >+ # Letting up to 5 seconds for the backtrace to be generated on the systemd side >+ for try_number in range(5): >+ if try_number != 0: >+ # Looping, it means we consider the logs might not be ready yet. >+ time.sleep(1) >+ >+ try: >+ info = self._executive.run_command(coredumpctl + ['info', "--since=" + time.strftime("%a %Y-%m-%d %H:%M:%S %Z", time.localtime(self.newer_than))], >+ return_stderr=True) >+ except ScriptError, OSError: >+ continue >+ >+ found_newer = False >+ # Coredumpctl will use the latest core dump with the specified PID >+ # assume it is the right one. >+ pids = re.findall(r'PID: (\d+) \(.*\)', info) >+ if not pids: >+ print(self.name + "\n" + info) >+ continue >+ >+ pid = pids[0] >+ >+ temp_file = tempfile.NamedTemporaryFile() >+ if self._executive.run_command(coredumpctl + ['dump', pid, '--output', temp_file.name], return_exit_code=True): >+ continue >+ >+ return self._get_gdb_output(temp_file.name) >+ >+ return '', [] >+ > def generate_crash_log(self, stdout, stderr): > pid_representation = str(self.pid or '<unknown>') > log_directory = os.environ.get("WEBKIT_CORE_DUMPS_DIRECTORY") >@@ -62,17 +102,29 @@ class GDBCrashLogGenerator(object): > return filename == expected_crash_dump_filename > return filename.find(self.name) > -1 > >+ # Poor man which, ignore any failure. >+ for coredumpctl in [['coredumpctl'], ['flatpak-spawn', '--host', 'coredumpctl'], []]: >+ try: >+ if not self._executive.run_command(coredumpctl, return_exit_code=True): >+ break >+ except: >+ continue >+ > if log_directory: >- dumps = self._filesystem.files_under(log_directory, file_filter=match_filename) >+ dumps = self._filesystem.files_under( >+ log_directory, file_filter=match_filename) > if dumps: > # Get the most recent coredump matching the pid and/or process name. > coredump_path = list(reversed(sorted(dumps)))[0] > if not self.newer_than or self._filesystem.mtime(coredump_path) > self.newer_than: > crash_log, errors = self._get_gdb_output(coredump_path) >+ elif coredumpctl: >+ crash_log, errors = self._get_trace_from_systemd(coredumpctl, pid_representation) > > stderr_lines = errors + str(stderr or '<empty>').decode('utf8', 'ignore').splitlines() > errors_str = '\n'.join(('STDERR: ' + stderr_line) for stderr_line in stderr_lines) >- cppfilt_proc = subprocess.Popen(['c++filt', ], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) >+ cppfilt_proc = self._executive.popen( >+ ['c++filt'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) > errors_str = cppfilt_proc.communicate(errors_str)[0] > > if not crash_log: >diff --git a/Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py b/Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py >index cbd431a92f844d06e2113d47f2ee34781ae845d0..9f3b7e39379c43a105ece20c1ca626243dfa7d34 100644 >--- a/Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py >+++ b/Tools/Scripts/webkitpy/port/linux_get_crash_log_unittest.py >@@ -31,8 +31,10 @@ import os > import sys > import unittest > >-from webkitpy.port.linux_get_crash_log import GDBCrashLogGenerator >+from webkitpy.common.system.executive_mock import MockExecutive >+from webkitpy.common.system.executive_mock import MockProcess > from webkitpy.common.system.filesystem_mock import MockFileSystem >+from webkitpy.port.linux_get_crash_log import GDBCrashLogGenerator > > > class GDBCrashLogGeneratorTest(unittest.TestCase): >@@ -41,7 +43,10 @@ class GDBCrashLogGeneratorTest(unittest.TestCase): > if sys.platform.startswith('win'): > return > >- generator = GDBCrashLogGenerator('DumpRenderTree', 28529, newer_than=None, filesystem=MockFileSystem({'/path/to/coredumps': ''}), path_to_driver=None) >+ executive = MockExecutive() >+ executive._proc = MockProcess() >+ executive._proc.stdout = 'STDERR: <empty>' >+ generator = GDBCrashLogGenerator(executive, 'DumpRenderTree', 28529, newer_than=None, filesystem=MockFileSystem({'/path/to/coredumps': ''}), path_to_driver=None) > > core_directory = os.environ.get('WEBKIT_CORE_DUMPS_DIRECTORY', '/path/to/coredumps') > core_pattern = generator._filesystem.join(core_directory, "core-pid_%p.dump") >diff --git a/Tools/Scripts/webkitpy/port/wpe.py b/Tools/Scripts/webkitpy/port/wpe.py >index f439bd9a13deee0ffb99f379dfca889e63609d70..4c4e23d75420c04e4579b42239de9d4ace018db3 100644 >--- a/Tools/Scripts/webkitpy/port/wpe.py >+++ b/Tools/Scripts/webkitpy/port/wpe.py >@@ -76,6 +76,12 @@ class WPEPort(Port): > environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so') > environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('lib', 'plugins') > environment['WEBKIT_EXEC_PATH'] = self._build_path('bin') >+ self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR') >+ self._copy_value_from_environ_if_set(environment, 'WEBKIT_TOP_LEVEL') >+ self._copy_value_from_environ_if_set(environment, 'USE_PLAYBIN3') >+ self._copy_value_from_environ_if_set(environment, 'GST_DEBUG') >+ self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_DUMP_DOT_DIR') >+ self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_FILE') > return environment > > def check_sys_deps(self, needs_http): >@@ -107,4 +113,4 @@ class WPEPort(Port): > return 2 > > def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None): >- return GDBCrashLogGenerator(name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr) >+ return GDBCrashLogGenerator(self._executive, name, pid, newer_than, self._filesystem, self._path_to_driver).generate_crash_log(stdout, stderr) >diff --git a/Tools/flatpak/files/httpd-autogen.sh b/Tools/flatpak/files/httpd-autogen.sh >new file mode 100755 >index 0000000000000000000000000000000000000000..6a0a473a82532ca9c95cd42d0c6f7fd4378b1898 >--- /dev/null >+++ b/Tools/flatpak/files/httpd-autogen.sh >@@ -0,0 +1 @@ >+autoreconf >\ No newline at end of file >diff --git a/Tools/flatpak/org.webkit.GTK.yaml b/Tools/flatpak/org.webkit.GTK.yaml >new file mode 100644 >index 0000000000000000000000000000000000000000..bf78b4a5d64dee824e04309b0ee49310fad73cad >--- /dev/null >+++ b/Tools/flatpak/org.webkit.GTK.yaml >@@ -0,0 +1,60 @@ >+- name: webkitgtk-test-fonts >+ no-autogen: true >+ sources: >+ - type: git >+ url: https://github.com/WebKitGTK/webkitgtk-test-fonts.git >+ buildsystem: simple >+ build-commands: >+ # FIXME: Make ActivateFontWPE smarter. >+ - make install DESTDIR=/app/WebKitBuild/DependenciesGTK/Root >+ >+- name: xorg-util-macros >+ sources: >+ - type: git >+ url: https://anongit.freedesktop.org/git/xorg/util/macros.git >+ branch: util-macros-1.19.2 >+ >+- name: xorg-font-util >+ sources: >+ - type: git >+ url: https://anongit.freedesktop.org/git/xorg/font/util.git >+ branch: font-util-1.3.1 >+ >+- name: xkbfile >+ sources: >+ - type: git >+ branch: libxkbfile-1.0.9 >+ url: https://anongit.freedesktop.org/git/xorg/lib/libxkbfile.git >+ >+- name: fontenc >+ sources: >+ - type: git >+ branch: libfontenc-1.1.3 >+ url: https://anongit.freedesktop.org/git/xorg/lib/libfontenc.git >+ >+- name: xfont >+ sources: >+ - type: git >+ branch: libXfont2-2.0.3 >+ url: https://anongit.freedesktop.org/git/xorg/lib/libXfont.git >+ >+- name: xvfb >+ sources: >+ - type: git >+ url: https://anongit.freedesktop.org/git/xorg/xserver.git >+ branch: xorg-server-1.19.6 >+ - type: patch >+ path: patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch >+ config-opts: >+ - --enable-xvfb >+ - --disable-xwayland >+ >+- name: org.webkit.GTK >+ sources: >+ - type: git >+ url: https://github.com/WebKit/WebKit.git >+ branch: mediastream-minus-enumerateDevices >+ buildsystem: simple >+ build-commands: >+ - /app/webkit/Tools/Scripts/build-webkit --gtk --prefix=/app >+ >diff --git a/Tools/flatpak/org.webkit.WPE.yaml b/Tools/flatpak/org.webkit.WPE.yaml >new file mode 100644 >index 0000000000000000000000000000000000000000..1a795874fe80acb7581eff26df1dda9af5683811 >--- /dev/null >+++ b/Tools/flatpak/org.webkit.WPE.yaml >@@ -0,0 +1,47 @@ >+- name: wpebackend >+ buildsystem: cmake-ninja >+ sources: >+ - type: git >+ url: https://github.com/WebPlatformForEmbedded/WPEBackend.git >+ branch: 761496dff51b6962200294b4fe2bc9529da731a8 >+- name: wpebackend-fdo >+ buildsystem: cmake-ninja >+ sources: >+ - type: git >+ url: https://github.com/Igalia/WPEBackend-fdo.git >+ branch: bdd46870b1dc3c92005343e3161bdd24f620b11d >+- name: lua >+ buildsystem: simple >+ build-commands: >+ - make MYCFLAGS="$CFLAGS -fPIC -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1" linux >+ - make install INSTALL_TOP=/app INSTALL_MAN=/app/share/man/man1 INSTALL_DATA='cp -d' >+ sources: >+ - type: archive >+ url: https://www.lua.org/ftp/lua-5.3.4.tar.gz >+ sha1: 79790cfd40e09ba796b01a571d4d63b52b1cd950 >+- name: luajit >+ buildsystem: simple >+ build-commands: >+ - make amalg PREFIX=/app >+ - make install PREFIX=/app >+ sources: >+ - type: archive >+ url: https://luajit.org/download/LuaJIT-2.0.5.tar.gz >+ md5: 48353202cbcacab84ee41a5a70ea0a2c >+- name: webkitgtk-test-fonts >+ no-autogen: true >+ sources: >+ - type: git >+ url: https://github.com/WebKitGTK/webkitgtk-test-fonts.git >+ buildsystem: simple >+ build-commands: >+ # FIXME: Make ActivateFontWPE smarter. >+ - make install DESTDIR=/app/WebKitBuild/DependenciesWPE/Root >+- name: org.webkit.WPE >+ sources: >+ - type: git >+ url: https://github.com/WebKit/WebKit.git >+ branch: mediastream-minus-enumerateDevices >+ buildsystem: simple >+ build-commands: >+ - /app/webkit/Tools/Scripts/build-webkit --wpe --prefix=/app >\ No newline at end of file >diff --git a/Tools/flatpak/org.webkit.WebKit.yaml b/Tools/flatpak/org.webkit.WebKit.yaml >new file mode 100644 >index 0000000000000000000000000000000000000000..b9b94b5d01285713640aed87ca98ab488326faba >--- /dev/null >+++ b/Tools/flatpak/org.webkit.WebKit.yaml >@@ -0,0 +1,128 @@ >+app-id: %(PORTNAME)s >+runtime: org.gnome.Platform >+runtime-version: "3.28" >+# Control the exact version of the Sdk/Runtime that is being used. >+sdk-hash: cea71fe86d6961b4fe58046170f8dc8f8d4d04141ddf211e7cc6db44a18a0c49 >+runtime-hash: 9785cf7dc62290d76eef4bf0f5d25240fc5bb3d73128c25e95c4e4cb90bb3560 >+sdk: org.gnome.Sdk >+command: %(COMMAND)s >+finish-args: >+ # Basically no sandboxing, the goal here is to make it flexible >+ # for developers, not really to isolate (openning all devices >+ # to allow acces video cameras until we have a portal at least). >+ - --share=ipc >+ - --socket=x11 >+ - --socket=wayland >+ - --device=all >+ - --share=network >+ - --socket=pulseaudio >+ - --system-talk-name=org.freedesktop.GeoClue2 >+ - --filesystem=host >+ - --filesystem=/tmp >+ - --socket=system-bus >+ - --talk-name=org.freedesktop.Flatpak >+build-options: >+ cflags: -O2 -g >+ cxxflags: -O2 -g >+ strip: false >+ no-debuginfo: true >+modules: >+ - name: apr >+ sources: >+ - type: archive >+ url: https://www.apache.org/dist/apr/apr-1.6.3.tar.bz2 >+ sha256: 131f06d16d7aabd097fa992a33eec2b6af3962f93e6d570a9bd4d85e95993172 >+ - name: apr-util >+ sources: >+ - type: archive >+ url: https://www.apache.org/dist/apr/apr-util-1.6.1.tar.bz2 >+ sha512: "40eff8a37c0634f7fdddd6ca5e596b38de15fd10767a34c30bbe49c632816e8f3e1e230678034f578dd5816a94f246fb5dfdf48d644829af13bf28de3225205d" >+ config-opts: >+ - --with-apr=/app/bin/apr-1-config >+ - name: httpd >+ sources: >+ - type: git >+ url: https://github.com/apache/httpd.git >+ branch: 2.4.33 >+ - type : file >+ path : files/httpd-autogen.sh >+ dest-filename : autogen.sh >+ # The version embedded in the sandbox doesn't have a working pcre-config >+ - type: patch >+ path: patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch >+ config-opts: >+ - --enable-mpms-shared=all >+ - --enable-modules=all >+ - --with-apr=/app/bin/apr-1-config >+ - --with-apr-util=/app/bin/apu-1-config >+ - --with-pcre=/app >+ - --enable-authnz-fcgi >+ - --enable-cgi >+ - --enable-cgid >+ - name: php >+ sources: >+ - type: archive >+ url: https://php.net/distributions/php-7.2.6.tar.xz >+ sha512: da86b1ff2df3b9e2d46e59a80296b940d81132975b621bdec9602f8b4c8d91a3fdcd4ffd7cb982d63d3ec974b3a12a7854e42a73b7f2cc8eefade14335aa7c71 >+ config-opts: >+ - --disable-xml >+ - --disable-dom >+ - --disable-libxml >+ - --disable-simplexml >+ - --disable-xmlreader >+ - --disable-xmlwriter >+ - --without-pear >+ - --with-apxs2 >+ - name: libevent >+ sources: >+ - type: git >+ url: https://github.com/libevent/libevent.git >+ branch: e7ff4ef # 2.1.8 >+ config-opts: >+ - --disable-libevent-regress >+ - name: libvpx >+ no-autogen: true >+ sources: >+ - type: git >+ url: https://chromium.googlesource.com/webm/libvpx >+ branch: v1.7.0 >+ config-opts: >+ - --enable-pic >+ - --as=yasm >+ - --disable-unit-tests >+ - --size-limit=16384x16384 >+ - --enable-postproc >+ - --enable-multi-res-encoding >+ - --enable-temporal-denoising >+ - --enable-vp9-temporal-denoising >+ - --enable-vp9-postproc >+ - --enable-shared >+ - name: gst-plugins-base >+ buildsystem: meson >+ sources: >+ - type: git >+ url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-base.git >+ branch: 1.14.0 >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-base-0001-parsebin-Post-STREAM_COLLECTION-on-EVENT_STREAM_COLL.patch >+ config-opts: >+ - -Ddisable_gtkdoc=true >+ - name: gst-plugins-good >+ buildsystem: meson >+ sources: >+ - type: git >+ url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-good.git >+ branch: 1.14.0 >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0002-qtdemux-add-context-for-a-preferred-protection.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0003-qtdemux-also-push-buffers-without-encryption-info-in.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0001-qtdemux-Do-not-run-the-preferred-decryptor-context-q.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0002-qtdemux-Do-not-unref-a-NULL-stream_tags.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0003-qtdemux-Clarify-field-name-about-stream-encryption-s.patch >+ config-opts: >+ - -Ddisable_gtkdoc=true >+ - %(PORTNAME)s.yaml >\ No newline at end of file >diff --git a/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch b/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch >new file mode 100644 >index 0000000000000000000000000000000000000000..d36a694f2923d351db6f3f1332760283da78f9de >--- /dev/null >+++ b/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch >@@ -0,0 +1,50 @@ >+From b5ebe404f1388ddda3603e53277f87e0b96ba695 Mon Sep 17 00:00:00 2001 >+From: Thibault Saunier <tsaunier@igalia.com> >+Date: Mon, 11 Jun 2018 16:14:38 -0400 >+Subject: [PATCH] configure: use pkg-config for PCRE detection >+ >+--- >+ configure.in | 27 +++++---------------------- >+ 1 file changed, 5 insertions(+), 22 deletions(-) >+ >+diff --git a/configure.in b/configure.in >+index 761e836..b155d4b 100644 >+--- a/configure.in >++++ b/configure.in >+@@ -215,28 +215,11 @@ fi >+ AC_ARG_WITH(pcre, >+ APACHE_HELP_STRING(--with-pcre=PATH,Use external PCRE library)) >+ >+-AC_PATH_PROG(PCRE_CONFIG, pcre-config, false) >+-if test -d "$with_pcre" && test -x "$with_pcre/bin/pcre-config"; then >+- PCRE_CONFIG=$with_pcre/bin/pcre-config >+-elif test -x "$with_pcre"; then >+- PCRE_CONFIG=$with_pcre >+-fi >+- >+-if test "$PCRE_CONFIG" != "false"; then >+- if $PCRE_CONFIG --version >/dev/null 2>&1; then :; else >+- AC_MSG_ERROR([Did not find pcre-config script at $PCRE_CONFIG]) >+- fi >+- case `$PCRE_CONFIG --version` in >+- [[1-5].*]) >+- AC_MSG_ERROR([Need at least pcre version 6.0]) >+- ;; >+- esac >+- AC_MSG_NOTICE([Using external PCRE library from $PCRE_CONFIG]) >+- APR_ADDTO(PCRE_INCLUDES, [`$PCRE_CONFIG --cflags`]) >+- APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs`]) >+-else >+- AC_MSG_ERROR([pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/]) >+-fi >++PKG_CHECK_MODULES([PCRE], [libpcre], [ >++ AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library]) >++], [ >++ AC_MSG_ERROR([$PCRE_PKG_ERRORS]) >++]) >+ APACHE_SUBST(PCRE_LIBS) >+ >+ AC_MSG_NOTICE([]) >+-- >+2.17.1 >+ >diff --git a/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch b/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch >new file mode 100644 >index 0000000000000000000000000000000000000000..898842b381d25140fbc08f54a97230a6dbe4a450 >--- /dev/null >+++ b/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch >@@ -0,0 +1,50 @@ >+From aed1b6e8de41375c1b8b1dfc48a350e0a9b9cbba Mon Sep 17 00:00:00 2001 >+From: Thibault Saunier <tsaunier@igalia.com> >+Date: Mon, 11 Jun 2018 10:55:43 -0400 >+Subject: [PATCH xserver] HACK: Avoid compiling a kbm file >+ >+This would need to be in /usr/share/X11/ as this is where >+resource files are in the sandbox but it is read only in there. >+ >+Hack around that. >+--- >+ xkb/ddxLoad.c | 9 +-------- >+ xkb/xkbInit.c | 2 +- >+ 2 files changed, 2 insertions(+), 9 deletions(-) >+ >+diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c >+index bbe3952..a4a03a1 100644 >+--- a/xkb/ddxLoad.c >++++ b/xkb/ddxLoad.c >+@@ -148,14 +148,7 @@ RunXkbComp(xkbcomp_buffer_callback callback, void *userdata) >+ } >+ } >+ >+- if (asprintf(&buf, >+- "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " >+- "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", >+- xkbbindir, xkbbindirsep, >+- ((xkbDebugFlags < 2) ? 1 : >+- ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)), >+- xkbbasedirflag ? xkbbasedirflag : "", xkmfile, >+- PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, >++ if (asprintf(&buf, "cp /app/webkit/Tools/flatpak/files/default.xkm \"%s%s.xkm\"", >+ xkm_output_dir, keymap) == -1) >+ buf = NULL; >+ >+diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c >+index 9c772f5..4e0b774 100644 >+--- a/xkb/xkbInit.c >++++ b/xkb/xkbInit.c >+@@ -87,7 +87,7 @@ typedef struct _SrvXkmInfo { >+ #define XKB_DFLT_RULES_PROP TRUE >+ #endif >+ >+-const char *XkbBaseDirectory = XKB_BASE_DIRECTORY; >++const char *XkbBaseDirectory = "/usr/share/X11/xkb/"; >+ const char *XkbBinDirectory = XKB_BIN_DIRECTORY; >+ static int XkbWantAccessX = 0; >+ >+-- >+2.17.1 >+ >diff --git a/Tools/gstreamer/org.freedesktop.gstreamer.yaml b/Tools/gstreamer/org.freedesktop.gstreamer.yaml >new file mode 100644 >index 0000000000000000000000000000000000000000..0a0b3782f72bc168365f94b63a03dc363dc08c26 >--- /dev/null >+++ b/Tools/gstreamer/org.freedesktop.gstreamer.yaml >@@ -0,0 +1,45 @@ >+- name: libvpx >+ no-autogen: true >+ sources: >+ - type: git >+ url: https://chromium.googlesource.com/webm/libvpx >+ branch: v1.7.0 >+ config-opts: >+ - --enable-pic >+ - --as=yasm >+ - --disable-unit-tests >+ - --size-limit=16384x16384 >+ - --enable-postproc >+ - --enable-multi-res-encoding >+ - --enable-temporal-denoising >+ - --enable-vp9-temporal-denoising >+ - --enable-vp9-postproc >+ - --enable-shared >+- name: gst-plugins-base >+ buildsystem: meson >+ sources: >+ - type: git >+ url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-base.git >+ branch: 1.14.0 >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-base-0001-parsebin-Post-STREAM_COLLECTION-on-EVENT_STREAM_COLL.patch >+ config-opts: >+ - -Ddisable_gtkdoc=true >+- name: gst-plugins-good >+ buildsystem: meson >+ sources: >+ - type: git >+ url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-good.git >+ branch: 1.14.0 >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0002-qtdemux-add-context-for-a-preferred-protection.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0003-qtdemux-also-push-buffers-without-encryption-info-in.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0001-qtdemux-Do-not-run-the-preferred-decryptor-context-q.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0002-qtdemux-Do-not-unref-a-NULL-stream_tags.patch >+ - type: patch >+ path: ../gstreamer/patches/gst-plugins-good-0003-qtdemux-Clarify-field-name-about-stream-encryption-s.patch >+ config-opts: >+ - -Ddisable_gtkdoc=true >\ No newline at end of file >diff --git a/Tools/wpe/install-dependencies b/Tools/wpe/install-dependencies >index 14e68c28f339fbf755fbdd9678082ef497571a70..fc6c1632991dbaa0e07b5358f1940c0de6910a17 100755 >--- a/Tools/wpe/install-dependencies >+++ b/Tools/wpe/install-dependencies >@@ -139,6 +139,7 @@ function installDependenciesWithApt { > function installDependenciesWithPacman { > # These are dependencies necessary for building WPE. > packages=" \ >+ alsa-lib \ > autoconf \ > automake \ > bison \ >@@ -237,6 +238,7 @@ function installDependenciesWithDnf { > packages=" \ > autoconf \ > automake \ >+ alsa-lib-devel \ > bison \ > cmake \ > flex \ >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index cac2459c71239a577d64b6f8fc187a4ef89a71ed..523d5c2569d759f63c6bd31889214d9f58dd6e0a 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-06-13 Thibault Saunier <tsaunier@igalia.com> >+ >+ [WPE] Build getUserMedia support >+ https://bugs.webkit.org/show_bug.cgi?id=186547 >+ >+ Reviewed by Alejandro G. Castro. >+ >+ * platform/gtk/TestExpectations: Mark some tests as potentially passing (they fail only >+ when built in debug mode). >+ * platform/wpe/TestExpectations: Enable MediaStream tests. >+ > 2018-06-11 Chris Dumez <cdumez@apple.com> > > http/tests/security/cors-post-redirect-307.html fails with PSON enabled >diff --git a/LayoutTests/http/conf/flatpak-httpd.conf b/LayoutTests/http/conf/flatpak-httpd.conf >new file mode 100644 >index 0000000000000000000000000000000000000000..9d41435f87b4955cac164f839ac116b585cf0d62 >--- /dev/null >+++ b/LayoutTests/http/conf/flatpak-httpd.conf >@@ -0,0 +1,153 @@ >+ServerTokens OS >+ServerRoot "/app/" >+ >+PidFile "/tmp/WebKit/httpd.pid" >+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard" >+ >+Timeout 300 >+KeepAlive On >+MaxKeepAliveRequests 100 >+KeepAliveTimeout 15 >+ >+MinSpareServers 1 >+MaxSpareServers 5 >+StartServers 1 >+MaxClients 150 >+MaxRequestsPerChild 100000 >+ >+LoadModule mpm_prefork_module modules/mod_mpm_prefork.so >+LoadModule authz_core_module modules/mod_authz_core.so >+LoadModule authz_host_module modules/mod_authz_host.so >+LoadModule include_module modules/mod_include.so >+LoadModule headers_module modules/mod_headers.so >+LoadModule mime_module modules/mod_mime.so >+LoadModule negotiation_module modules/mod_negotiation.so >+LoadModule actions_module modules/mod_actions.so >+LoadModule alias_module modules/mod_alias.so >+LoadModule rewrite_module modules/mod_rewrite.so >+LoadModule unixd_module modules/mod_unixd.so >+LoadModule cgi_module modules/mod_cgi.so >+#LoadModule access_compat_module modules/mod_access_compat.so >+LoadModule log_config_module modules/mod_log_config.so >+#LoadModule imagemap_module modules/mod_imagemap.so >+LoadModule ssl_module modules/mod_ssl.so >+LoadModule php7_module modules/libphp7.so >+LoadModule asis_module modules/mod_asis.so >+ >+ServerName 127.0.0.1 >+ >+<Directory /> >+ Options Indexes FollowSymLinks MultiViews ExecCGI Includes >+ AllowOverride All >+ Require all granted >+</Directory> >+ >+AccessFileName .htaccess >+ >+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])"> >+ Require all denied >+</Files> >+ >+UseCanonicalName On >+HostnameLookups Off >+ >+TypesConfig /etc/mime.types >+ >+LogLevel warn >+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined >+LogFormat "%h %l %u %t \"%r\" %>s %b" common >+LogFormat "%{Referer}i -> %U" referer >+LogFormat "%{User-agent}i" agent >+ErrorLog /tmp/WebKit/error_log >+ >+ServerSignature On >+ >+AddLanguage ca .ca >+AddLanguage cs .cz .cs >+AddLanguage da .dk >+AddLanguage de .de >+AddLanguage el .el >+AddLanguage en .en >+AddLanguage eo .eo >+AddLanguage es .es >+AddLanguage et .et >+AddLanguage fr .fr >+AddLanguage he .he >+AddLanguage hr .hr >+AddLanguage it .it >+AddLanguage ja .ja >+AddLanguage ko .ko >+AddLanguage ltz .ltz >+AddLanguage nl .nl >+AddLanguage nn .nn >+AddLanguage no .no >+AddLanguage pl .po >+AddLanguage pt .pt >+AddLanguage pt-BR .pt-br >+AddLanguage ru .ru >+AddLanguage sv .sv >+AddLanguage zh-CN .zh-cn >+AddLanguage zh-TW .zh-tw >+AddCharset Big5 .Big5 .big5 >+AddCharset WINDOWS-1251 .cp-1251 >+AddCharset CP866 .cp866 >+AddCharset ISO-8859-5 .iso-ru >+AddCharset KOI8-R .koi8-r >+AddCharset UCS-2 .ucs2 >+AddCharset UCS-4 .ucs4 >+AddCharset UTF-8 .utf8 >+ >+<IfModule mod_negotiation.c> >+ LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW >+</IfModule> >+ >+AddType application/x-tar .tgz >+ >+AddEncoding x-compress .Z >+AddEncoding x-gzip .gz .tgz >+ >+AddType application/x-x509-ca-cert .crt >+AddType application/x-pkcs7-crl .crl >+ >+AddHandler cgi-script .cgi .pl >+ >+AddType text/html .shtml >+AddOutputFilter INCLUDES .shtml >+ >+AddHandler send-as-is asis >+ >+<IfModule mod_php5.c> >+ AddType application/x-httpd-php .php >+ AddType application/x-httpd-php .bat >+ AddType application/x-httpd-php-source .phps >+ >+ <IfModule mod_dir.c> >+ DirectoryIndex index.html index.php >+ </IfModule> >+ >+ php_flag log_errors on >+ php_flag short_open_tag on >+</IfModule> >+ >+<IfModule mod_rewrite.c> >+ RewriteEngine On >+ RewriteCond %{REQUEST_METHOD} ^TRACE >+ RewriteRule .* - [F] >+</IfModule> >+ >+<VirtualHost *:8443> >+ ServerName 127.0.0.1 >+ SSLEngine On >+</VirtualHost> >+ >+# >+# Apple-specific filesystem protection. >+# >+<Files "rsrc"> >+ Require all denied >+</Files> >+ >+<Directory ~ ".*\.\.namedfork"> >+ Require all denied >+</Directory> >+ >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index 59752370dce781f2cca3046d4b5fa6c4b56ae13b..6ddba57cb52f8ee29f9562ac577aefb40f982586 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -581,7 +581,7 @@ webkit.org/b/79203 fast/mediastream/getUserMedia-webaudio.html [ Failure ] > webkit.org/b/79203 fast/mediastream/MediaStream-video-element-track-stop.html [ Timeout ] > webkit.org/b/79203 fast/mediastream/RTCPeerConnection-dtmf.html [ Timeout ] > webkit.org/b/79203 fast/mediastream/RTCPeerConnection-icecandidate-event.html [ Failure Crash ] >-webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Failure Crash ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Pass Failure Crash ] > webkit.org/b/79203 fast/mediastream/RTCRtpSender-replaceTrack.html [ Failure ] > # Crash is webkit.org/b/184292 > webkit.org/b/79203 fast/mediastream/RTCPeerConnection-addIceCandidate.html [ Failure Pass Crash ] >@@ -591,7 +591,7 @@ webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-answer.html [ Fail > webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html [ Failure ] > webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer.html [ Failure ] > webkit.org/b/79203 fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html [ Failure ] >-webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Crash Failure ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Pass Crash Failure ] > webkit.org/b/79203 webaudio/mediastreamaudiosourcenode.html [ Failure ] > webkit.org/b/79203 fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html [ Timeout Failure ] > webkit.org/b/79203 fast/mediastream/MediaStream-video-element-displays-buffer.html [ Failure ] >@@ -604,6 +604,7 @@ webkit.org/b/151344 fast/mediastream/MediaStream-add-ended-tracks.html [ Timeout > webkit.org/b/160996 fast/mediastream/MediaStream-video-element-video-tracks-disabled.html [ ImageOnlyFailure Crash ] > webkit.org/b/172269 fast/mediastream/media-devices-enumerate-devices.html [ Failure ] > webkit.org/b/173257 fast/mediastream/getUserMedia-grant-persistency3.html [ Pass Failure ] >+webkit.org/b/176801 fast/mediastream/argument-types.html [ Crash Pass ] > > # Canvas captureStream support is not implemented > webkit.org/b/169811 fast/mediacapturefromelement [ Skip ] >@@ -1241,8 +1242,6 @@ webkit.org/b/172955 media/video-preload.html [ Crash Pass ] > > webkit.org/b/175575 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/ready-states/autoplay-with-slow-text-tracks.html [ Crash Pass ] > >-webkit.org/b/176801 fast/mediastream/argument-types.html [ Crash Pass ] >- > webkit.org/b/176803 http/tests/local/blob/send-hybrid-blob-using-open-panel.html [ Crash ] > > # See also webkit.org/b/141699 >diff --git a/LayoutTests/platform/wpe/TestExpectations b/LayoutTests/platform/wpe/TestExpectations >index 3e946580da958ea87b830c74c8a9234b0aabea3d..8b3f18c6ff00df8950e785a73a90d952578f537f 100644 >--- a/LayoutTests/platform/wpe/TestExpectations >+++ b/LayoutTests/platform/wpe/TestExpectations >@@ -15,6 +15,43 @@ Bug(WPE) webarchive/ [ Skip ] > Bug(WPE) webaudio/ [ Skip ] > Bug(WPE) webrtc [ Skip ] > >+# The MediaStream implementation is still not completed >+webkit.org/b/79203 fast/mediastream/mock-media-source-webaudio.html [ Timeout ] >+webkit.org/b/79203 fast/mediastream/getUserMedia-webaudio.html [ Failure ] >+webkit.org/b/79203 fast/mediastream/MediaStream-video-element-track-stop.html [ Timeout ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-dtmf.html [ Timeout ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-icecandidate-event.html [ Pass Failure Crash ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Pass Failure Crash ] >+webkit.org/b/79203 fast/mediastream/RTCRtpSender-replaceTrack.html [ Failure ] >+# Crash is webkit.org/b/184292 >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-addIceCandidate.html [ Failure Pass Crash ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html [ Failure Timeout ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-ice.html [ Failure Timeout ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-answer.html [ Pass Failure ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html [ Failure ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer.html [ Pass Failure ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html [ Pass Failure ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Pass Crash Failure ] >+webkit.org/b/79203 webaudio/mediastreamaudiosourcenode.html [ Failure ] >+webkit.org/b/79203 fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html [ Timeout Failure ] >+webkit.org/b/79203 fast/mediastream/MediaStream-video-element-displays-buffer.html [ Failure ] >+webkit.org/b/79203 http/tests/media/media-stream/getusermedia-with-canvas.html [ Crash ] >+webkit.org/b/79203 fast/mediastream/RTCPeerConnection-stats.html [ Timeout ] >+webkit.org/b/79203 imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-preload-none.https.html [ Failure ] >+webkit.org/b/79203 imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-end-manual.https.html [ Failure ] >+webkit.org/b/151344 fast/mediastream/MediaStream-add-ended-tracks.html [ Timeout ] >+# Crash is bug #176801 >+webkit.org/b/160996 fast/mediastream/MediaStream-video-element-video-tracks-disabled.html [ ImageOnlyFailure Crash ] >+webkit.org/b/172269 fast/mediastream/media-devices-enumerate-devices.html [ Failure ] >+webkit.org/b/173257 fast/mediastream/getUserMedia-grant-persistency3.html [ Pass Failure ] >+ >+# Canvas captureStream support is not implemented >+webkit.org/b/169811 fast/mediacapturefromelement [ Skip ] >+webkit.org/b/169811 fast/mediastream/captureStream/ [ Failure ] >+webkit.org/b/169811 fast/mediastream/captureStream/canvas2d.html [ Crash Timeout ] >+webkit.org/b/169811 fast/mediastream/captureStream/canvas3d.html [ Crash Timeout ] >+ >+ > # Doesn't apply to platforms that don't enforce the CFNetwork-style 3rd party cookie policy. > http/tests/cookies/third-party-cookie-relaxing.html [ WontFix Failure ] > >@@ -422,7 +459,6 @@ Bug(WPE) fast/loader [ Skip ] > Bug(WPE) fast/masking [ Skip ] > Bug(WPE) fast/media [ Skip ] > Bug(WPE) fast/mediacapturefromelement [ Skip ] >-Bug(WPE) fast/mediastream [ Skip ] > Bug(WPE) fast/multicol [ Skip ] > Bug(WPE) fast/overflow [ Skip ] > Bug(WPE) fast/picture [ Skip ] >diff --git a/ChangeLog b/ChangeLog >index 4f5dd5ca2fa8f1af19e3c801a79372179a91bce4..2e88391ceca922ef1782c13ebef9b736bfed9be1 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,12 @@ >+2018-06-13 Thibault Saunier <tsaunier@igalia.com> >+ >+ [WPE] Build getUserMedia support >+ https://bugs.webkit.org/show_bug.cgi?id=186547 >+ >+ Reviewed by Alejandro G. Castro. >+ >+ * Source/cmake/OptionsWPE.cmake: Build MediaStream support >+ > 2018-06-11 Michael Saboff <msaboff@apple.com> > > JavaScriptCore: Disable 32-bit JIT on Windows
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186547
:
342474
|
342539
|
342554
|
342558
|
342575
|
342606
|
342652
|
342653
|
342673